@ConfigurationProperties(value="micronaut.security") public class SecurityConfigurationProperties extends java.lang.Object implements SecurityConfiguration
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANYWHERE |
static AuthenticationStrategy |
DEFAULT_AUTHENTICATION_STRATEGY
The default enable value.
|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static boolean |
DEFAULT_INTERCEPT_URL_MAP_PREPEND_PATTERN_WITH_CONTEXT_PATH
The default value whether intercept url patterns should be prepended with the context path.
|
static boolean |
DEFAULT_REJECT_NOT_FOUND
The default reject-not-found value.
|
static java.lang.String |
PREFIX |
Constructor and Description |
---|
SecurityConfigurationProperties() |
Modifier and Type | Method and Description |
---|---|
AuthenticationMode |
getAuthentication() |
AuthenticationStrategy |
getAuthenticationProviderStrategy() |
java.util.List<InterceptUrlMapPattern> |
getInterceptUrlMap() |
java.util.List<java.lang.String> |
getIpPatterns() |
boolean |
isEnabled() |
boolean |
isInterceptUrlMapPrependPatternWithContextPath() |
boolean |
isRejectNotFound()
For cases where no security rule handles a request and it is determined
that the request does not match any routes on the server, whether the response
should be to reject the request or allow the not found response to be returned.
|
void |
setAuthentication(AuthenticationMode authentication)
Defines which authentication to use.
|
void |
setAuthenticationProviderStrategy(AuthenticationStrategy authenticationProviderStrategy)
Determines how authentication providers should be processed.
|
void |
setEnabled(boolean enabled)
If Security is enabled.
|
void |
setInterceptUrlMap(java.util.List<InterceptUrlMapPattern> interceptUrlMap)
Map that defines the interception patterns.
|
void |
setInterceptUrlMapPrependPatternWithContextPath(boolean interceptUrlMapPrependPatternWithContextPath)
Whether the intercept URL patterns should be prepended with context path if defined.
|
void |
setIpPatterns(java.util.List<java.lang.String> ipPatterns)
Allowed IP patterns.
|
void |
setRejectNotFound(boolean rejectNotFound) |
public static final java.lang.String PREFIX
public static final java.lang.String ANYWHERE
public static final boolean DEFAULT_ENABLED
public static final boolean DEFAULT_INTERCEPT_URL_MAP_PREPEND_PATTERN_WITH_CONTEXT_PATH
public static final AuthenticationStrategy DEFAULT_AUTHENTICATION_STRATEGY
public static final boolean DEFAULT_REJECT_NOT_FOUND
@Nullable public AuthenticationMode getAuthentication()
getAuthentication
in interface AuthenticationModeConfiguration
public void setAuthentication(@Nullable AuthenticationMode authentication)
authentication
- Login Handler Modepublic boolean isEnabled()
isEnabled
in interface io.micronaut.core.util.Toggleable
public java.util.List<InterceptUrlMapPattern> getInterceptUrlMap()
getInterceptUrlMap
in interface SecurityConfiguration
InterceptUrlMapPattern
public java.util.List<java.lang.String> getIpPatterns()
getIpPatterns
in interface SecurityConfiguration
public void setEnabled(boolean enabled)
enabled
- True if security is enabledpublic boolean isInterceptUrlMapPrependPatternWithContextPath()
isInterceptUrlMapPrependPatternWithContextPath
in interface SecurityConfiguration
public void setInterceptUrlMapPrependPatternWithContextPath(boolean interceptUrlMapPrependPatternWithContextPath)
interceptUrlMapPrependPatternWithContextPath
- Prepend Intercept URL Map pattern with context pathpublic void setInterceptUrlMap(java.util.List<InterceptUrlMapPattern> interceptUrlMap)
interceptUrlMap
- The intercept urls mapspublic void setIpPatterns(java.util.List<java.lang.String> ipPatterns)
ipPatterns
- The IP patternspublic AuthenticationStrategy getAuthenticationProviderStrategy()
getAuthenticationProviderStrategy
in interface SecurityConfiguration
public void setAuthenticationProviderStrategy(AuthenticationStrategy authenticationProviderStrategy)
authenticationProviderStrategy
- authentication strategy.public boolean isRejectNotFound()
SecurityConfiguration
isRejectNotFound
in interface SecurityConfiguration
public void setRejectNotFound(boolean rejectNotFound)
rejectNotFound
- Whether the server should respond with 401 for requests that do not match any routes on the server, if you set it to false, it will return 404 for requests that do not match any routes on the server. Default value (true).