Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

InstallationPermissions is missing organization_private_registries

Aperta Adatta ai principianti
#4,590 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api

Direzione di ricerca

Il problema si trova in github/apps.go, specificatamente nella struttura InstallationPermissions. Osserva i campi esistenti e il loro ordine. Aggiungi il campo 'OrganizationPrivateRegistries' con il tag JSON corretto. Verifica controllando la documentazione dell'API GitHub per la chiave di permesso. Esegui i test per assicurarti che la struttura venga marshallata/unmarshallata correttamente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.CreateInstallationToken cannot request it via InstallationTokenOptions.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.

Lingua principale
Go
Stelle
11.3k
Fork
2.5k
Merge medio
1g 16h
PR unite (30g)
51

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di google/go-github

Tutte le issue di google/go-github

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.