aws-samples / aws-samples/sample-autonomous-cloud-coding-agents

feat(github): add user linking for GitHub issue-trigger attribution

Aperta
#584 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
adapters cli enhancement security
Lingua principale
TypeScript
Stelle
143
Fork
46
Merge medio
3g 10h
PR unite (30g)
24

Descrizione

## Component

CDK GitHub adapter, CLI, identity mapping

## Describe the feature

GitHub issue-triggered tasks need explicit user attribution like Linear and Jira. A GitHub issue author or labeler should map to a Cognito platform user so ABCA can enforce per-user concurrency, cost attribution, and auditability.

## Use case

Without a user mapping, all GitHub issue-triggered tasks would need either a shared fallback user or would be unattributed. That is weaker than Linear/Jira and makes cost/concurrency controls harder to reason about.

## Proposed solution

Add a GitHub user mapping flow modeled after Linear/Jira invite/link:

- Add a GitHub user mapping table keyed by GitHub login or node id.
- Add an admin command such as `bgagent github invite-user ` that resolves the GitHub identity and emits a one-time link code.
- Add `bgagent github link ` for a Cognito-authenticated teammate to confirm and bind the GitHub identity to their platform user.
- Add a Cognito-authenticated `POST /v1/github/link` route if the existing link API pattern requires it.
- Have the GitHub issue processor attribute tasks to the mapped GitHub sender or issue author, using a clear precedence documented in tests.
- If no mapping exists, reject task creation with a clear GitHub issue comment rather than running under a silent fallback identity.

## Acceptance criteria

- Admins can generate a one-time GitHub identity link code.
- Teammates can redeem the code and see the GitHub identity before confirming.
- GitHub issue-triggered tasks run under the linked platform user.
- Unmapped GitHub users receive a clear issue comment and no task is created.
- Existing Linear/Jira identity mappings are unaffected.

## Tests

- CLI tests cover invite and link flows.
- Handler tests cover dry-run/confirmation behavior and expired/invalid codes.
- GitHub issue processor tests cover mapped and unmapped users.
- Docs explain teammate onboarding for GitHub Issues.

## Out of scope

- Per-user GitHub OAuth tokens.
- Replacing the existing GitHub App/PAT credential path.
- Organization-wide fallback users.
- GitHub Enterprise Server identity mapping.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia tracciando i flussi esistenti di invito e link di Linear/Jira, quindi esamina il processore dei GitHub issue e le aree di test di CLI e handler menzionate nell’issue. Il lavoro è completo quando gli amministratori possono creare codici monouso, i membri del team possono confermare la propria identità, gli utenti mappati ricevono l’attribuzione, gli utenti non mappati ricevono un commento chiaro senza creare attività e le mappature esistenti rimangono inalterate.

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

Valutazione

Stack tecnologico
aws, github, typescript
Ambito
api, authentication, authorization, backend-api-design, cli, documentation
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.