Repository navigation
Git 备份可从打了 git 标签的环境预设取访问令牌 - #125
Merged
Merged
Conversation
- 访问令牌来源可选「手动填写」或「使用环境预设」:只列出打了 git 标签的预设, 只给变量名;保存和每次使用时都校验标签与变量,委员会去掉标签即失效 - 令牌在测试连接、备份、还原、换机时现取,预设里的令牌更新后即用上 - 预设弹窗支持编辑标签 - github.com 上的 HTTPS 令牌认证用户名改为 x-access-token(GitHub App 令牌要求) - 迁移 0062:bots 增加 git_token_preset、git_token_var Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
背景
组织用 GitHub App 令牌访问仓库,令牌已放在技能设置的环境预设里。工作目录 Git 备份希望直接选用这个预设,而不是每个员工手填令牌。
改动
GET /api/admin/bots/{id}/workspace/git/presets,只列打了git标签的预设,只返回变量名。git标签后员工管理员才能选用;保存配置与每次使用时都校验标签和变量是否存在。coreman/core/bots/git_token.py现取令牌,预设更新后立即生效。改回手动填写会解除预设绑定。x-access-token(GitHub App 令牌要求,个人令牌不看用户名),其他平台仍为oauth2。bots增加可空列git_token_preset、git_token_var。测试
tests/api/test_bot_workspace.py:只列 git 标签预设且不返回值;未打标签/变量不存在被拒;下发的令牌来自预设;改回手动填写后用员工自己的令牌。tests/unit/test_runtime_workspace.py:github.com 用x-access-token,其他主机用oauth2。兼容性
运行时改动需升级节点。迁移只加可空列。
🤖 Generated with Claude Code