future-station/keyguard

A PHP package for validating API keys, secrets, and tokens for popular services.

v0.1.1 2024-08-26 14:19 UTC

This package is auto-updated.

Last update: 2024-11-26 15:39:56 UTC


README

KeyGuard

GitHub Workflow Status (main) Total Downloads Latest Version License

KeyGuard is a powerful PHP package designed to validate API keys, secrets, access tokens, and HMACs for popular services like OpenAI, GitHub, Shopify, and more. This tool is essential for developers and businesses that depend on secure and accurate validation of their API credentials.

Contributors

This package is made possible thanks to the contributions of these developers:

If you or your organization benefits from using KeyGuard, please consider supporting the developers who have invested their time and expertise into creating and maintaining this invaluable tool.

Get Started

Prerequisite: PHP 8.1 or higher is required. Download PHP

Installation

To begin using KeyGuard, install the package via Composer:

composer require future-station/keyguard

If your project does not already include a PSR-18 HTTP client, ensure the php-http/discovery plugin is enabled, or manually install a compatible client such as Guzzle:

composer require guzzlehttp/guzzle

Usage Example

Below is a basic example demonstrating how to validate a GitHub API key using KeyGuard:

$yourApiKey = 'YOUR_API_KEY';
$keyguard = new KeyGuard();

$result = $keyguard
            ->validate(ServiceType::GITHUB, $yourApiKey);

echo $result->value; // Output: valid

License

KeyGuard is open-source software licensed under the BSD 3-Clause License.