Repository navigation
Backend hardening: USC-only signup, security headers, CI - #6
Merged
Merged
Conversation
- Add before-user-created auth hook that rejects non-@usc.edu signups - Send CSP (frame-ancestors, base-uri, form-action, object-src), nosniff, referrer, permissions, and HSTS headers on every route - Refresh the cached schedule every 30s instead of 5 minutes - Raise people search limit to 1000 so header counts stay exact - Add GitHub Actions CI: lint, build, tsc, tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
20261103000000_usc_signup_gate.sqladdspublic.hook_before_user_created, a Supabase Auth "before user created" hook. It rejects any new account whose email isn't@usc.edu(403, "Sign up with your @usc.edu email."). Because it runs inside Supabase, it applies even to calls that skip the app. Existing accounts are unaffected. The hook is enabled for local Supabase inconfig.toml.next.config.ts:frame-ancestors 'none'; base-uri 'self'; form-action 'self'; object-src 'none'X-Content-Type-Options: nosniffReferrer-PolicyPermissions-Policyscript-srcrestriction, because a nonce-based CSP would make every page dynamic.minutespreset (5 min), so event edits show up quickly. The custom profile keeps/partially prerendered; thesecondspreset would turn it into a dynamic hole..github/workflows/ci.yml): runs lint, build,tsc --noEmitandnpm test --if-present, with placeholder Supabase env.Does not touch the files changed in #4 (redirect and avatar validation, OTP sign-in, test script).
After merge (shared Supabase project)
npx supabase migration list, thennpx supabase db pushpublic.hook_before_user_createdTest plan
npm run lint,npm run build,npx tsc --noEmitpass locally/login(curl)@usc.edusign-up succeeds🤖 Generated with Claude Code