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

Accept scalar and array repository scopes in GitHub guard allowed-repos policies

Aperta
#15,352 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, go

Direzione di ricerca

Start by locating the gateway parser and policy enforcement code for allow-only.repos, then read the existing repository-pattern validation and matching tests. Add regression coverage for scalar and array inputs, special scopes, expression-resolved values, and invalid inputs; document the accepted contract. Done means both shapes follow the existing matching rules and malformed values do not broaden access.

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

Descrizione

Request

Support both a single repository string and an array of repository strings when parsing GitHub guard repository scopes (allowed-repos, serialized by gh-aw as allow-only.repos). These values can originate from GitHub Actions expressions, so callers cannot always determine the final repository value at compile time.

Context

Related compiler workaround: https://github.com/github/gh-aw/pull/70346

That PR wraps ordinary scalar repository scopes in a one-element array before emitting gateway, CLI proxy, and DIFC proxy policies, while preserving the special scalar scopes all and public. The gateway should accept both input shapes directly rather than requiring every producer to perform this normalization.

Expected behavior

  • Accept a scalar repository scope, for example {"allow-only":{"repos":"owner/repo"}}.
  • Accept multiple repository scopes, for example {"allow-only":{"repos":["owner/repo","other/repo"]}}.
  • Apply the same existing repository-pattern validation and matching semantics to a scalar and the equivalent one-element array, including supported wildcard patterns.
  • Preserve existing special-scope behavior for all and public.
  • Support expression-derived values after evaluation. For example, gh-aw configuration allowed-repos: ${{ github.repository }} should work when it resolves to a repository string; multiple repository strings supplied through an expression should work when the evaluated policy value is an array. Expression evaluation remains the caller/runtime's responsibility, not the gateway parser's.
  • Reject invalid types and malformed scopes explicitly without broadening repository access.

Acceptance criteria

Add parser and policy-enforcement regression coverage for scalar repositories, arrays with one or multiple repositories, supported wildcard patterns, existing special scopes, expression-resolved input in both supported shapes, and invalid inputs. Document the accepted string-or-array contract for repository scopes.

Lingua principale
Go
Stelle
182
Fork
54
Merge medio
6h 19m
PR unite (30g)
210

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 github/gh-aw-mcpg

Tutte le issue di github/gh-aw-mcpg

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.