Harden auth, support deletion, and CI secret handling - #22
Merged
Conversation
Apply JWT-owned support_requests rows, cascade them with account deletion, and remove the caller auth user through a private security-definer helper while keeping the public RPC invoker. Co-authored-by: marka.siazon <marka.siazon@gmail.com>
Route verified email links through the age gate, stop sending GPS to OpenRoute without an explicit key, and match local signup to the letters-and-digits password policy. Co-authored-by: marka.siazon <marka.siazon@gmail.com>
Pin first-party GitHub Actions to commit SHAs, lock the Supabase CLI to 2.115.0, redact start logs, and grant Pages tokens only on the main-branch deploy job. Co-authored-by: marka.siazon <marka.siazon@gmail.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.
Fixes the security review of the last 10 merged PRs, including backend changes for the live Supabase project.
Backend (apply on the live linked project)
support_requests.user_email/user_idto the JWT via a before-insert trigger so clients cannot spoof another mailbox.support_requests.user_id → auth.users(id) ON DELETE CASCADEand FORCE RLS.request_account_deletion()now deletessupport_requests, then queues the audit row, then deletes the caller throughprivate.delete_own_auth_user()(SECURITY DEFINER, 0 args,auth.users.id = auth.uid()only).20260614062844_recreate_flowfit_backend.sqlstays free ofsecurity definer.letters_digitswith min length 8.This environment cannot
db push --linked(no Supabase MCP/session). After merge, apply with:Live project ref from launch docs:
xhmkghwijqpvnbpeeckg.App
/age-gate(no email in route args).FLOWFIT_OPENROUTE_API_KEY; empty key skips GPS HTTP.support@flowfit.com(production inbox still comes from dart-define/env).PhoneDataListenerServicestaysexported=true(required forBIND_LISTENER_SERVICE); comment only.CI
supabase@2.115.0.supabase statusJSON or start logs (JWTs / service_role / DB URL).pages: write+id-token: writeare granted only on the main-branch deploy job.