Skip to content

security(supabase): add RLS enablement and policies for users, goals,… - #3255

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:security/supabase-rls-policies
Jul 29, 2026
Merged

security(supabase): add RLS enablement and policies for users, goals,…#3255
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
Nareshkumawat-star:security/supabase-rls-policies

Conversation

@Nareshkumawat-star

Copy link
Copy Markdown
Contributor

Summary

Audited database tables and added explicit Supabase Row Level Security (RLS) policies for users, goals, and streak_freezes tables in supabase/schema.sql. Also added documentation in DEVELOPMENT.md explaining RLS policies and how to verify active policies in the Supabase Dashboard.

Closes #3250


Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing behavior)
  • 📝 Documentation update
  • ♻️ Refactor / code cleanup (no functional change)
  • ⚡ Performance improvement
  • 🔒 Security fix
  • 🧪 Tests only

What Changed

  • supabase/schema.sql:
    • Enabled RLS on users, goals, and streak_freezes tables.
    • Added policies restricting user access to their own rows (auth.uid()::text).
  • DEVELOPMENT.md:
    • Added documentation on RLS defense-in-depth and dashboard verification instructions.

How to Test

  1. Execute supabase/schema.sql in the Supabase SQL Editor.
  2. In the Supabase Dashboard, open AuthenticationPolicies or Table Editor.
  3. Verify that users, goals, and streak_freezes display the RLS Enabled badge and list their user-scoped policies (user_id = auth.uid()::text).

Checklist

  • Linked the related issue above
  • Self-reviewed my own diff
  • No unnecessary console.log or debug code
  • Updated documentation / comments

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:devops GSSoC type bonus: devops (+15 pts) type:docs GSSoC type bonus: documentation (+5 pts) type:feature GSSoC type bonus: new feature type:security GSSoC type bonus: security (+20 pts) labels Jul 28, 2026
@github-actions

Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@Nareshkumawat-star

Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder kindly review and merge it

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) labels Jul 29, 2026
@Priyanshu-byte-coder
Priyanshu-byte-coder merged commit 444d05d into Priyanshu-byte-coder:main Jul 29, 2026
5 of 6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 Merged! Thanks for contributing to DevTrack.

If the project has been useful to you, a ⭐ star on the repo is the easiest way to support it — it helps DevTrack get discovered by more developers.

Keep an eye on open issues for your next contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level2 GSSoC Level 2 - Medium complexity (25 points) quality:clean GSSoC: Clean quality multiplier (×1.2) type:devops GSSoC type bonus: devops (+15 pts) type:docs GSSoC type bonus: documentation (+5 pts) type:feature GSSoC type bonus: new feature type:security GSSoC type bonus: security (+20 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add Supabase Row Level Security (RLS) policy audit — ensure no user can read another user's goals or streak data

2 participants