Skip to content

Commit

Permalink
Fix cel predicate
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps committed Oct 25, 2024
1 parent adb07cf commit 1bea626
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions tests/v1beta3/authconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ spec:
hosts:
- talker-api.127.0.0.1.nip.io

patterns:
admin-path:
- selector: context.request.http.path
operator: matches
value: ^/admin(/.*)?$
resource-path:
- selector: context.request.http.path
operator: matches
value: ^/greetings/\d+$

authentication:
k8s-auth:
kubernetesTokenReview:
Expand Down Expand Up @@ -99,7 +89,7 @@ spec:
expression: request.http.headers.authorization
resource-info:
when:
- patternRef: resource-path
- predicate: request.http.path.matches("^/greetings/\\d+$")
uma:
credentialsRef:
name: talker-api-uma-credentials
Expand All @@ -125,21 +115,21 @@ spec:
}
admin-kubernetes-rbac:
when:
- patternRef: admin-path
- predicate: auth.identity.kubernetes-rbac
- predicate: request.http.path.matches("^/admin(/.*)?$")
- predicate: auth.identity["kubernetes-rbac"]
kubernetesSubjectAccessReview:
user:
expression: auth.identity.username
admin-jwt-rbac:
when:
- patternRef: admin-path
- predicate: auth.identity.jwt-rbac
- predicate: request.http.path.matches("^/admin(/.*)?$")
- predicate: auth.identity["jwt-rbac"]
patternMatching:
patterns:
- predicate: auth.identity.roles.exists("admin")
- predicate: auth.identity.roles.contains("admin")
resource-owner:
when:
- patternRef: resource-path
- predicate: request.http.path.matches("^/greetings/\\d+$")
opa:
rego: |
allow {
Expand Down

0 comments on commit 1bea626

Please sign in to comment.