Repository navigation
[v2] 自定义插件市场来源支持内部 Git 认证:设置页配置、同步时使用 - #365
Merged
Merged
Conversation
Resolve the conflict in v2-server/internal/store/market_sources.go: main removed the role check at the top of ChangeMarket (cloud#363 moved it to the owner route), so the sync branch now declares e itself; keep the git_credentials column this branch reads there. Update the Git credential tests to the store signatures after cloud#363: TenantSpaces takes a store.Access, and ChangeMarket and MarketSources no longer take the caller.
Saved Git credentials are sealed to the source namespace, and the namespace follows the repository URL. Editing a source's URL without touching its authentication kept a ciphertext the new namespace could not open: the page still showed the credentials as configured while every sync failed with market_credentials_unavailable. Reject such an edit, as S3 credentials already are, unless it supplies new credentials or clears the saved ones. The source stays unchanged when the edit is rejected. The form and README say so.
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.
做了什么
自定义插件市场来源支持 HTTPS Git 认证(用户名加令牌或密码),供内网部署使用。
v2_market_sources新增git_credentials列,与 S3 凭据一样以 AES-256-GCM(V2_MARKET_CREDENTIAL_KEY)加密存库,绑定到空间和来源;读取接口只返回gitConfigured是否已配置,绝不返回凭据;可整体替换、保留或清除。gitAuthEnv以http.extraHeader形式(通过GIT_CONFIG_COUNT环境变量注入 git 配置)交给 git clone,凭据不进入仓库地址、命令行参数、日志或工作目录的 git 配置;失败时区分认证失败与网络失败,来源上分别显示"仓库认证失败,请检查 Git 用户名和令牌。"与"请检查仓库地址和分支。",并保留上一版目录。测试
pluginmarket:gitAuthEnv只注入请求头(凭据不落到其它环境项);gitAuthError正确区分认证失败与网络失败;带认证的本地 HTTPS Git 仓库(git http-backend+ Basic Auth)能同步、错误凭据失败且密码不泄漏到错误输出。store:Git 凭据加密存储、读取不返回、无关编辑保留、新凭据替换、显式清除、空值拒绝。本地验证:v2-server
go test ./...全绿;frontend-v2 808 个测试、typecheck、lint、build 全绿。v2 流程,送审附截图(见运行 issue)。