Skip to content

Commit

Permalink
Added authenticator ROLE, and updated pgRST config
Browse files Browse the repository at this point in the history
  • Loading branch information
samkhawase committed Mar 28, 2020
1 parent 0ae7016 commit 24a58d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
links:
- db:db
environment:
PGRST_DB_URI: postgres://app_user:password@db:5432/app_db
PGRST_DB_URI: postgres://authenticator:password@db:5432/app_db
PGRST_DB_SCHEMA: api
PGRST_DB_ANON_ROLE: api_anon
PGRST_ROLE_CLAIM_KEY: ".\"https://postgrest-demo.de/role\""
Expand All @@ -38,6 +38,4 @@ services:
expose:
- "8080"
environment:
API_URL: http://localhost:3000/


API_URL: http://localhost:3000/
5 changes: 5 additions & 0 deletions scripts/init-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ create table api.review (
CREATE ROLE api_user nologin;
CREATE ROLE api_anon nologin;

CREATE ROLE authenticator WITH NOINHERIT LOGIN PASSWORD 'password';

GRANT api_user TO authenticator;
GRANT api_anon TO authenticator;

GRANT USAGE on SCHEMA api to api_anon;
GRANT SELECT on api.amenity to api_anon;
GRANT SELECT on api.review to api_anon;
Expand Down

0 comments on commit 24a58d6

Please sign in to comment.