How to disallow everything except explicitely defined authorizaion blocks #516
Unanswered
eshepelyuk
asked this question in
Q&A
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 |
2 replies
|
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 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello
What I want is to declare few
authorizationsections that would allow access based on certain conditions and drop all the other requestsCurrently I am doing smth like this in my
AuthConfigIs there a shorter way to achieve my goal ? Is my approach correct ?
All reactions