feat(auth): simplifie l'auth GitHub - derive nom+email du PAT, 2 etapes claires, retry (AC-R036)#12
Merged
Merged
Conversation
Quatre ameliorations du bloc GitHub de phase_a :
1. Dérivation API réussie (curl 2xx + login + id) → plus de prompts
'Nom pour les commits' ni 'Email noreply GitHub'. Utilisation
directe du login et de l'email noreply <id>+<login>@users.noreply.github.com.
Affiche 'ok Compte GitHub : login <email>' puis persist.
2. Fallback uniquement si la dérivation échoue (curl non-2xx, réseau,
parsing vide) → prompts manuels nom/email avec validation
'doit finir en users.noreply.github.com' (3 tentatives).
3. Séparation visuelle : info 'Étape suivante : colle ton PAT...'
avant le prompt_secret du token, rend les 2 etapes distinctes.
4. Detection token colle a mauvaise etape : regex PAT
(ghp_|github_pat_|gho_|ghs_|ghr_|.{31,}) → warn + retry.
Token invalide (curl non-2xx) → warn + retry (max 3).
Ne persiste jamais un token non valide.
Nettoyage : gh_login=id, gh_id=login inverses → desormais
gh_login=login (string), gh_id=id (numeric).
…R036) BACKLOG.md : ajout ticket T2-CH2 'Simplifier et fiabiliser l'auth GitHub du wizard'. T1.8 marque S24 comme absorbée par T2-CH2. FEEDBACK.md : AC-R019 passe a traite (renvoie T2-CH2). Ajout AC-R036 (UX auth GitHub, source Romaric), traite. TESTS.md : S31 réécrit (plus de prompts nom/email quand derivation OK). Ajout S40a-d couvrant : derivation OK sans prompts, token colle a mauvaise etape, token invalide + retry, fallback manuel.
…que) only Bug E2E : le retry rebouclait sur la question d'activation [o/N] non masquee, exposant un token colle en clair et faisant perdre le token sur la confirmation 'Reessayer ? [o/N]'. Correction : 1. Activation [o/N] posee UNE SEULE fois (hors boucle). 2. Token colle au [o/N] -> avertissement securite (revocation recommandee) + transition DIRECTE vers prompt_secret masque. 3. Token invalide -> warn + reboucle sur prompt_secret (masque) avec 'Recolle ton PAT (tentative N/3)'. Jamais de [o/N] en retry. 4. Ne jamais persister un token non valide. Adaptation TESTS.md S40 : retry sur prompt masque, token valide au 2e essai connecte directement (pas de fallback).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Point #2 des retours bêta-testeurs (cas Romaric, cf.
Produits/Albert Code/Findings bêta-testeurs). Le PAT GitHub permet déjà de tout dériver viaapi.github.com/user, donc on supprime les re-saisies, on clarifie les étapes et on gère les erreurs. Réf AC-R036.Changements
<id>+<login>@users.noreply.github.com; récap uniqueCompte GitHub : <login> <<email>>.users.noreply.github.com.Étape suivante : colle ton PAT).[o/N](regex PAT) → message « tu as collé ton token à la mauvaise étape » ; token invalide → « Échec : GitHub non connecté » ; retry (max 3). Jamais de token non validé persisté.Refacto en
_github_auth()+_github_fallback(). Tests S31 réécrit + S40x.Vérification
Testé en E2E : cas 1 (dérivation, zéro prompt) et cas 2 (détection mauvaise étape) OK ; un correctif de la boucle de retry (recoller le token dans le prompt masqué au lieu de re-demander
[o/N]) est ajouté sur la branche.