Repository navigation
ABUSE-001A1 — Use reCAPTCHA Enterprise for browser App Check #159
Description
Officer impact: No current officer screen or procedure changes. This source-only slice aligns the browser App Check provider with the approved reCAPTCHA Enterprise design so a later protected release can use the correct public site key.
Officer documentation: None — no officer action is usable after this slice. Provider creation, allowed domains, protected configuration, staged metrics, enforcement, deployment, and live verification remain owner/operations work under #113, #133, #136, ABUSE-001A2, and ABUSE-001C.
Deployment evidence: None at issue creation. Closure proves source, tests, review, merge, and exact-commit CI only. It must not claim a site key, provider-console configuration, callable enforcement, website/Firebase publication, or live App Check behavior.
Parent and dependencies
Atomic source child of catalogued ABUSE-001 / ABUSE-001A.
- CI source/test baseline is merged.
- Browser callback/local isolation from SAFETY-001 — Preserve callbacks and fail closed on local Firebase isolation #99/CI-001B1A — Run SPA callback safety tests in hosted CI #126 is merged and must be preserved.
- OBS-001 source removed Analytics and must be preserved.
- The protected release currently fails closed because
REACT_APP_RECAPTCHA_SITE_KEYis absent. - A read-only release audit recorded that current source instantiates
ReCaptchaV3Provider, whileSECURITY.mdrequires Enterprise. - Firebase web SDK 10.14.1 already exports
ReCaptchaEnterpriseProvider; no dependency change is needed.
This child only corrects the browser provider class. Native callable enforcement must be a separate ABUSE-001A2 slice after safe callback handoffs.
Problem
The browser source imports and instantiates the v3 provider. The approved security architecture and planned provider configuration require reCAPTCHA Enterprise. Supplying an Enterprise key to the v3 provider would be a configuration mismatch and could make a protected release fail or silently lack the intended control.
Atomic outcome
- Replace the browser App Check v3 provider import/constructor with
ReCaptchaEnterpriseProvider. - Preserve local/test shutdown, capability-callback shutdown, missing-key fixed diagnostic, token auto-refresh, and generic initialization failure behavior.
- Add focused tests proving Enterprise is used exactly once for an ordinary production page with a configured synthetic public key and v3 is absent/not called.
- Keep every provider key, console/IAM setting, enforcement choice, and deployment outside this pull request.
- Update only the minimum authoritative security/operations/status documentation.
Security invariants
- Never add, request, print, commit, or invent a real site key, debug token, service credential, or provider response.
- App Check does not replace Auth, verified membership, capability checks, Rules, strict schemas, rate limits, or fraud controls.
- Development/test must not initialize App Check or exchange a debug token.
- Initial Stripe/Strava/capability callback URLs must not initialize App Check or outside telemetry.
- Missing key and initialization failure use existing fixed diagnostics without provider details or tokens.
- Only an ordinary production page with a configured synthetic key may construct the Enterprise provider in tests.
- A source import/constructor change does not prove provider configuration, enforcement, token acceptance, or deployment.
Exact source boundary
src/services/firebase/FirebaseResources.tssrc/services/firebase/FirebaseResources.test.ts- Minimum exact status/design hunks only in:
SECURITY.mdOPERATIONS_RUNBOOK.mdGITHUB_ISSUES.mdGITHUB_ISSUE_SLICES.md
Post a scope amendment before editing Functions, workflows, environment files, package/lockfiles, Firebase configuration values, provider settings, Rules, client screens, officer guides, or production data.
Acceptance criteria
- Production with a configured synthetic public key constructs
ReCaptchaEnterpriseProviderand passes it toinitializeAppCheckwith token auto-refresh unchanged. - No production source import or constructor reference to
ReCaptchaV3Providerremains. - Development and test construct neither Enterprise nor v3 providers and retain demo-only Auth/Firestore/Functions emulators.
- Every existing capability callback variant constructs neither provider and does not initialize App Check or Analytics.
- Missing-key and initialization-failure tests retain fixed redacted diagnostics and no hostile canary.
- No real key, debug token, credential, private locator, provider response, or production data appears in source, tests, docs, logs, issue, or PR.
- Node 20 focused FirebaseResources tests, full frontend Jest, standalone SPA callback tests, changed-file lint, diagnostic build, hosted CI, diff/sensitive-pattern review, and independent review pass.
- Root docs distinguish source changed, merged, provider configured, website published, callable enforcement enabled, and live behavior verified.
- No workflow, package/lock, Function, Rule, environment, provider, or production setting changes.
Excluded
- Creating or configuring a reCAPTCHA Enterprise key/project/domain policy.
- Adding a key to GitHub/Netlify/Firebase/provider settings.
- Native
enforceAppCheck: truecallable migration or staged metrics (ABUSE-001A2). - Callback handoff changes (DATA-001A and OAUTH-001C/STRAVA-001 — Harden and modernize the existing Strava OAuth connection #88).
- HMAC rate limits/TTL/alerts (ABUSE-001B/C).
- Protected deployment identity/environment or website/Firebase release (CI-001C — Configure protected short-lived Firebase deployment identity #133/CI-001D — Prove backend-first staging and deploy the profile repair #136/WEB-001).
- Profile/email/event behavior, Stripe behavior, dependency changes, or production testing.
Claim protocol
Creation is not a claim. Before editing: confirm exact current main, assign the issue, post CLAIMED by /root at <UTC>; branch codex/issue-<number>-app-check-enterprise, apply status:in-progress, and use an isolated worktree.
Activity
daliu commentedon Jul 13, 2026
CLAIMED by /root at 2026-07-13T14:34:45Z; branch
codex/issue-159-app-check-enterprise; exact basee5a0390f8c1c9dc9a51f83457cd3623ea0bc9723.Active ownership is exactly the two FirebaseResources source/test files plus minimum status/design hunks in SECURITY.md, OPERATIONS_RUNBOOK.md, GITHUB_ISSUES.md, and GITHUB_ISSUE_SLICES.md. Functions, workflows, packages/lockfiles, environment files, provider settings, Rules, screens, officer guides, and production data are immutable. No real key or provider configuration will be used.
daliu commentedon Jul 13, 2026
EXTRACTION FINISHED by /root at 2026-07-13T14:42:35Z.
Exact staged diff hash:
525928f78fa8ade111b3317190b57db1f515aed1Owned paths: exactly the six paths declared in the issue. No workflow, package/lockfile, environment, Function, Rule, provider-console, key, enforcement, or production change.
Verification on Node v20.20.2:
Deployment truth: source and tests only at this point. No Enterprise key, allowed-domain policy, protected build variable, website/Firebase publication, callable enforcement, provider readback, token exchange, or live behavior is configured or proven.
daliu commentedon Jul 13, 2026
COMPLETE by /root at 2026-07-13T14:48:02Z.
14a333bdbf5d09b9dffc34339150fcb4497ec330main:317b800cd39af136828de0d4eb23fbef66c2b39029259142366: frontend, Functions, and Rules passed29259342966: frontend 132/132 plus SPA 10/10 and release-workflow 13/13; Functions 457 passed/1 intentional skip; Rules 305/3056a54f97f7e026c000828d663: ready; preview only6a54fa22230b8000085802ecfor the exact merge: error withpublished_atempty; nothing publishedrunmprc.comremains on verified deploy6a54a3c93db9d300082e1f5fat older commite86a0f702cff6495f50630c5de3337290db8b8cbDeployment evidence: the source/test/merge outcome is complete, but #159 is not live in production. No Enterprise key/domain configuration, protected variable, callable enforcement, provider readback, token exchange, or live App Check behavior is claimed. The protected release remains unable to build without the owner-configured public site-key variable, and ABUSE-001A2/#113/#133/#136 retain the external and enforcement work.
daliu commentedon Jul 13, 2026
A fresh read-only release audit is recorded on #136. The exact-main release still fails closed because no configured public App Check Enterprise site key is available from GitHub variables or any safe authorized/public source. Provider creation/binding and approved-domain verification remain owner actions; no key or provider setting was created or copied.