Support per-method or per-resource scoping for API keys (beyond READ_ONLY/READ_WRITE)

Aperta
#7,223 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
32/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
go, grpc

Direzione di ricerca

Inizia con model.APIKey.Role e requireAPIKey() in pkg/app/server/grpcapi/api.go, quindi esamina gli handler ListApplications e SyncApplication che dichiarano i ruoli richiesti. Leggi la discussione collegata sul plugin Headlamp in #6706 per il contesto. Questo è completato quando un design degli scope è stato concordato, implementato e verificato da test che coprono l’accesso limitato per metodo o per risorsa.

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

Descrizione

This came up while discussing the Headlamp plugin proposal in #6706.

Right now model.APIKey.Role is a two-tier enum — READ_ONLY / READ_WRITE — set once per key at the project level. Enforcement happens per-RPC through requireAPIKey() in pkg/app/server/grpcapi/api.go, where each handler declares its own required role (e.g. ListApplications requires READ_ONLY, SyncApplication requires READ_WRITE). But there's no scoping within a role — a READ_WRITE key satisfies every READ_WRITE check unconditionally, across every RPC.

This becomes a real limitation for external integrations that only need one specific action. For example, if a Headlamp plugin (or any similar tool) just wants to call SyncApplication, the only option today is handing it a full READ_WRITE key — which also unlocks AddApplication, DeleteApplication, and everything else in that tier. There's no way to issue a key that can do less than "all of READ_WRITE."

Filing this mainly to track the idea rather than propose a full design. A couple of directions that seem reasonable on the surface:

  • An allowlist of specific RPCs/methods attached to a key, checked alongside the existing role.
  • Narrower sub-roles for common cases (e.g. a "sync-only" role) instead of a single blanket READ_WRITE.

Happy to help implement this if there's interest — just wanted to get the problem written down first in case others have opinions on the right shape for it.

Lingua principale
Go
Stelle
1.4k
Fork
391
Merge medio
4g 1h
PR unite (30g)
58

Preparare l'ambiente

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 pipe-cd/pipecd

Tutte le issue di pipe-cd/pipecd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.