Package io.micronaut.security.rules
Class ConfigurationInterceptUrlMapRule
java.lang.Object
io.micronaut.security.rules.AbstractSecurityRule<io.micronaut.http.HttpRequest<?>>
io.micronaut.security.rules.ConfigurationInterceptUrlMapRule
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,SecurityRule<io.micronaut.http.HttpRequest<?>>
@Requires(classes=io.micronaut.http.HttpRequest.class) @Requires(beans={RolesFinder.class,SecurityConfiguration.class,InterceptUrlPatternModifier.class})
@Singleton
public class ConfigurationInterceptUrlMapRule
extends AbstractSecurityRule<io.micronaut.http.HttpRequest<?>>
A security rule implementation backed by the
SecurityConfiguration.getInterceptUrlMap()
.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields inherited from interface io.micronaut.security.rules.SecurityRule
DENY_ALL, IS_ANONYMOUS, IS_AUTHENTICATED
-
Constructor Summary
ConstructorDescriptionConfigurationInterceptUrlMapRule
(RolesFinder rolesFinder, SecurityConfiguration securityConfiguration, InterceptUrlPatternModifier interceptUrlPatternModifier) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<SecurityRuleResult>
check
(io.micronaut.http.HttpRequest<?> request, @Nullable Authentication authentication) If no configured pattern matches the request, returnSecurityRuleResult.UNKNOWN
.int
getOrder()
protected List<InterceptUrlMapPattern>
Provides a list ofInterceptUrlMapPattern
which will be used to provideSecurityRule
.Methods inherited from class io.micronaut.security.rules.AbstractSecurityRule
compareRoles, getRoles
-
Field Details
-
ORDER
The order of the rule.
-
-
Constructor Details
-
ConfigurationInterceptUrlMapRule
public ConfigurationInterceptUrlMapRule(RolesFinder rolesFinder, SecurityConfiguration securityConfiguration, InterceptUrlPatternModifier interceptUrlPatternModifier) - Parameters:
rolesFinder
- Roles ParsersecurityConfiguration
- The Security ConfigurationinterceptUrlPatternModifier
- InterceptURLMap modifier
-
-
Method Details
-
getPatternList
Provides a list ofInterceptUrlMapPattern
which will be used to provideSecurityRule
.- Returns:
- List of
InterceptUrlMapPattern
-
getOrder
public int getOrder() -
check
public org.reactivestreams.Publisher<SecurityRuleResult> check(io.micronaut.http.HttpRequest<?> request, @Nullable @Nullable Authentication authentication) If no configured pattern matches the request, returnSecurityRuleResult.UNKNOWN
. Reads the rules in order. The first matched rule will be used for determining authorization.- Parameters:
request
- The current requestauthentication
- The user authentication. Null if not authenticated- Returns:
- The result
- See Also:
-