browser: Chrome Web Store uploads authenticate through Google WIF; stamp extension versions; browser lane opts into OIDC #129

Merged
founder merged 2 commits from cws-wif into main 2026-08-17 03:41:06 +00:00
Owner

Chrome Web Store via WIF (no OAuth client, no refresh token). CWS API v2 accepts a service account added under Account in the developer dashboard with an impersonation-minted token for scope chromewebstore. The release lane already holds that identity (Forgejo job token / Authentik cloud-signing → Google STS → release-signing@key-d0t-store impersonation — how Play uploads authenticate), so use it for Chrome too.

  • Scripts/browser/chrome-web-store-upload.sh: KEYSTORE_CHROME_WEB_STORE_AUTH_MODE=auto|wif|oauth (auto: preset access token → WIF when GOOGLE_APPLICATION_CREDENTIALS is an external_account credential → refresh-token trio). WIF = the same STS + generateAccessToken exchange as Scripts/android/play with the scope swapped; subject token reaches curl via --data-urlencode name@file, newline-trimmed; requires service_account_impersonation_url.
  • publish-store-uploads.yml, Upload (Browser Stores): mirrors Upload (Google Play) on main — enable-openid-connect: true (was missing since #111 → trust guard died at the OpenBao step under source=openbao; caught by adversarial review), Prepare Release Signing Identity with source: vars.KEYSTORE_CI_RELEASE_SECRETS_SOURCE || age + authority: release-publish, Configure Age gated != openbao, KEYSTORE_CHROME_WEB_STORE_AUTH_MODE from vars (default auto). OpenBao age/browser/* lines stay as the OAuth fallback + Firefox AMO.
  • Web/apps/extension/manifest.config.ts: both stores reject a version not strictly greater than the last accepted; version was fixed 0.1.0. Stamp 0.1.0.<BUILD_NUMBER> for chrome/firefox (Safari keeps three parts). BUILD_NUMBER is already in the Build Browser Extensions step env.

Verified: shellcheck clean (pre-existing SC2034 only); WIF path against stub STS + iamcredentials (exact token-exchange fields, newline stripped, scope=chromewebstore), then the real CWS API rejects the stub bearer with 401 as expected; auth-mode error paths; extensionVersion table (targets/env/bounds); YAML parses. Adversarial review (3 lenses × verify): version-stamping clean end-to-end (plumbing, all consumers, both stores’ rules); auth-flow clean field-by-field vs play/google-wif-auth.sh; workflow-wiring found the missing enable-openid-connect (fixed in c5641a6c) and the drift vs main’s source/authority (mirrored).

Operator prerequisites before dispatch: release-signing@key-d0t-store.iam.gserviceaccount.com added under Account in the CWS dashboard; repo vars KEYSTORE_CHROME_WEB_STORE_PUBLISHER_ID/_EXTENSION_ID (already set).

**Chrome Web Store via WIF (no OAuth client, no refresh token).** CWS API v2 accepts a service account added under *Account* in the developer dashboard with an impersonation-minted token for scope `chromewebstore`. The release lane already holds that identity (Forgejo job token / Authentik cloud-signing → Google STS → `release-signing@key-d0t-store` impersonation — how Play uploads authenticate), so use it for Chrome too. - `Scripts/browser/chrome-web-store-upload.sh`: `KEYSTORE_CHROME_WEB_STORE_AUTH_MODE=auto|wif|oauth` (auto: preset access token → WIF when `GOOGLE_APPLICATION_CREDENTIALS` is an external_account credential → refresh-token trio). WIF = the same STS + `generateAccessToken` exchange as `Scripts/android/play` with the scope swapped; subject token reaches curl via `--data-urlencode name@file`, newline-trimmed; requires `service_account_impersonation_url`. - `publish-store-uploads.yml`, *Upload (Browser Stores)*: mirrors *Upload (Google Play)* on main — `enable-openid-connect: true` (was missing since #111 → trust guard died at the OpenBao step under source=openbao; caught by adversarial review), *Prepare Release Signing Identity* with `source: vars.KEYSTORE_CI_RELEASE_SECRETS_SOURCE || age` + `authority: release-publish`, Configure Age gated `!= openbao`, `KEYSTORE_CHROME_WEB_STORE_AUTH_MODE` from vars (default auto). OpenBao `age/browser/*` lines stay as the OAuth fallback + Firefox AMO. - `Web/apps/extension/manifest.config.ts`: both stores reject a version not strictly greater than the last accepted; version was fixed `0.1.0`. Stamp `0.1.0.<BUILD_NUMBER>` for chrome/firefox (Safari keeps three parts). BUILD_NUMBER is already in the Build Browser Extensions step env. **Verified:** shellcheck clean (pre-existing SC2034 only); WIF path against stub STS + iamcredentials (exact token-exchange fields, newline stripped, `scope=chromewebstore`), then the real CWS API rejects the stub bearer with 401 as expected; auth-mode error paths; extensionVersion table (targets/env/bounds); YAML parses. Adversarial review (3 lenses × verify): version-stamping clean end-to-end (plumbing, all consumers, both stores’ rules); auth-flow clean field-by-field vs `play`/`google-wif-auth.sh`; workflow-wiring found the missing `enable-openid-connect` (fixed in c5641a6c) and the drift vs main’s `source`/`authority` (mirrored). **Operator prerequisites before dispatch:** `release-signing@key-d0t-store.iam.gserviceaccount.com` added under Account in the CWS dashboard; repo vars `KEYSTORE_CHROME_WEB_STORE_PUBLISHER_ID`/`_EXTENSION_ID` (already set).
The Chrome Web Store API v2 accepts a Google service account (added under
Account in the developer dashboard) with an access token minted by
impersonation for scope chromewebstore. The release lane already holds
exactly that identity: Authentik cloud-signing token -> Google STS ->
release-signing@key-d0t-store impersonation, which is how Play uploads
authenticate. Use it for Chrome too, so no user OAuth client and no
long-lived refresh token have to exist at all.

- Scripts/browser/chrome-web-store-upload.sh: KEYSTORE_CHROME_WEB_STORE_
  AUTH_MODE=auto|wif|oauth (default auto: a preset access token, else WIF
  when GOOGLE_APPLICATION_CREDENTIALS is an external_account credential,
  else the refresh-token trio). wif performs the same exchange as
  Scripts/android/play with the scope swapped; the subject token reaches
  curl via --data-urlencode name@file, never argv, and is newline-trimmed
  first. Requires service_account_impersonation_url — the store grants the
  service account, not the raw federated principal.
- publish-store-uploads.yml, Upload (Browser Stores): Configure Age now
  unconditional (release-signing-identity still decrypts secrets/cloud-
  signing/ with it, as in the Play job); add Prepare Authentik Release
  Identity with require-google; KEYSTORE_CHROME_WEB_STORE_AUTH_MODE from
  vars (default auto). The OpenBao age/browser/* lines stay as the OAuth
  fallback + Firefox AMO.
- Web/apps/extension/manifest.config.ts: both stores reject an upload
  whose version is not strictly greater than the last accepted one, and
  the manifest version was a fixed 0.1.0 — the second automated upload
  would fail. Stamp 0.1.0.<BUILD_NUMBER> for chrome/firefox (1-4
  components, each <= 65535; the bare 0.1.0 already in the store sorts
  below); Safari keeps three parts (CFBundleShortVersionString limit).
  BUILD_NUMBER is already in the Build Browser Extensions step env.

Tested: shellcheck clean (pre-existing SC2034 only); WIF path against
stub STS + iamcredentials endpoints (exact token-exchange fields, subject
token newline stripped, impersonation body scope=chromewebstore) and the
real chromewebstore API then rejects the stub bearer with 401 as expected;
wif/oauth/auto missing-config errors; extensionVersion table (targets,
env precedence, bounds). Workflow YAML parses; step order verified.
publish-store-uploads: browser lane opts into OIDC and takes the job-token release identity like Play
Some checks failed
Build: Web / Build (Web) (pull_request) Successful in 36s
Build: Web / Build (Web) (push) Successful in 33s
Release: Signing Preflight / Release (Signing Preflight) (push) Successful in 54s
Release: If Needed / Check (Release Needed) (push) Has been cancelled
Deploy: Web / Deploy (Web) (push) Has been cancelled
Deploy: API / Deploy (API) (push) Has been cancelled
c5641a6c8e
Adversarial review of the WIF change found the one real defect: since #111
moved Upload (Browser Stores) onto openbao-secrets it never set
enable-openid-connect: true, so with KEYSTORE_CI_RELEASE_SECRETS_SOURCE=openbao
the trust guard dies at 'ACTIONS_ID_TOKEN_REQUEST_TOKEN is missing' before the
blob download and both store uploads (every sibling job has the flag). Add it.

main also moved (#119): release-signing-identity gained source/authority and
the Play job now takes the Forgejo job token at provider forgejo-release-publish
with Configure Age gated to the age source. Mirror that exactly here —
source: vars.KEYSTORE_CI_RELEASE_SECRETS_SOURCE || 'age', authority:
release-publish, step renamed Prepare Release Signing Identity, Configure Age
!= openbao — so Chrome uploads use the same identity path as Play rather than
the Authentik/age path the retirement plan (KSE-0182 A.5 phase 3) removes.
Env blocks of the three callers are identical.
founder deleted branch cws-wif 2026-08-17 03:41:06 +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!129
No description provided.