browser: chrome-web-store-mint-credentials.py — mint the CWS OAuth trio into OpenBao #112

Merged
founder merged 1 commit from cws-mint-credentials into main 2026-08-16 23:37:16 +00:00
Owner

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 random state → opens the consent URL (scope chromewebstore, access_type=offline, prompt=consent) → exchanges the code → proves the refresh token by minting an access token → optional fetchStatus on the same v2 endpoint the upload script uses (--publisher-id/--item-id, verifies API enablement + ids) → three Scripts/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-run accepts the argv shape. Workflow comment now points at the helper.

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 random `state` → opens the consent URL (scope `chromewebstore`, `access_type=offline`, `prompt=consent`) → exchanges the code → proves the refresh token by minting an access token → optional `fetchStatus` on the same v2 endpoint the upload script uses (`--publisher-id`/`--item-id`, verifies API enablement + ids) → three `Scripts/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-run` accepts the argv shape. Workflow comment now points at the helper.
browser: chrome-web-store-mint-credentials.py — mint the CWS OAuth trio into OpenBao
Some checks failed
build-release.yml / browser: chrome-web-store-mint-credentials.py — mint the CWS OAuth trio into OpenBao (push) Failing after 0s
build-release.yml / browser: chrome-web-store-mint-credentials.py — mint the CWS OAuth trio into OpenBao (pull_request) Failing after 0s
Release: If Needed / Check (Release Needed) (push) Successful in 8s
Build: Web / Build (Web) (pull_request) Successful in 46s
Release: Signing Preflight / Release (Signing Preflight) (push) Successful in 55s
Build: Web / Build (Web) (push) Successful in 38s
Deploy: Web / Deploy (Web) (push) Successful in 2m15s
Deploy: API / Deploy (API) (push) Successful in 2m46s
8ac8e2f4da
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.
founder deleted branch cws-mint-credentials 2026-08-16 23:37:16 +00:00
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
key-store/key.store!112
No description provided.