Skip to content

Commit a661851

Browse files
committed
fix:small docs fix
1 parent ea30fce commit a661851

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

docs/Supported-services/Postgrest-docs.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ PostgREST serves a REST API directly from your Postgres schema. The Control Plan
44

55
## Before You Deploy
66

7-
Grant the platform roles access to the schemas you want to expose. The Control Plane creates the service user. You only need to grant schema permissions.
7+
No new roles or schemas need to be created. `public`, `pgedge_application_read_only`, and `pgedge_application` already exist. You only need to grant them access to your schema.
88

99
```sql
1010
-- Anonymous read access
@@ -69,16 +69,21 @@ curl http://host-1:3100/products
6969

7070
### Authenticated write
7171

72-
Sign this payload with your `jwt_secret` using HS256:
72+
Generate a JWT signed with your `jwt_secret`:
7373

74-
```json
75-
{ "role": "pgedge_application", "exp": 9999999999 }
74+
```sh
75+
python3 - <<'EOF'
76+
import jwt
77+
SECRET = "a-secret-key-of-at-least-32-characters"
78+
token = jwt.encode({"role": "pgedge_application"}, SECRET, algorithm="HS256")
79+
print(token)
80+
EOF
7681
```
7782

7883
```sh
7984
curl -X POST http://host-1:3100/products \
8085
-H "Content-Type: application/json" \
81-
-H "Authorization: Bearer <your-jwt>" \
86+
-H "Authorization: Bearer <token-from-above>" \
8287
--data '{"name": "Widget", "price": 9.99}'
8388
```
8489

0 commit comments

Comments
 (0)