browser: chrome-web-store-mint-credentials.py — mint the CWS OAuth trio into OpenBao #112
No reviewers
Labels
No labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
key-store/key.store!112
Loading…
Reference in a new issue
No description provided.
Delete branch "cws-mint-credentials"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #111. Producing the Chrome Web Store OAuth trio by hand means a code exchange with the client secret + code on a curl command line — against the values-never-in-argv rule every other secret writer here follows.
Scripts/browser/chrome-web-store-mint-credentials.py(stdlib only): prompts for the Desktop-app OAuth client id (echoed) / secret (getpass) → one-shot loopback listener with randomstate→ opens the consent URL (scopechromewebstore,access_type=offline,prompt=consent) → exchanges the code → proves the refresh token by minting an access token → optionalfetchStatuson the same v2 endpoint the upload script uses (--publisher-id/--item-id, verifies API enablement + ids) → threeScripts/openbao-kv.sh put age/browser/chrome-web-store-* --class runtime --age-path secrets/browser/...with the value on stdin → prints KV metadata only.Tested against stub token/API endpoints + a stub kv script: forged-state redirect → 400, real redirect accepted, exchange/refresh/fetchStatus exercised, the three puts get exactly the value bytes on stdin, zero secret bytes in stderr/stdout/log; the real
openbao-kv.sh --dry-runaccepts the argv shape. Workflow comment now points at the helper.The Upload (Browser Stores) lane now reads age/browser/chrome-web-store- {client-id,client-secret,refresh-token} from OpenBao (#111), but producing those values by hand means an OAuth code exchange with the client secret and code on a curl command line — against the values-never-in-argv rule every other secret writer here follows. Add a stdlib-only helper that does the whole mint: prompts for the Desktop- app OAuth client id (echoed) and secret (getpass), starts a one-shot loopback listener with a random state, opens Google's consent URL for scope chromewebstore with access_type=offline + prompt=consent, catches the code, exchanges it, proves the refresh token by minting an access token, optionally calls the same v2 fetchStatus endpoint the upload script uses (--publisher-id/--item-id: verifies API enablement + ids), then writes the three values through Scripts/openbao-kv.sh put ... --class runtime --age-path secrets/browser/... on stdin and prints only KV metadata. Nothing secret is printed, put in argv, or written to disk; the redirect handler never logs the request line. Tested against stub token/API endpoints and a stub kv script: forged-state redirect rejected (400), real redirect accepted, exchange + refresh + fetch Status paths exercised, three puts receive exactly the value bytes on stdin, zero secret bytes in stderr/stdout/log; the real openbao-kv.sh accepts the argv shape (--dry-run). Point the workflow comment at it.