innmind/http-authentication 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

innmind/http-authentication

Composer 安装命令:

composer require innmind/http-authentication

包简介

HTTP authentication

README 文档

README

Build Status codecov Type Coverage

Simple tool to authenticate a request.

Installation

composer require innmind/http-authentication

Usage

use Innmind\HttpAuthentication\ViaBasicAuthorization;
use Innmind\Router\{
    Router,
    Component,
    Collect,
    Handle,
};
use Innmind\Http\{
    ServerRequest,
    Response,
};
use Innmind\Immutable\Attempt;

function login(string $user, string $password): Attempt
{
    // find the user
}

$router = Router::of(
    Component::of(ViaBasicAuthorization::of(
        static fn(string $user, string $password) => login($user, $password),
    ))
        ->map(Collect::of('user'))
        ->pipe(Handle::of(
            static fn(ServerRequest $request, mixed $user) => Attempt::result(
                Response::of(
                    // build response
                ),
            ),
        ));
);

$response = $router(/* an instance of Innmind\Http\ServerRequest */)->unwrap();

统计信息

  • 总下载量: 2.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固