warn that SQL Editor does not reproduce JWT context for auth-dependent view validation

Open Beginner friendly
#286 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Documentation
Clarity
Mostly clear
Activity status
Quiet
Tech stack
sql, supabase

Research direction

Locate the Supabase agent skill's verification guidance covering SQL Editor checks, views, or auth-dependent queries. Add a warning that SQL Editor lacks the application JWT, require testing in the authenticated client context or with independent base-table control queries, and ensure coverage tests do not use the filtered view as their sole oracle.

Written by the indexing model from the issue text.

Description

user-feedback: warn that SQL Editor does not reproduce JWT context for auth-dependent view validation

This is feedback about the Supabase agent skill, not a Supabase product defect. A view whose administrative branch depended on is_app_admin()/auth.uid() was validated from SQL Editor. Because that execution had no application JWT, auth.uid() was NULL and the view returned only the public subset. Structural assertions over the same filtered view returned true, creating a false sense of complete coverage. Please extend the verification guidance to require auth-dependent queries to be tested in the actual client authentication context, or against independent base-table control queries. It would also help to warn that SQL Editor is not equivalent to an authenticated Data API request and that coverage tests should not reuse the potentially faulty view as their sole oracle.

Dominant language
TypeScript
Stars
2.6k
Forks
208
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from supabase/agent-skills

All issues in supabase/agent-skills

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.