Skip to content

Commit

Permalink
Add simple authconfig to local environment
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Cattermole <[email protected]>
  • Loading branch information
adam-cattermole committed Aug 15, 2024
1 parent 622a0df commit 1cfaa6e
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
1 change: 1 addition & 0 deletions make/auth.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ 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
Expand Down
28 changes: 28 additions & 0 deletions utils/deploy/authconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
apiVersion: authorino.kuadrant.io/v1beta2
kind: AuthConfig
metadata:
name: talker-api-protection
spec:
hosts:
- talker-api.127.0.0.1.nip.io
authentication:
"friends":
apiKey:
selector:
matchLabels:
group: friends
credentials:
authorizationHeader:
prefix: APIKEY
---
apiVersion: v1
kind: Secret
metadata:
name: api-key-1
labels:
authorino.kuadrant.io/managed-by: authorino
group: friends
stringData:
api_key: "ndyBzreUzF4zqDQsqSPMHkRhriEOtcRx"
type: Opaque
6 changes: 3 additions & 3 deletions utils/deploy/envoy-notls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@ data:
"name": "rlp-ns-A/rlp-name-A",
"domain": "rlp-ns-A/rlp-name-A",
"service": "authorino_wasm",
"hostnames": ["*.a.com"],
"hostnames": ["talker-api.127.0.0.1.nip.io"],
"rules": [
{
"conditions": [
{
"allOf": [
{
"selector": "request.host",
"selector": "request.path",
"operator": "eq",
"value": "test.a.com"
"value": "/hello"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions utils/deploy/envoy-tls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ data:
"name": "rlp-ns-A/rlp-name-A",
"domain": "rlp-ns-A/rlp-name-A",
"service": "authorino_wasm",
"hostnames": ["*.a.com"],
"hostnames": ["talker-api.127.0.0.1.nip.io"],
"rules": [
{
"conditions": [
{
"allOf": [
{
"selector": "request.host",
"selector": "request.path",
"operator": "eq",
"value": "test.a.com"
"value": "/hello"
}
]
}
Expand Down

0 comments on commit 1cfaa6e

Please sign in to comment.