test(cli): cover GitHub token verification at the HTTP boundary

Aperta Adatta ai principianti
#467 1 commento 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
76/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
github, typescript

Direzione di ricerca

Inizia da GhTokenAdapter.verifyToken e dalla porta del client HTTP che utilizza. Aggiungi test isolati per risposte GitHub riuscite, rifiutate, malformate e non riuscite, confermando il login previsto o l'errore di autenticazione documentato senza esporre il token fornito; usa solo il fake o il mock della porta, mai GitHub o una CLI dell'host.

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

Descrizione

Context

The July audit grouped global command orchestration, plugin restore and authentication coverage in one issue. PR #795 replaces that command topology and already adds focused coverage for the surviving flows:

  • status is retired and update is split by AI/IDE scope.
  • doctor, status and restore behavior have dedicated tests, including the empty-project health regression.
  • AuthProviderAdapter covers stored-token and external-provider login/status paths.

The remaining uncovered boundary is GhTokenAdapter.verifyToken: it turns a GitHub HTTP response into an authenticated login or an authentication failure.

Target

Add isolated tests for GhTokenAdapter using its HTTP-client port. Do not call GitHub and do not invoke a host CLI.

Acceptance criteria

  • A successful mocked GitHub user response returns the expected login.
  • A rejected, malformed, or non-success response becomes the documented authentication error.
  • The request carries the supplied token only in the authorization mechanism required by the adapter; neither assertion failures nor errors expose it.
  • Tests use the HTTP port fake/mock, never a live GitHub request.

Boundary

Do not duplicate AuthProviderAdapter coverage, restore E2E scenarios, or the retired *AllUseCase topology. This is one HTTP-adapter contract.

Lingua principale
TypeScript
Stelle
481
Fork
45
Merge medio
14h 36m
PR unite (30g)
110

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 ai-driven-dev/framework

Tutte le issue di ai-driven-dev/framework

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.