Repository navigation
security: quick-win hardening fixes - #242
Merged
Merged
Conversation
- Add app/api/local.settings.json to .gitignore to prevent accidental secret exposure via git add - Tighten CSP: scope connect-src to specific Supabase project subdomain and add frame-ancestors 'none' directive - DB migration: revoke EXECUTE on handle_new_user() from anon and authenticated roles (was callable via REST RPC with SECURITY DEFINER) - DB migration: set search_path = public on save_session, update_session, and replace_template_exercises to prevent schema injection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Updates to Preview Branch (security/quick-wins) ↗︎
Tasks are run on every commit but only new migration files are pushed.
❌ Branch Error • Fri, 15 May 2026 20:44:16 UTC View logs for this Workflow Run ↗︎. |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-island-090dfd003-242.westeurope.7.azurestaticapps.net |
3 tasks
ChristopherRotnes
added a commit
that referenced
this pull request
May 15, 2026
#236 #242 #247) - Add 20260101000000_baseline_schema.sql: full idempotent snapshot of all 15 tables, functions, trigger, grants and RLS policies so Supabase preview branches and local db reset work without errors (issue #247) - Add 20260515_rec_cache_ownership.sql: owner-scoped write policies for recommendation_cache, adding written_by column (issue #235; already live) - Make 20260514 delta idempotent: ADD COLUMN IF NOT EXISTS - Update CHANGELOG.md with [1.5.7] security + infra entries - Update CLAUDE.md: sportySync JWT auth, rec_cache written_by, prompt XML tags, Supabase preview pitfall (#247) - Update README.md: SPORTY_SYNC_API_KEY now health-endpoint-only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ChristopherRotnes
added a commit
that referenced
this pull request
May 15, 2026
* chore: add Supabase baseline migration + security docs (issues #228 #235 #236 #242 #247) - Add 20260101000000_baseline_schema.sql: full idempotent snapshot of all 15 tables, functions, trigger, grants and RLS policies so Supabase preview branches and local db reset work without errors (issue #247) - Add 20260515_rec_cache_ownership.sql: owner-scoped write policies for recommendation_cache, adding written_by column (issue #235; already live) - Make 20260514 delta idempotent: ADD COLUMN IF NOT EXISTS - Update CHANGELOG.md with [1.5.7] security + infra entries - Update CLAUDE.md: sportySync JWT auth, rec_cache written_by, prompt XML tags, Supabase preview pitfall (#247) - Update README.md: SPORTY_SYNC_API_KEY now health-endpoint-only Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: use DROP+CREATE instead of CREATE POLICY IF NOT EXISTS (PG15 compat) CREATE POLICY IF NOT EXISTS is PostgreSQL 17+ only. Supabase preview branches run PG15/16. Replace every occurrence in the baseline and rec_cache_ownership migrations with DROP POLICY IF EXISTS + CREATE POLICY (idempotent on PG15+). Same fix for CREATE TRIGGER IF NOT EXISTS. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: remove UTF-8 BOM from baseline migration (PostgreSQL rejects it) * chore: retrigger CI after Supabase GitHub App removal --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This branch was previously deployed
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
handle_new_user()(SECURITY DEFINER callable by anon)search_pathon three DB stored functionsapp/api/local.settings.jsonto.gitignoreconnect-src+ addframe-ancestors 'none'All four changes are low-risk and non-breaking. The DB migration has already been applied to the live project.
Test plan
POST /rest/v1/rpc/handle_new_userreturns 404/403 for unauthenticated requestsgit add .does not pick upapp/api/local.settings.json🤖 Generated with Claude Code