How to disallow everything except explicitely defined authorizaion blocks #516
Replies: 2 comments 3 replies
-
Hi @eshepelyuk. In general your approach seems fine to me. However, if you're OK with writing Rego (instead of CEL), maybe one thing you could do is to embed the conditions into the rules. A shorter version could then be: authorization:
all-in-one:
opa:
rego: |
allow { <allow-one-conditions>; <allow-one-rules> }
allow { <allow-two-conditions>; <allow-two-rules> } Without changing much from what you have already, then maybe a (not so much) shorter version is: authorization:
allow-one:
priority: 0
when:
- predicate: ...
patternMatching:
patterns:
- predicate: ...
allow-two:
priority: 0
when:
- predicate: ...
patternMatching:
patterns:
- predicate: ...
disallow:
priority: 1
opa:
rego: allow = false |
Beta Was this translation helpful? Give feedback.
-
And about this sample
I don't think it's gonna work, as well as my original code. Due to https://github.com/Kuadrant/authorino/blob/main/docs/architecture.md |
Beta Was this translation helpful? Give feedback.
-
Hello
What I want is to declare few
authorization
sections that would allow access based on certain conditions and drop all the other requestsCurrently I am doing smth like this in my
AuthConfig
Is there a shorter way to achieve my goal ? Is my approach correct ?
Beta Was this translation helpful? Give feedback.
All reactions