diff options
| author | mo khan <mo@mokhan.ca> | 2025-06-25 16:06:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-06-25 16:06:06 -0600 |
| commit | 7c433fcb79c09fa7f63ee0261205b738c7160feb (patch) | |
| tree | 5d7fa4067dc40c42fdce7c05522e69610d100c55 /Makefile | |
| parent | a13fad7e3d8ca33faeef10dcff9f3f24211bb4d2 (diff) | |
chore: add make targets
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 45 |
1 files changed, 39 insertions, 6 deletions
@@ -2,24 +2,57 @@ PROJECT_NAME := $(shell basename $(shell pwd)) GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD | sed 's/\//_/g') IMAGE_TAG := $(PROJECT_NAME):$(GIT_BRANCH) -.PHONY: clean run-image +.PHONY: build check test run clean fmt lint doc +.PHONY: build-image run-image health-check list-services test-grpc + +# Cargo targets +build: + @cargo build + +check: + @cargo check + +test: + @cargo test + +run: + @cargo run -.PHONY: clean clean: @cargo clean -.PHONY: build-image +fmt: + @cargo fmt + +lint: + @cargo clippy -- -D warnings + +doc: + @cargo doc --open + +# Docker targets build-image: @docker build --no-cache --tag $(IMAGE_TAG) . -.PHONY: run-image run-image: build-image @docker run --rm -p 50051:50051 -it $(IMAGE_TAG) -.PHONY: health-check +# gRPC testing targets health-check: @grpcurl -plaintext localhost:50051 grpc.health.v1.Health/Check -.PHONY: list-services list-services: @grpcurl -plaintext localhost:50051 list + +test-grpc: + @echo "Testing authorization service with valid token..." + @grpcurl -plaintext \ + -d '{"attributes":{"request":{"http":{"headers":{"authorization":"Bearer valid-token"}}}}}' \ + localhost:50051 \ + envoy.service.auth.v3.Authorization/Check + @echo "" + @echo "Testing authorization service without token..." + @grpcurl -plaintext \ + -d '{"attributes":{"request":{"http":{"headers":{}}}}}' \ + localhost:50051 \ + envoy.service.auth.v3.Authorization/Check |
