Skip to content

test(data-access): add JWT auth for PostgREST mutation access control#1387

Merged
ekremney merged 1 commit intomainfrom
test-postgrest-jwt-auth
Feb 27, 2026
Merged

test(data-access): add JWT auth for PostgREST mutation access control#1387
ekremney merged 1 commit intomainfrom
test-postgrest-jwt-auth

Conversation

@ekremney
Copy link
Member

@ekremney ekremney commented Feb 27, 2026

Summary

Adapts IT tests for mysticat-data-service PR #92 which introduces the postgrest_writer role for JWT-based mutation access control.

  • Add postgrest-jwt.js utility for HS256 JWT generation (mirrors _make_jwt() from mysticat-data-service)
  • Configure PGRST_JWT_SECRET in docker-compose.yml
  • Pass postgrestApiKey to createDataAccess() with generated JWT in both util/db.js and postgrest/helpers.js
  • Bump mysticat-data-service image to v1.13.0

After this change, DELETE and UPDATE operations through PostgREST require JWT authentication, while SELECT and INSERT remain anonymous.

Test plan

  • PostgreSQL IT tests pass (704 passing)

🤖 Generated with Claude Code

@ekremney ekremney requested a review from solaris007 as a code owner February 27, 2026 17:02
Adapts IT tests for mysticat-data-service PR #92 which introduces
the postgrest_writer role for JWT-based mutation access control.

Changes:
- Add postgrest-jwt.js utility for HS256 JWT generation
- Configure PGRST_JWT_SECRET in docker-compose.yml
- Pass postgrestApiKey to createDataAccess() with generated JWT
- Bump mysticat-data-service image to v1.13.0

After this change, DELETE and UPDATE operations through PostgREST
require JWT authentication, while SELECT and INSERT remain anonymous.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ekremney ekremney force-pushed the test-postgrest-jwt-auth branch from cb45ae4 to 3633751 Compare February 27, 2026 17:10
@github-actions
Copy link

This PR will trigger no release when merged.

@ekremney ekremney merged commit 553e956 into main Feb 27, 2026
7 checks passed
@ekremney ekremney deleted the test-postgrest-jwt-auth branch February 27, 2026 17:20
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.

1 participant