Skip to content

[Plan 003] Remove order PII from the general authenticated surface - #12

Merged
prof-ramos merged 3 commits into
mainfrom
agent/003-order-privacy
Aug 3, 2026
Merged

[Plan 003] Remove order PII from the general authenticated surface#12
prof-ramos merged 3 commits into
mainfrom
agent/003-order-privacy

Conversation

@prof-ramos

Copy link
Copy Markdown
Owner

Implements Plan 003 and closes #7 when merged.

What changed

  • Adds a security_invoker orders_operational view with only operational order fields.
  • Revokes table-wide order reads and grants only the nine non-PII columns needed by the invoker view.
  • Adds get_order_customer(uuid), a security-definer function that returns customer fields only to event owner, ops, and finance.
  • Adds owner/finance positive cases plus gate/cross-organization/raw-table/privacy-column regressions to pgTAP.
  • Regenerates Supabase database types and documents the access contract.

Why

The previous authenticated order surface exposed buyer name, email, and phone to every role able to access an event. The database now enforces the operational/customer-data boundary independently of any future UI.

Checks

  • pnpm supabase:test: 32 assertions passed on local Supabase
  • pnpm check
  • supabase db lint --local --fail-on error: no schema errors
  • supabase db advisors --local --type security --fail-on error: no issues
  • git diff --check

Stacking

This draft is based on PR #10 (agent/001-verification-baseline) so its diff contains only Plan 003 changes relative to that PR. Do not merge it before the base PR.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@prof-ramos, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b379c47c-36a9-4a0c-accc-0177e1a211db

📥 Commits

Reviewing files that changed from the base of the PR and between 178b785 and dd724a5.

📒 Files selected for processing (6)
  • plans/003-remove-order-pii-from-general-surface.md
  • plans/README.md
  • src/lib/supabase/database.types.ts
  • supabase/README.md
  • supabase/migrations/20260803071005_orders_privacy.sql
  • supabase/tests/database/rls_and_check_in.sql

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@prof-ramos
prof-ramos changed the base branch from agent/001-verification-baseline to main August 3, 2026 08:45
@prof-ramos
prof-ramos marked this pull request as ready for review August 3, 2026 08:46
@prof-ramos
prof-ramos merged commit d8ef880 into main Aug 3, 2026
3 checks passed
@prof-ramos
prof-ramos deleted the agent/003-order-privacy branch August 3, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Plan 003] Remove order PII from the general authenticated surface

1 participant