Skip to content

Commit

Permalink
Created a dedicated authenticator role
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Sep 9, 2023
1 parent ec248d1 commit d739f21
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/sparrow/database/fixtures/07-postgrest-api.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
-- API-specific roles
-- CREATE ROLE IF NOT EXISTS authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER;
-- https://postgrest.org/en/stable/tutorials/tut0.html
CREATE ROLE authenticator LOGIN NOINHERIT NOCREATEDB NOCREATEROLE NOSUPERUSER;

GRANT admin TO authenticator;
GRANT view_public TO authenticator;

CREATE SCHEMA IF NOT EXISTS sparrow_api;

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ services:
pg_api:
image: postgrest/postgrest:v11.2.0
environment:
- PGRST_DB_URI=postgresql://postgres:@db:5432/sparrow_test
- PGRST_DB_URI=postgresql://authenticator:@db:5432/sparrow_test
- PGRST_DB_SCHEMAS=sparrow_api
- PGRST_DB_ANON_ROLE=view_public
- PGRST_JWT_SECRET=test_secret_must_be_at_least_32_characters
Expand Down
5 changes: 5 additions & 0 deletions docs/content/authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Authentication and Security

Sparrow's authentication system is based on [PostgREST's][postgrest] JWT system.

[postgrest]: https://postgrest.org/en/stable/tutorials/tut0.html

0 comments on commit d739f21

Please sign in to comment.