-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
The Firebase project domain (sportdeets-dev.firebaseapp.com) is hardcoded in three critical layers, creating a production deployment blocker.
Affected Files
src/UI/sd-ui/src/firebase.js—authDomainis hardcoded tosportdeets-dev.firebaseapp.comsrc/UI/sd-ui/security-headers.conf—frame-srcin the CSP header references the dev Firebase domain directly (TODO comment added in PR fix csp issues #141)src/SportsData.Api/Program.cs— JWT validation is hardcoded to thesportdeets-devFirebase project
Risk
Production deployment will either fail authentication entirely (if using a different Firebase project) or leak production user data into the dev Firebase project (if inadvertently reusing the dev project ID).
Required Work
- Frontend — Update
src/UI/sd-ui/src/firebase.jsto read Firebase config from environment variables:const firebaseConfig = { apiKey: process.env.REACT_APP_FIREBASE_API_KEY, authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN, // ... };
- Nginx CSP — Template
src/UI/sd-ui/security-headers.confto injectFIREBASE_AUTH_DOMAINat container startup usingenvsubstor nginx variable substitution. - Backend — Update
src/SportsData.Api/Program.csto load the Firebase project/domain from appsettings or environment variables rather than the hardcoded literal. - Docker/env files — Ensure Dockerfiles and
.env.dev/.env.prodfiles pass the sameFIREBASE_AUTH_DOMAINvariable name across all three layers so they stay in sync.
References
- PR: fix csp issues #141
- Review comment: fix csp issues #141 (comment)
- Requested by: @jrandallsexton
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels