@@ -68,6 +68,72 @@ Comprehensive architecture plan for transitioning SentenceStudio from local-dev-
6868
6969** Estimated Monthly Cost (Production):** ~ $107-252
7070
71+ ### 3. User-Secrets Workflow for Local Development (2026-03-14)
72+
73+ ** Status:** IMPLEMENTED
74+ ** Date:** 2026-03-14
75+ ** Author:** Wash (Backend Dev)
76+ ** Issue:** #39
77+
78+ Established .NET user-secrets pattern for secure local development across all server-side projects.
79+
80+ ** Key Decisions:**
81+ - AppHost uses Aspire Parameters (` builder.AddParameter("openaikey", secret: true) ` ) resolving from AppHost user-secrets under ` Parameters:openaikey `
82+ - Parameters passed to child projects via ` .WithEnvironment("AI__OpenAI__ApiKey", openaikey) `
83+ - Aspire normalizes ` __ ` to ` : ` in configuration across services
84+ - Three paths documented in README:
85+ - ** Option A:** Aspire (recommended) — set secrets in AppHost, flow to all services
86+ - ** Option B:** Standalone projects — per-project ` dotnet user-secrets `
87+ - ** Option C:** MAUI mobile/desktop — gitignored ` appsettings.json ` in AppLib
88+
89+ ** Projects with UserSecretsId:**
90+ | Project | UserSecretsId |
91+ | ---------| ---------------|
92+ | AppHost | d8521a4e-969b-4696-9990-45dea324bda8 |
93+ | Api | 9ae3953f-a490-41b3-a2b8-a8e2555b4615 |
94+ | WebApp | 33f95f89-d495-4311-b6cb-53a47b5c34e6 |
95+ | Workers | dotnet-SentenceStudio.Workers-8ded0183-d135-40b2-b2d4-b49b096922b8 |
96+
97+ ** Secrets Inventory:**
98+ | Secret | AppHost Parameter | Api Key | WebApp Key |
99+ | --------| -------------------| ---------| ------------|
100+ | OpenAI | Parameters: openaikey | AI:OpenAI: ApiKey | Settings: OpenAIKey |
101+ | ElevenLabs | Parameters: elevenlabskey | ElevenLabsKey | Settings: ElevenLabsKey |
102+ | Syncfusion | Parameters: syncfusionkey | N/A | N/A |
103+
104+ ** No Data Impact:** No database changes, no secret migrations, AppHost user-secrets remain intact.
105+
106+ ---
107+
108+ ### 4. Security Headers and HTTPS Enforcement (2026-03-14)
109+
110+ ** Status:** IMPLEMENTED
111+ ** Date:** 2026-03-14
112+ ** Author:** Kaylee (Full-stack Dev)
113+ ** Issue:** #41
114+
115+ Added security hardening across API, WebApp, and Marketing services.
116+
117+ ** Security Headers (all services):**
118+ - Shared extension ` UseSecurityHeaders() ` in ` src/Shared/SecurityHeadersExtensions.cs `
119+ - Linked via ` <Compile Include> ` to prevent ambiguous call errors with MAUI defaults
120+ - Headers: X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: strict-origin-when-cross-origin, Permissions-Policy: camera=(), microphone=(), geolocation=()
121+
122+ ** HTTPS and HSTS:**
123+ - HTTPS redirect environment-aware: skipped in Development (Aspire terminates TLS at proxy)
124+ - API explicit HSTS: 365-day max-age, includeSubDomains, preload
125+ - WebApp and Marketing HSTS unchanged (already configured in non-dev block)
126+
127+ ** CORS (API only):**
128+ - ` AllowWebApp ` policy: restricts to ` Cors:AllowedOrigins ` config
129+ - ` AllowDevClients ` policy: dev-only, localhost with credentials
130+ - Production origins in ` appsettings.Production.json `
131+ - MAUI clients unaffected (service discovery, not browser CORS)
132+
133+ ** AllowedHosts:** Production ` appsettings.json ` files restrict to specific domains, not wildcard.
134+
135+ ** Deferred:** Production CORS fine-tuning (#62 ), CSP header (Blazor inline scripts), production auth (still DevAuthHandler).
136+
71137## Governance
72138
73139- All meaningful changes require team consensus
0 commit comments