Skip to content

Commit 263f58b

Browse files
V48 Gate 3 (specification-only): local-development auth environment contract in the QA ledger
BITCODE_V48_QA.md records the decided local-dev auth topology: a dedicated Supabase project using localhost:3000 for everything browser-facing (Site URL, redirect allow-list callback, the custom:bitcode-bitcoin Authorization URL / wallet-proof page) and testnet.bitcode.exchange only for endpoints Supabase cloud must reach server-to-server (Token, Userinfo, JWKS); the shared-HMAC-secret law across provider config, testnet host, and local env (the authorization code is stateless, minted locally, verified at the testnet token endpoint); the testnet host's redirect-origin requirement; and the root-caused browser prerequisite (Chrome pop-ups/redirects allow — Don't-allow silently cancels the signInWithOAuth navigation). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent e670217 commit 263f58b

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

BITCODE_V48_QA.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@
77
- Posture: interactive local experiential QA of the first live commercial (testnet) experience; app runs locally (`pnpm -C uapi dev:remote`) against the staging Supabase project; wallet network testnet4
88
- Source-safety posture: source-safe evidence only; no secrets, protected source, provider payloads, wallet material, service-role keys, database credentials, or raw private prompts are serialized here.
99

10+
## Local-development auth environment (decided 2026-07-05)
11+
12+
A DEDICATED Supabase project for local development, replacing the shared
13+
staging project for local QA. Topology law: `localhost:3000` for as much as
14+
possible; `testnet.bitcode.exchange` only for functionality Supabase's cloud
15+
must reach server-to-server.
16+
17+
- **Auth URL configuration (new project):** Site URL `http://localhost:3000`;
18+
Redirect URLs (exact, query-free per the allow-list law):
19+
`http://localhost:3000/tps/supabase/callback` (+ `:3001` variant if used).
20+
- **Custom provider `custom:bitcode-bitcoin` (manual configuration):**
21+
- Authorization URL: `http://localhost:3000/tps/wallet/authorize`
22+
BROWSER hop, so localhost works and the wallet-proof page runs local code
23+
with local wallets.
24+
- Token URL: `https://testnet.bitcode.exchange/api/wallet/oauth/token`
25+
called SERVER-side by Supabase cloud; must be publicly reachable.
26+
- Userinfo URL: `https://testnet.bitcode.exchange/api/wallet/oauth/userinfo`
27+
— same server-side constraint.
28+
- JWKS URI: `https://testnet.bitcode.exchange/.well-known/jwks.json`.
29+
- Client ID `bitcode-bitcoin-wallet`; Allow users without email: on.
30+
- **Shared-secret law:** the authorization code is a stateless HMAC token, so
31+
ONE `BITCODE_BITCOIN_OAUTH_CLIENT_SECRET` value must be shared by (a) the
32+
provider Client Secret in the new Supabase project, (b) the
33+
`testnet.bitcode.exchange` deployment env, and (c) local `.env.local`
34+
a locally minted code must verify at the testnet token endpoint.
35+
- **testnet host requirement:** `testnet.bitcode.exchange`'s env must accept
36+
the new project's callback as a redirect target
37+
(`NEXT_PUBLIC_SUPABASE_URL`/`SUPABASE_URL` pointing at the new project, or
38+
the project origin listed in `BITCODE_BITCOIN_OAUTH_ALLOWED_REDIRECT_ORIGINS`)
39+
`isAllowedBitcoinWalletOAuthRedirectUri` reads those.
40+
- **Local `.env.local` switch:** `NEXT_PUBLIC_SUPABASE_URL` + anon key → the
41+
new project; `BITCODE_BITCOIN_OAUTH_CLIENT_SECRET` → the shared value.
42+
- **Browser prerequisite (root-caused 2026-07-05):** Chrome's "Pop-ups and
43+
redirects" must be allowed for the app origin — "Don't allow" silently
44+
cancels the programmatic `signInWithOAuth` navigation (URL built, request
45+
never leaves the page; the panel's 8s watchdog + manual-continuation link
46+
surface exactly this).
47+
1048
## Testnet BTC resources
1149

1250
- Faucet (testnet4): https://coinfaucet.eu/en/btc-testnet4/

0 commit comments

Comments
 (0)