bogosoft/http-auth
Composer 安装命令:
composer require bogosoft/http-auth
包简介
A library for PSR-7 and PSR-15 compliant authentication middleware.
README 文档
README
A PHP library for PSR-7 and PSR-15 compliant authentication middleware.
Requirements
- PHP >= 7.4
Package Dependencies
Installation
composer require bogosoft/http-auth
Summary
This small library contains a PSR-15 compliant authentication middleware component, AuthenticationMiddleware,
with the following responsibilities:
- Derive a security context (
IPrincipalobject) from a PSR-7 compliant HTTP request. TheIPrincipalcontract is from thebogosoft/identitypackage. - Pass the derived security context to a
IPrincipalHandlerobject on a successful authentication attempt. - Immediately return an HTTP response with a
401 Unauthorizedstatus code on a failed authentication attempt. this is configurable.
Interfaces
| Name | Purpose |
|---|---|
IAuthenticator |
Derives a security context (IPrincipal) from an HTTP request. |
IPrincipalHandler |
Handles a derived security context and allows for HTTP request modification. |
Implementations
| Name | Interface | Details |
|---|---|---|
CompositeAuthenticator |
IAuthenticator |
Allows multiple IAuthenticator objects to behave as one. |
DelegatedAuthenticator |
IAuthenticator |
Turns a callable object in an IAuthenticator interface. |
AuthenticationMiddleware |
MiddlewareInterface |
An authenticating middleware component. |
AttributePrincipalHandler |
IPrincipalHandler |
Stores the derived IPrincipal object into a mutated HTTP request as an attribute. |
DelegatedPrincipalHandler |
IPrincipalHandler |
Turns a callable object into a IPrincipalHandler. |
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-11-29