feat(rls): Phase 1 #12 — AgentCard RLS + callsite fix#140
Open
webdevcom01-cell wants to merge 5 commits into
Open
feat(rls): Phase 1 #12 — AgentCard RLS + callsite fix#140webdevcom01-cell wants to merge 5 commits into
webdevcom01-cell wants to merge 5 commits into
Conversation
- Migration 20260606000000: enable RLS + FORCE on AgentCard; SELECT policy allows own-org cards (EXISTS subquery against Agent) plus cross-org isPublic=true reads; INSERT/UPDATE/DELETE require EXISTS match; no organizationId column (agentId UNIQUE -> single-row PK lookup) - card-generator: upsertAgentCard wraps agentCard.upsert in withAdminBypass (fire-and-forget write, no org context available)
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
RLS tests —⚠️ PLACEHOLDER
`prisma/migrations/20260606000000_rls_phase1_agentcard/test.sql` contains 4 manual SQL scenarios for staging:
These are not automated. No RLS integration test harness exists yet — the existing vitest suite mocks Prisma and cannot test actual SQL policies. A `it.skip()` TODO block in `src/lib/db/tests/rls-middleware.test.ts` tracks when a real-DB harness is wired. The `test.sql` file is the placeholder until then.
Test plan