Skip to content

Commit

Permalink
Auth hook for local dev setup
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljharvey committed Oct 31, 2023
1 parent 647095a commit 099aec6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ services:
COLLECTOR_OTLP_ENABLED: "true"
COLLECTOR_ZIPKIN_HOST_PORT: "9411"

auth-hook:
build: ../v3-engine/hasura-authn-webhook/dev-auth-webhook
init: true
ports:
- 3050:3050

volumes:
prom_data:
grafana_data:
4 changes: 3 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ start-metrics:

# run the v3 engine binary, pointing it at our connector
run-engine: start-dependencies
docker compose up --wait auth-hook
@echo "http://localhost:3000/ for graphiql console"
@echo "http://localhost:4002/ for jaeger console"
# Run graphql-engine using static Chinook metadata
Expand All @@ -265,7 +266,8 @@ run-engine: start-dependencies
cargo run --release \
--manifest-path ../v3-engine/Cargo.toml \
--bin engine -- \
--metadata-path ./static/chinook-metadata.json
--metadata-path ./static/chinook-metadata.json \
--authn-config-path ./static/auth_config.json

# start a postgres docker image and connect to it using psql
repl-postgres:
Expand Down
12 changes: 12 additions & 0 deletions static/auth_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "v1",
"definition": {
"allowRoleEmulationBy": "admin",
"mode": {
"webhook": {
"url": "http://localhost:3050/validate-request",
"method": "Post"
}
}
}
}

0 comments on commit 099aec6

Please sign in to comment.