Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Block E: private single-user session cookie authentication across the API and web frontend, plus production Nginx containerization for
apps/web.Security Boundary (
apps/api)Features/Authvertical slice (AuthOptions,PasswordVerifier,EchoAccessAuthorizationHandler,AuthEndpoints) with startup options validation.pbkdf2-sha256$<iterations>$<saltBase64>$<hashBase64>) with constant-time credential verification (CryptographicOperations.FixedTimeEquals) and plaintext fallback for simple self-hosted setups.echo.session,HttpOnly,SameSite=Lax,Secureby default in Production, sliding expiration) returning401/403without HTML redirects, plus optional filesystem DataProtection key persistence (Auth:DataProtectionKeysPath)./api/recordingsand/api/refinementswith theEchoAccesspolicy (automatically bypassed whenAuth:Enabled=falseto keep local development and existing tests friction-free) and exposed anonymous/api/auth/status,/api/auth/login, and/api/auth/logoutendpoints.AuthTestscoveringPasswordHashandPasswordlogin/logout flows,HttpOnly/SameSite=Laxcookie issuance,401responses without redirects,Auth:Enabled=false, options validation, and DataProtection key persistence.StorageKeyMigrationTests.Dispose()to prevent Windows file-lock failures during teardown.Web Auth Gate & Containerization (
apps/web)src/api/auth.ts,credentials: 'same-origin'and 401 session-expiry handling insrc/api/client.ts, andLoginScreenstyled in Echo's editorial aesthetic.Layoutbehind['auth', 'status']so the workspace renders immediately whenauthEnabledisfalse(preserving existing E2E specs) and showsLoginScreen+ sidebar/mobile "Sign out" controls when enabled.test/auth.test.tsx.apps/web/Dockerfile(node:24-alpine+pnpm@10.34.5->nginx:1.27-alpine),.dockerignore, andnginx.conf(SPA fallback,/api/reverse proxy tohttp://api:8080withclient_max_body_size 30mand forwarded headers, and security headers).Infrastructure & Docs
docker-compose.prod.ymlwith thewebservice and API auth environment variables (Auth__Enableddefaulting totrue,Auth__DataProtectionKeysPath: /data/keys)..env.exampleandREADME.mdwith authentication configuration and productionwebcontainer documentation.Verification
dotnet test apps/api/Echo.slnx— 25/25 passedpnpm --dir apps/web install --frozen-lockfile && pnpm --dir apps/web lint && pnpm --dir apps/web test && pnpm --dir apps/web build— lint clean, 3 test files / 7 tests passed, production build succeeded