-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External Auth ~ish #92
Merged
Merged
Changes from all commits
Commits
Show all changes
73 commits
Select commit
Hold shift + click to select a range
839e329
Remove use of filter in get_attribute
adam-cattermole 2428cb0
Minor refactor of rate-limit service
adam-cattermole 4e59d17
Add initial implementation of auth service
adam-cattermole 3eb9974
Pass in the host to set in context_extensions
adam-cattermole 5a2e2b1
Genericise the service to send any type of M
adam-cattermole ebfa96e
Use new header resolver in the service
adam-cattermole d5d6ad7
Fix tests using header resolver
adam-cattermole db504ba
Ignore authservice until used
adam-cattermole cb114c8
Create service at configuration level
adam-cattermole b9f979a
Add and use extensions from configuration
adam-cattermole 6a6f6cb
Update tests to use new config
adam-cattermole 3fa4ddd
[feat] Action dispatcher state machine, naive impl
didierofrivia 2aacc89
[feat] A simplistic approach, agnostic to extension type
didierofrivia 65786d5
[tmp] Allowing dead code
didierofrivia 8d4ee0e
[refactor] Changing name to `Operation` instead of `Action`
didierofrivia 94d006b
[refactor] Configuration, adding Actions
didierofrivia 914b1d8
[wip, refactor] GrpcServiceHandler builds message
didierofrivia c938e6b
[clean] Removing obsolete code
didierofrivia e6460e7
[refactor] OperationDispatcher triggering procedures
didierofrivia 888e983
[refactor] Wiring up altogether
didierofrivia 5f73f05
[refactor] Implementing own Message for GrpcMessage
didierofrivia 87afee3
[refactor] Inlucing Extension within Service and Operation as Rc
didierofrivia bec2faa
[refactor] OperationDispatcher.next() returns Option<Operation>
didierofrivia ea028ab
[refactor] Wiring up with the new API
didierofrivia edc0ef9
[refactor] grpc_call function delegated to the caller
didierofrivia 502d62b
[refactor] Operation responsible of providing hostcalls fns
didierofrivia 312710e
[refactor] Fix `OperationDispatcher.next()` behaviour
didierofrivia 9293e03
Local auth dev environment
adam-cattermole ee3997d
Deploy limitador as part of the kind cluster
adam-cattermole 5f0ff7c
Add tls and notls envoy configuration files
adam-cattermole 8dd4c97
Add simple authconfig to local environment
adam-cattermole a43f393
Rename make/auth.mk to make/deploy.mk
adam-cattermole 7be2e29
Set the host in authconfig to an arbitrary string
adam-cattermole 7ad0a00
Update plugin config for envoy
adam-cattermole b78bbc9
Add original limitador examples to plugin config
adam-cattermole cb74375
Add some documentation for auth development
adam-cattermole 40ce002
Merge pull request #67 from Kuadrant/auth-dev-env
adam-cattermole 625b205
[feat] Action dispatcher state machine, naive impl
didierofrivia 360c967
[refactor] Changing name to `Operation` instead of `Action`
didierofrivia 1fc0e1a
[refactor] OperationDispatcher triggering procedures
didierofrivia 190b597
[refactor] Specifying that it's about request messages
didierofrivia dbba0f5
[refactor, feature] Adding a new GrpcResponse type
didierofrivia d70d038
[refactor] Indexing waiting operations by `token_id`
didierofrivia 93c980d
[refactor] Wiring filter with dispatcher
didierofrivia 98d3754
[refactor] Passing by references instead of cloning
didierofrivia 49e4fec
[refactor] Using action `failure_mode` when processing grpc error
didierofrivia b0329d4
[fix] Changed behaviour, removing and triggering next op at same step
didierofrivia c262342
[refactor] Renaming rlp to policy for consistency
didierofrivia 4272ff7
[refactor] Explicit testing
didierofrivia 7125754
[fix] Indexing waiting operations only when triggered Pending => Waiting
didierofrivia a852236
Merge pull request #81 from Kuadrant/on_grpc_response_flow
didierofrivia 6675cab
Process auth CheckResponse
adam-cattermole 41f85ea
Add auth examples to the doc
adam-cattermole a2977fd
Update debug logs
adam-cattermole efa4b90
Update test expected logs
adam-cattermole 1265852
Merge pull request #86 from Kuadrant/auth-response
adam-cattermole 80cde65
Rename domain -> scope and move to action
adam-cattermole ab2eed0
Move data from rules to actions
adam-cattermole 91da443
Update examples to include authenticated rate limiting
adam-cattermole 9f82574
Store dynamic metadata in filter_state
adam-cattermole 57cb6d6
Refactor actions into rules
adam-cattermole 68c25af
Match on all conditions not any
adam-cattermole 2dc5d1b
Re-order test expectations to follow exactly the execution order
adam-cattermole a5c47e0
Move building of descriptors to action time
adam-cattermole 88cb14b
Merge pull request #87 from Kuadrant/cleanup-pluginconfig
adam-cattermole ea58e1d
Revert removal of allOf within conditions
adam-cattermole cf8d790
Merge pull request #89 from Kuadrant/return-of-allof
adam-cattermole 76c9bea
[refactor] OperationDispatcher not using RefCell for storing operations
didierofrivia 249d3cd
[refactor] OperationDispatcher within a RefCell for interior mut
didierofrivia 944a4a9
Merge pull request #90 from Kuadrant/refactoring-operation-dispatcher
didierofrivia 5434eb9
[refactor] Simplifying Operation state transtion and exec of req msg
didierofrivia 70eb303
Merge pull request #91 from Kuadrant/refactoring-operation-dispatcher…
didierofrivia 4222ffb
[readme] Updating new sample config
didierofrivia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
##@ Kind | ||
|
||
.PHONY: kind kind-create-cluster kind-delete-cluster | ||
|
||
KIND = $(PROJECT_PATH)/bin/kind | ||
KIND_VERSION = v0.23.0 | ||
$(KIND): | ||
$(call go-install-tool,$(KIND),sigs.k8s.io/kind@$(KIND_VERSION)) | ||
|
||
kind: $(KIND) ## Download kind locally if necessary. | ||
|
||
KIND_CLUSTER_NAME ?= wasm-auth-local | ||
|
||
kind-create-cluster: BUILD?=debug | ||
kind-create-cluster: WASM_PATH=$(subst /,\/,$(PROJECT_PATH)/target/wasm32-unknown-unknown/$(BUILD)) | ||
kind-create-cluster: kind ## Create the "wasm-auth-local" kind cluster. | ||
@{ \ | ||
TEMP_FILE=/tmp/kind-cluster-$$(openssl rand -hex 4).yaml ;\ | ||
cp $(PROJECT_PATH)/utils/kind/cluster.yaml $$TEMP_FILE ;\ | ||
$(SED) -i "s/\$$(WASM_PATH)/$(WASM_PATH)/g" $$TEMP_FILE ;\ | ||
KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) $(KIND) create cluster --name $(KIND_CLUSTER_NAME) --config $$TEMP_FILE ;\ | ||
rm -rf $$TEMP_FILE ;\ | ||
} | ||
|
||
kind-delete-cluster: ## Delete the "wasm-auth-local" kind cluster. | ||
- KIND_EXPERIMENTAL_PROVIDER=$(CONTAINER_ENGINE) $(KIND) delete cluster --name $(KIND_CLUSTER_NAME) | ||
|
||
|
||
##@ Authorino | ||
|
||
.PHONY: install-authorino-operator certs deploy-authorino | ||
|
||
AUTHORINO_IMAGE ?= quay.io/kuadrant/authorino:latest | ||
AUTHORINO_OPERATOR_NAMESPACE ?= authorino-operator | ||
install-authorino-operator: ## Installs Authorino Operator and dependencies into the Kubernetes cluster configured in ~/.kube/config | ||
curl -sL https://raw.githubusercontent.com/Kuadrant/authorino-operator/main/utils/install.sh | bash -s -- --git-ref main | ||
kubectl patch deployment/authorino-webhooks -n $(AUTHORINO_OPERATOR_NAMESPACE) -p '{"spec":{"template":{"spec":{"containers":[{"name":"webhooks","image":"$(AUTHORINO_IMAGE)","imagePullPolicy":"IfNotPresent"}]}}}}' | ||
kubectl -n $(AUTHORINO_OPERATOR_NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all | ||
|
||
TLS_ENABLED ?= true | ||
AUTHORINO_INSTANCE ?= authorino | ||
NAMESPACE ?= default | ||
certs: sed ## Requests TLS certificates for the Authorino instance if TLS is enabled, cert-manager.io is installed, and the secret is not already present | ||
ifeq (true,$(TLS_ENABLED)) | ||
ifeq (,$(shell kubectl -n $(NAMESPACE) get secret/authorino-oidc-server-cert 2>/dev/null)) | ||
curl -sl https://raw.githubusercontent.com/kuadrant/authorino/main/deploy/certs.yaml | $(SED) "s/\$$(AUTHORINO_INSTANCE)/$(AUTHORINO_INSTANCE)/g;s/\$$(NAMESPACE)/$(NAMESPACE)/g" | kubectl -n $(NAMESPACE) apply -f - | ||
else | ||
echo "tls cert secret found." | ||
endif | ||
else | ||
echo "tls disabled." | ||
endif | ||
|
||
deploy-authorino: certs sed ## Deploys an instance of Authorino into the Kubernetes cluster configured in ~/.kube/config | ||
@{ \ | ||
set -e ;\ | ||
TEMP_FILE=/tmp/authorino-deploy-$$(openssl rand -hex 4).yaml ;\ | ||
curl -sl https://raw.githubusercontent.com/kuadrant/authorino/main/deploy/authorino.yaml > $$TEMP_FILE ;\ | ||
$(SED) -i "s/\$$(AUTHORINO_INSTANCE)/$(AUTHORINO_INSTANCE)/g;s/\$$(TLS_ENABLED)/$(TLS_ENABLED)/g" $$TEMP_FILE ;\ | ||
kubectl -n $(NAMESPACE) apply -f $$TEMP_FILE ;\ | ||
kubectl patch -n $(NAMESPACE) authorino/$(AUTHORINO_INSTANCE) --type='merge' -p '{"spec":{"image": "$(AUTHORINO_IMAGE)"}}' ;\ | ||
rm -rf $$TEMP_FILE ;\ | ||
} | ||
|
||
|
||
##@ Limitador | ||
|
||
deploy-limitador: | ||
kubectl create configmap limits --from-file=$(PROJECT_PATH)/utils/docker-compose/limits.yaml | ||
kubectl -n $(NAMESPACE) apply -f $(PROJECT_PATH)/utils/deploy/limitador.yaml | ||
|
||
|
||
##@ User Apps | ||
|
||
.PHONY: user-apps | ||
|
||
|
||
ifeq (true,$(TLS_ENABLED)) | ||
ENVOY_OVERLAY = tls | ||
else | ||
ENVOY_OVERLAY = notls | ||
endif | ||
user-apps: ## Deploys talker API and envoy | ||
kubectl -n $(NAMESPACE) apply -f https://raw.githubusercontent.com/kuadrant/authorino-examples/main/talker-api/talker-api-deploy.yaml | ||
kubectl -n $(NAMESPACE) apply -f $(PROJECT_PATH)/utils/deploy/envoy-$(ENVOY_OVERLAY).yaml | ||
kubectl -n $(NAMESPACE) apply -f $(PROJECT_PATH)/utils/deploy/authconfig.yaml | ||
|
||
|
||
##@ Util | ||
|
||
.PHONY: local-setup local-env-setup local-cleanup local-rollout sed | ||
|
||
local-setup: local-env-setup | ||
kubectl -n $(NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all | ||
@{ \ | ||
echo "Now you can export the envoy service by doing:"; \ | ||
echo "kubectl port-forward --namespace $(NAMESPACE) deployment/envoy 8000:8000"; \ | ||
echo "After that, you can curl -H \"Host: myhost.com\" localhost:8000"; \ | ||
} | ||
|
||
local-env-setup: | ||
$(MAKE) kind-delete-cluster | ||
$(MAKE) kind-create-cluster | ||
$(MAKE) install-authorino-operator | ||
$(MAKE) deploy-authorino | ||
$(MAKE) deploy-limitador | ||
$(MAKE) user-apps | ||
|
||
local-cleanup: kind ## Delete the "wasm-auth-local" kind cluster. | ||
$(MAKE) kind-delete-cluster | ||
|
||
local-rollout: | ||
$(MAKE) user-apps | ||
kubectl rollout restart -n $(NAMESPACE) deployment/envoy | ||
kubectl -n $(NAMESPACE) wait --timeout=300s --for=condition=Available deployments --all | ||
|
||
ifeq ($(shell uname),Darwin) | ||
SED=$(shell which gsed) | ||
else | ||
SED=$(shell which sed) | ||
endif | ||
sed: ## Checks if GNU sed is installed | ||
ifeq ($(SED),) | ||
@echo "Cannot find GNU sed installed." | ||
exit 1 | ||
endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example is outdated