Keychain: migrate CodexBar Cache to data-protection keychain and finish prompt-proofing

Aperta
#2,562 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
swift

Direzione di ricerca

Inizia con l’audit di #2561, quindi esamina Sources/CodexBar/KeychainMigration.swift, ClaudeOAuthKeychainPromptMode.swift, i sette token store indicati e Scripts/sign-and-notarize.sh/package_app.sh. Esamina Tests/CodexBarTests/ClaudeUsageTests.swift intorno alla riga 613 ed esegui i test pertinenti. Il lavoro è completato quando la migrazione, il comportamento del prompt, gli entitlements, la modalità di escalation e il percorso CLI live sono gestiti senza regressioni.

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

Descrizione

clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider impact:security impact:ux-friction issue-rating: 🦞 diamond lobster P2

Follow-up to #2561, which stopped the acute "CodexBar Cache" login-keychain password prompts (ACL poisoning by unbundled binaries; test children escaping suppression). The structural fixes remain:

  1. Migrate the cache item to the data-protection keychain. Set kSecUseDataProtectionKeychain: true (+ access group) and drop the SecAccess trusted-app ACL entirely. Data-protection items are keyed to the code-signing identity and can never raise the legacy "wants to use your confidential information" dialog. Needs: keychain-access-groups entitlement plumbing in Scripts/sign-and-notarize.sh / package_app.sh (app + Contents/Helpers/CodexBarCLI), plus one-time migration that reads the legacy item, writes the DP item, and deletes the legacy one (its ACL cannot be repaired in place).
  2. KeychainMigration hygiene (Sources/CodexBar/KeychainMigration.swift:75-133): reads without NoUI and delete-then-re-add drops any existing ACL. Should apply KeychainNoUIQuery and preserve/rebuild access attributes.
  3. Seven provider token stores (CookieHeaderStore, CopilotTokenStore, KimiTokenStore, ZaiTokenStore, SyntheticTokenStore, MiniMaxAPITokenStore, MiniMaxCookieStore) read with kSecReturnData and no NoUI; the preflight+warn pattern explains prompts but does not prevent them. Decide per-store whether silent failure + UI surfacing beats the OS prompt.
  4. effectiveMode escalation (ClaudeOAuthKeychainPromptMode.swift:69-78): selecting the experimental security-CLI read strategy silently forces the Security.framework fallback to .always prompting — should stay at the user's configured mode.
  5. ClaudeUsageTests live path spawns the real claude CLI through a PTY (Tests/CodexBarTests/ClaudeUsageTests.swift:613), whose keychain access CodexBar cannot suppress; consider gating harder or documenting.

Context: full audit in #2561's description; probe/audit session 2026-08-01.

Lingua principale
Swift
Stelle
23.3k
Fork
2.2k
Merge medio
1g 18h
PR unite (30g)
231

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 steipete/CodexBar

Tutte le issue di steipete/CodexBar

Issue simili

Altre issue su Swift

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.