InstallationPermissions is missing organization_private_registries
还没有人认领这个 Issue。
评估
调研方向
该 issue 位于 github/apps.go 中,具体是 InstallationPermissions 结构体。查看现有字段及其顺序。添加带有正确 JSON 标签的 'OrganizationPrivateRegistries' 字段。通过查阅 GitHub API 文档中关于权限键的部分进行验证。运行测试以确保结构体能正确地进行序列化/反序列化。
由索引模型根据 Issue 内容生成。
描述
Summary
InstallationPermissions in github/apps.go has no field for the organization_private_registries
App permission, so callers cannot read it off an installation and cannot request it when scoping
down an installation access token.
Detail
The endpoints it governs are already supported: github/private_registries.go, added in #3785 and
extended for OIDC in #4159. The permission itself is not modelled.
GitHub returns the key today. GET /orgs/{org}/installations includes it in an installation's
permissions map for any App that holds it:
"permissions": {
"organization_private_registries": "read"
}
The REST documentation for the private registries endpoints also names it, in the
"Fine-grained access tokens for ..." section of each endpoint, as "Organization private registries"
organization permissions, with GitHub App installation access tokens listed as supported:
https://docs.github.com/en/rest/private-registries/organization-configurations
Two consequences of the missing field:
- The value is silently dropped when an installation is unmarshalled, so
Installation.GetPermissions()cannot report it. Apps.CreateInstallationTokencannot request it viaInstallationTokenOptions.Permissions, so
Go code cannot mint a token narrowed to private registries. Callers have to fall back to an
untyped request that builds the permissions JSON by hand.
Checked on master and on v92.0.0. Alphabetically the field belongs between
OrganizationPreReceiveHooks and OrganizationProjects.
One note for anyone checking this against the published schema: the app-permissions schema in
octokit/openapi has no occurrence of private_registr at all. That schema also omits
organization_dependabot_secrets, which this struct already carries, so its omission is a gap in
the schema rather than evidence that the permission does not exist.
Proposed fix
Add the field and its generated accessor. I am planning to work on this and will open a PR.
- 主要语言
- Go
- 星标
- 11.3k
- 派生
- 2.5k
- 平均合并
- 1 天 16 小时
- 30 天内合并 PR
- 51
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
google/go-github 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 68/100
相似的 Issue
-
bug github_actions
难度 2/5 1-3 小时 新手友好度 75/100
registrystack/registry-stack#1393 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
JakeChampion/lang#10213 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
oasisprotocol/oasis-sdk#2523 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100