fix: correct mutation variable shapes and expand expectRlsDenied patterns#1100
Merged
pyramation merged 1 commit intofeat/rls-alice-bob-integration-testfrom May 10, 2026
Conversation
…erns - Update mutations: patch → appFilePatch/appBucketPatch (PostGraphile v5 input types) - Add 'No values were' pattern to expectRlsDenied (RLS USING-clause denials on delete/update)
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
4f99ae3
into
feat/rls-alice-bob-integration-test
2 checks passed
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
Fixes 10 failing tests in
upload.integration.test.tscaused by two issues:Wrong update mutation variable field names — All update mutations used
patch(e.g.{ id, patch: { ... } }) but PostGraphile v5 generates table-specific field names:appFilePatchforUpdateAppFileInputandappBucketPatchforUpdateAppBucketInput. Previously the oldexpectMutationDeniedhelper silently accepted these as "denied" since the GraphQL schema validation error (Field "patch" is not defined by type "UpdateAppFileInput") was treated as any error. After PR refactor: clean up upload integration test — expectRlsDenied, expectSuccess, DRY SQL #1098 introduced the stricterexpectRlsDenied, these schema validation errors are correctly rejected — the tests were never actually reaching the RLS layer.Missing RLS denial pattern for filtered deletes/updates — When RLS
USINGclauses filter out all matching rows, PostGraphile returns"No values were deleted in collection '...' because no values you can delete were found matching these criteria". This is a legitimate RLS denial not covered by the existing three patterns (permission denied,new row violates row-level security,insufficient_privilege). Added'No values were'as a fourth pattern.Review & Testing Checklist for Human
appFilePatch/appBucketPatchmatch the actual generated input types — These names depend on PostGraphile's inflector. If the table names or inflector config change, these field names would too. Confirm by introspecting the schema or checking a working mutation in GraphiQL.'No values were'pattern specificity — This is a substring match. Confirm no non-RLS errors in PostGraphile contain this phrase that could cause a false pass. The full message is typically"No values were deleted/updated in collection '...' because no values you can delete/update were found matching these criteria".integration-tests (graphql/server-test)) runs against real PostgreSQL + MinIO and is the only way to verify these mutations now correctly reach the RLS layer and are denied there.Notes
feat/rls-alice-bob-integration-testbranch (PR feat: three-actor RLS + adversarial attack integration tests (Alice/Bob/Mallory) #1095).Link to Devin session: https://app.devin.ai/sessions/94a2728a9c414500bead29cbbc829c15
Requested by: @pyramation