-
Notifications
You must be signed in to change notification settings - Fork 128
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
Security rules strategy execution not enough documented + SecurityRule strategy feature request #1305
Comments
Seems like a good opportunity to contribute to the docs |
Hi @graemerocher , as suggested i forked the project and created a pull request regarding the documentation. |
* doc: better security rules documentation (#1305) * fix: security.filters package path Co-authored-by: Sergio del Amo <[email protected]> * dev: applied pull request suggestions Co-authored-by: Sergio del Amo <[email protected]> * doc: applied pull request suggestions --------- Co-authored-by: Sergio del Amo <[email protected]>
@RiccardoManzan can you attach a sample custom SecurityRule? I am having trouble getting mine to execute |
@Fohlen, what are you trying to do? I'll check what i have and come back. |
@Fohlen to create a security rule:
|
Hello! Please, improve docs. It is absolutely unclear, how to build an app with such combination of auth: some URLs permitted for all, some - under JWT auth, some under Basic auth. It should be something easy and pretty like in Spring (bad coding with it also could lead to copmlicated conf)
Googling and direct docs reading gives nothing about: P.S. Advice, please, how to make the same with micronaut like in my code? |
Issue description
Hi all, I'm working on a project that needed a custom security rule.
This needed me to analyze the
SecurityFilter
in theSecurityRules
section, and how all providedSecurityRules
work by theirselfs.I found very counterintuitive that the filters are somehow exclusive.
A request may pass only through a subset of security rules, as, apart from
IpPatternsRule
, they block the rules execution if they want to allow or reject a request.I mean, if a rule rejects a request that's fine for me that no further rule is applied and the access to the requested resource is blocked, but i think that if a rule approves a user request, then also the following security rules need to be applied.
For example: if a user tries to access to a specific resource, and if the
@Secured
annotation is compliant with user's authentication, i'd like to execute alsoConfigurationInterceptUrlMapRule
in order to match also security configuration by properties.This type of behavior is not explicitly described in the docs, furthermore IMHO this behavior should become a strategy, like authentication one, which choices are
ALL
orANY
(for this one I'd preferFIRST
) .In order to know in which order
SecurityRules
are executed i needed to check their implementation, which is not the most user-friendly way, so i prepared a table which i think it should be inserted in the docs.Furthermore it was not clear from the docs that both
@Secured
annotation andmicronaut.security.intercept-url-map
configuration were supposed to grant access to a resource if ANY of the roles are matched instead of ALL. Also this behavior is explained in the table.The text was updated successfully, but these errors were encountered: