quillphp/key-auth
Composer 安装命令:
composer require quillphp/key-auth
包简介
API Key authentication middleware for the Quill PHP framework
README 文档
README
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
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-06