summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-15 13:56:56 -0600
committermo khan <mo@mokhan.ca>2025-07-15 13:56:56 -0600
commit6b0d0ffe514ab1471adb6fd7acfaa452007b7bc9 (patch)
tree84716416a3816884fceaff82d0ac8f5bcd1fd8e6 /Makefile
parent25167050dd78b6ed26c7da294ee0a2e6e6639ec6 (diff)
chore: update make targets to allow running against different environments
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files 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