InstallationPermissions is missing organization_private_registries
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Issue nằm trong github/apps.go, cụ thể là struct InstallationPermissions. Hãy xem xét các trường hiện có và thứ tự của chúng. Thêm trường 'OrganizationPrivateRegistries' với thẻ JSON chính xác. Xác minh bằng cách kiểm tra tài liệu API của GitHub cho khóa quyền. Chạy các bài kiểm tra để đảm bảo struct được marshall/unmarshall chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 11.3k
- Fork
- 2.5k
- Merge trung bình
- 1 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 51
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/go-github
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
-
Add actions policies endpoints Đang mở
google/go-github#4583 · 2 bình luận · 1 reaction · 1 người được giao ·
-
google/go-github#4526 · 1 bình luận · 1 reaction · 1 người được giao ·
Tất cả issue của google/go-github
Issue tương tự
-
bug github_actions
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
registrystack/registry-stack#1393 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
JakeChampion/lang#10213 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100