Repository navigation
[GH-P0] Coffre de secrets (AES-256-GCM) & schéma GitHub App - #229
Merged
Merged
Conversation
This was referenced Oct 13, 2026
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.
[GH-P0] Coffre de secrets & schéma
Plan :
devforge-plan-github-app.md, phase P0 uniquement. Aucun changement de route ni d'UI.Checklist d'acceptation
apps/server/src/secret_box.rs: AES-256-GCM, clé maîtreDEVFORGE_SECRET_KEY(32 octets base64), sinon$DEVFORGE_DATA_DIR/secret.keygénéré en 0600 (create_new). Formatv1:<nonce_b64>:<ct_b64>.SecretBox::seal(&[u8]) -> String,open(&str) -> Result<Zeroizing<Vec<u8>>>, plus les helpers globauxseal/open/open_compat/seal_compat.Redacted<T>(Debug/Display =***, règle globale 4).aes-gcm,rand,zeroize,jsonwebtoken,hmac,subtle(sha2conservé).jsonwebtoken/hmac/subtlesont déclarés pour P2/P3 et ne sont pas encore utilisés.db::migrate_github_app:github_app,github_installations,github_installation_repos,github_webhook_deliveries,github_manifest_states,pr_previews(TIMESTAMPTZ) + colonnesprojects.{github_installation_id, github_repo_id, pr_previews_enabled, legacy_webhook_id}(ALTER dont l'échec est toléré).user_settings.github_tokenetinstance_settings.github_tokenencore en clair ; lecture rétro-compatible (pas de préfixev1:= clair) dansuser_prefs::github_token,state::resolve_github_client,routes.rs,dev_env.rs; écriture scellée dansset_github_tokenetconfigure_github.Tests
secret_box_tests.rs: aller-retour, nonce différent à chaque seal, altération d'un octet ⇒Decrypt, mauvaise clé ⇒Decrypt, fichier clé en 0600 puis réutilisé, priorité à la variable d'env, clé ≠ 32 octets refusée,Redactedmasqué.github_app_migration_idempotent_and_pat_sealed(Postgres) :migratelancé 3 fois sans erreur, PAT en clair ⇒v1:puis relu en clair, nouvelle écriture scellée, 4 colonnes projet présentes,private_key_encscellé ne contient pasBEGIN RSA.cargo test --workspace⇒ 593 passés, 0 échec. Clippy : aucun avertissement dans les fichiers modifiés.cargo clippy --workspace -- -D warningséchoue déjà surmain(crates deploy/github/detect/mcp, problème antérieur, hors périmètre).Risques / décisions
secret.keyou fixerDEVFORGE_SECRET_KEYen prod. Un PAT scellé illisible est lu comme vide, sa valeur brute n'est jamais renvoyée.