From 6b0d0ffe514ab1471adb6fd7acfaa452007b7bc9 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 15 Jul 2025 13:56:56 -0600 Subject: chore: update make targets to allow running against different environments --- Makefile | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 3625c9f4..96c93ce0 100644 --- a/Makefile +++ b/Makefile @@ -81,14 +81,20 @@ production-entities: $(AUTHZD_BIN) check-gitlab-token @$(AUTHZD_BIN) generate --project gitlab-org/software-supply-chain-security/authorization/sparkled --output etc/authzd/gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/entities.json # spice targets +# Usage: make run-spicedb-setup SPICEDB_ENDPOINT=localhost:20000 +# make run-spicedb-setup SPICEDB_ENDPOINT=authzd.staging.runway.gitlab.net:443 +# make run-spicedb-setup SPICEDB_ENDPOINT=authzd.runway.gitlab.net:443 +SPICEDB_ENDPOINT ?= localhost:20000 +SPICEDB_TOKEN ?= secret + run-spicedb-setup: - @zed --endpoint ":20000" --token "secret" --insecure schema write etc/authzd/spice.schema - @zed --endpoint ":20000" --token "secret" --insecure schema read - @zed --endpoint ":20000" --token "secret" --insecure relationship create project:1 maintainer user:mokhax - @zed --endpoint ":20000" --token "secret" --insecure relationship create project:1 developer user:tanuki + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure schema write etc/authzd/spice.schema + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure schema read + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure relationship create project:1 maintainer user:mokhax + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure relationship create project:1 developer user:tanuki run-spicedb-permission-check: - @zed --endpoint ":20000" --token "secret" --insecure permission check project:1 read user:mokhax - @zed --endpoint ":20000" --token "secret" --insecure permission check project:1 write user:mokhax - @zed --endpoint ":20000" --token "secret" --insecure permission check project:1 read user:tanuki - @zed --endpoint ":20000" --token "secret" --insecure permission check project:1 write user:tanuki + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure permission check project:1 read user:mokhax + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure permission check project:1 write user:mokhax + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure permission check project:1 read user:tanuki + @zed --endpoint "$(SPICEDB_ENDPOINT)" --token "$(SPICEDB_TOKEN)" --insecure permission check project:1 write user:tanuki -- cgit v1.2.3