juststeveking/http-auth-strategies 问题修复 & 功能扩展

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

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

juststeveking/http-auth-strategies

最新稳定版本:v1.2.0

Composer 安装命令:

composer require juststeveking/http-auth-strategies

包简介

A simple PHP package that is used to create different Http Auth Headers

README 文档

README

Latest Version PHP Version tests Check & fix styling Total Downloads

A simple PHP package that is used to create different Http Auth Headers.

This is a simple to use library, to install - all you need to do is:

$ composer require juststeveking/http-auth-strategies

Then to use the library all you need to do is:

$strategy = new BasicStrategy( base64_encode("username:password") ); // Get the Auth header as an array - passing through the required Authorization prefix $strategy->getHeader('Bearer'); // ['Authorization' => 'Bearer dXNlcm5hbWU6cGFzc3dvcmQ=']

There is also a NullStrategy for when you want to follow a consistent pattern, but do not want to actually use any auth:

$strategy = new NullStrategy(); // Get the Auth header as an array - passing through the required Authorization prefix $strategy->getHeader('Bearer'); // []

You can now also create your own custom header using the CustomStrategy, for when an API requires something specific that doesn't follow the typical pattern:

$strategy = new CustomStrategy( 'your-api-key' ); $strategy->setHeaderName('X-API-KEY'); // Get the Auth header as an array - passing through the required Authorization prefix $strategy->getHeader('Bearer'); // ['X-API-KEY' => 'Bearer your-api-key']

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固