feat: add Bearer Token support and auto-detection for API auth#116
Open
cherryepbz-cyber wants to merge 3 commits intoshareAI-lab:mainfrom
Open
feat: add Bearer Token support and auto-detection for API auth#116cherryepbz-cyber wants to merge 3 commits intoshareAI-lab:mainfrom
cherryepbz-cyber wants to merge 3 commits intoshareAI-lab:mainfrom
Conversation
|
@cherryepbz-cyber is attempting to deploy a commit to the crazyboym's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 功能改进:支持 Bearer Token 自动识别与多模型适配
feat: add Bearer Token support and auto-detection logic
🇨🇳 中文描述 (Chinese Description)
💡 改进背景
当前的认证方式主要硬编码支持
x-api-key。为了让本项目能够无缝兼容更多主流 AI 提供商(如 OpenAI, DeepSeek, 或是用户自建的 API 代理网关),我增加了对标准Authorization: Bearer格式的支持。🛠️ 主要改动
agents/目录下的所有脚本(s01-s12)。系统现在会根据环境变量自动判断采用哪种请求头。.env.example中增加了BEARER_TOKEN占位符。🧪 验证结果
API_KEY时,请求头包含x-api-key,运行正常。BEARER_TOKEN时,请求头包含Authorization: Bearer,运行正常。🇺🇸 English Description
💡 Context
The current implementation primarily supports
x-api-key. To ensure compatibility with a wider range of AI providers (e.g., OpenAI, DeepSeek, or custom API gateways), I have added support for the standardAuthorization: Bearerformat.🛠️ Key Changes
agents/directory (s01-s12). The system now automatically determines the appropriate header based on the available environment variables.BEARER_TOKENplaceholder to.env.example.🧪 Verification
x-api-key.Authorization: Bearer.Submitted by @cherryepbz-cyber