Skip to content

quillphp/quill-key-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quill API Key Auth Middleware

High-speed API Key authentication middleware for the Quill PHP Framework.

Installation

composer require quillphp/key-auth

Usage

use Quill\KeyAuth\KeyAuth;

$app->use(KeyAuth::new([
    'keys'   => ['secret-api-key-1', 'secret-api-key-2'],
    'header' => 'X-API-Key',
]));

Configuration

Option Default Description
`query` `'api_key'` The URL query parameter to check.
`keys` `[]` An array of valid API keys.
`validator` `null` Custom validator closure: `fn(string $key) => bool`.
`error_code` `401` The error code to return for unauthorized requests.
`error_message` `'Unauthorized: Invalid or missing API Key'` The error message to return.

License

MIT

About

High-speed API Key authentication middleware for the Quill PHP Framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages