Not yet rehearsed end to end on the deployed service. The testnet rehearsal will record the time
of each step and correct this page.
set -o pipefail, so a failed command in a pipe never stores an empty version. Then check how each variable is bound:
valueFrom.secretKeyRef is bound to Secret Manager: add a version (... | tr -d '\n' | gcloud secrets versions add <secret> --data-file=-) and rebind it with --update-secrets=<VAR>=<secret>:<n>. A secret value that is a plain environment variable is readable by anyone who can describe the service: bind it to a secret as part of the rotation, the same way. Never type a secret on the command line, where it lands in shell history and the process list; pipe it, or read it into a shell variable as below. Every update creates a revision that serves within about a minute; read the binding back after it.
Admin token
ADMIN_API_TOKEN gates the operator-only /admin/api-keys routes.
Blast radius: operators only. The old token stops working the moment the new revision serves. Integrators and users see nothing.
-
Generate the token into a new version, never on screen:
openssl rand -hex 32 | tr -d '\n' | gcloud secrets versions add <admin-token-secret> --data-file=-. Expected:Created version [<n>]. -
Rebind it:
gcloud run services update lumenwipe-api --region us-central1 --update-secrets=ADMIN_API_TOKEN=<admin-token-secret>:<n>. Expected:Done. -
Confirm, passing each token as a header file so it never appears on the command line:
Expected:
400for the new token (authorized, refused only for the missingowner),401for the old one. -
Disable the previous version:
gcloud secrets versions disable <previous n> --secret=<admin-token-secret>.
Integrator sign-in secret
INTEGRATOR_AUTH_SECRET signs the wallet sign-in challenge and the session tokens of the self-service key page. At least 32 characters.
Blast radius: everyone signed in to the key page is signed out, and a challenge issued before the switch no longer verifies, so they sign in again. API keys themselves are untouched and keep working.
-
openssl rand -hex 32 | tr -d '\n' | gcloud secrets versions add <integrator-secret> --data-file=-, then--update-secrets=INTEGRATOR_AUTH_SECRET=<integrator-secret>:<n>. Expected:Done. -
Confirm a new challenge is issued:
Expected:
200. Sign in on the key page with a testnet wallet: the keys list loads. - Disable the previous version.
Contract sign-in server account
INTEGRATOR_WEB_AUTH_SIGNING_SEED is the secret seed of the account that signs its own entry in every contract-account sign-in challenge. The account must exist on each network contract sign-in runs on, holding only its minimum balance; it signs nothing that can be submitted.
Blast radius: a challenge issued before the switch no longer verifies, so a contract account signing in at that moment signs in again. Sessions and API keys are untouched. Until the new account exists on a network, contract sign-in there answers 503 contract_sign_in_unavailable.
- Create a new key pair offline and fund its public key on each network: from Friendbot on testnet, and on mainnet with the base reserve, which a person sends.
-
printf '%s' '<new S... seed>' | gcloud secrets versions add <web-auth-seed-secret> --data-file=-, then--update-secrets=INTEGRATOR_WEB_AUTH_SIGNING_SEED=<web-auth-seed-secret>:<n>. Expected:Done. -
Confirm a challenge is issued:
Expected:
200. - Disable the previous version. The old account’s balance can be merged into the new one.
Testnet web authentication contract
INTEGRATOR_WEB_AUTH_CONTRACT_TESTNET names the testnet instance of the SEP-45 web authentication contract, running the attested reference build (SEP45_REFERENCE_WASM_HASH in apps/api/src/integrator/contract-auth.ts). It is not a secret, but it is set in two places: the API’s Cloud Run variable, and the GitHub repository variable of the same name that the nightly web-auth-ttl job in e2e-nightly.yml reads to extend the contract’s TTL. Mainnet uses SDF’s deployment and needs nothing here.
A testnet reset deletes the contract. Until it is recreated, testnet contract sign-in answers 503 contract_sign_in_unavailable and the nightly job fails with web_auth_missing.
- Recreate the instance from the attested build, copying its code from mainnet by hash, and note the new
C...address. - Point the API at it:
gcloud run services update lumenwipe-api --region us-central1 --update-env-vars=INTEGRATOR_WEB_AUTH_CONTRACT_TESTNET=<C...>. Expected:Done. - Update the repository variable, or the nightly job keeps checking the old address:
gh variable set INTEGRATOR_WEB_AUTH_CONTRACT_TESTNET --repo LumenWipe/lumenwipe --body '<C...>'. - Run
e2e-nightly.ymlfrom the Actions tab. Expected: the jobkeep the testnet web authentication contract livepasses, and an open tracking issue for it closes itself.
Static API keys
API_KEYS is a list of label=key pairs: the web app’s own key, the deploy smoke key and any manually provisioned partner. Self-serve keys are rotated by their owners on the key page and are not covered here.
Blast radius: the holder of the rotated key only. Overlap the two keys so nobody sees a 401.
-
Add the new key next to the old one, under the same label (two keys may share a label; metering counts them together).
API_KEYSholds every static key, so it is always bound to a secret; if it is still a plain variable, bind it now. Build the new list in a shell variable, never on screen:Expected:Created version [<n+1>],Done., and200. -
Move the holder to the new key, piped:
- the web app:
printf %s "$NEW_KEY" | vercel env add LUMENWIPE_API_KEY productionafter removing the old value withvercel env rm LUMENWIPE_API_KEY production, then redeploy the production build; - the deploy smoke test:
printf %s "$NEW_KEY" | gh secret set API_SMOKE_KEY; - a partner: through the channel agreed with them.
- the web app:
-
Remove the old key: add a version with the old pair removed from the list (read it, edit it in the shell variable, pipe it in as in step 1) and rebind it. Expected:
Done. -
Confirm the same
curlwith the old key answers401and with$NEW_KEY200; for the web app, a testnet close plan loads on the site. Thenunset NEW_KEY CURRENTand disable the superseded versions.
RPC and Horizon provider keys
Private providers authenticate with a header:STELLAR_RPC_HEADER_NAME_<NET> and STELLAR_RPC_HEADER_VALUE_<NET> for the first RPC URL, _2 and _3 suffixes for the later ones, and the same scheme under PATH_ROUTING_API_HEADER_* for the Horizon-compatible list. SOROSWAP_API_KEY and OCTOPOS_API_KEY are the conversion quote and position detection keys.
Blast radius: reads through that one provider. With a provider list, a provider whose key fails is answered with 503 and the client’s retry moves to the next one (Provider outage); with a single provider, the network’s reads fail until the new key is in.
- Create the new key in the provider’s console, keeping the old one active.
-
Paste the new value at a silent prompt, store it as a version and bind it:
Expected:
Created version [<n>]andDone. -
Confirm the provider answers:
Expected:
"state": "up"forrpcandhorizonon that network, and200from/health/deep. Each probe result is cached for one minute (five forpathsanddefi), so wait that long after the switch. These routes spend provider quota; call them a few times, not in a loop. - Revoke the old key in the provider’s console, then repeat step 3. Expected: unchanged.