Class WarlockSecurityProp
-
- All Implemented Interfaces:
@ConfigurationProperties(value = WarlockSecurityProp.Key) public class WarlockSecurityProp
The order of config is from loose to strict. `webIgnore` >`PermitAll` >`Authenticated` >`Authority` >`AnyRequest` at the end. if value is `-` or `empty`, means ignore this key.
Spring Security setting. wings-warlock-security-77.properties
- Since:
2021-02-13
trydofor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classWarlockSecurityProp.Mupublic classWarlockSecurityProp.Ma
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WarlockSecurityProp()
-
Method Summary
Modifier and Type Method Description StringgetLoginPage()the redirect page when not login, need to have controller to handle. voidsetLoginPage(String loginPage)the redirect page when not login, need to have controller to handle. StringgetLoginProcUrl()loginProcessingUrl, the Ant style URL for processing login, handled by filter, no controller required. voidsetLoginProcUrl(String loginProcUrl)loginProcessingUrl, the Ant style URL for processing login, handled by filter, no controller required. Set<String>getLoginProcMethod()Spring is POST only to better follow RESTful, but Oauth has Get. voidsetLoginProcMethod(Set<String> loginProcMethod)Spring is POST only to better follow RESTful, but Oauth has Get. StringgetLogoutUrl()logout url, handled by filter, no controller required. voidsetLogoutUrl(String logoutUrl)logout url, handled by filter, no controller required. StringgetLoginSuccessRedirectParam()redirect parameters if redirect after successful login. voidsetLoginSuccessRedirectParam(String loginSuccessRedirectParam)redirect parameters if redirect after successful login. StringgetLoginSuccessRedirectDefault()default address if redirect after successful login. voidsetLoginSuccessRedirectDefault(String loginSuccessRedirectDefault)default address if redirect after successful login. StringgetLoginSuccessBody()the response body if no redirect after successful login. voidsetLoginSuccessBody(String loginSuccessBody)the response body if no redirect after successful login. StringgetLoginFailureBody()the response body if login fail. voidsetLoginFailureBody(String loginFailureBody)the response body if login fail. StringgetLogoutSuccessBody()the response body after successful logout, no handler is injected when empty. voidsetLogoutSuccessBody(String logoutSuccessBody)the response body after successful logout, no handler is injected when empty. intgetSessionMaximum()the response body after successful logout, no handler is injected when empty. voidsetSessionMaximum(int sessionMaximum)the response body after successful logout, no handler is injected when empty. StringgetSessionExpiredBody()the response body when session expired. voidsetSessionExpiredBody(String sessionExpiredBody)the response body when session expired. StringgetUsernamePara()username Parameter voidsetUsernamePara(String usernamePara)username Parameter StringgetPasswordPara()password Parameter voidsetPasswordPara(String passwordPara)password Parameter StringgetRolePrefix()GrantedAuthorityDefaults, suggest keeping the same with spring, do not edit. voidsetRolePrefix(String rolePrefix)GrantedAuthorityDefaults, suggest keeping the same with spring, do not edit. Map<String, String>getWebIgnore()(1) ignored items, antMatcher, no need of SecurityFilter, such as static resources. voidsetWebIgnore(Map<String, String> webIgnore)(1) ignored items, antMatcher, no need of SecurityFilter, such as static resources. Map<String, String>getPermitAll()(2) allow all, `Map`, antMatcher. voidsetPermitAll(Map<String, String> permitAll)(2) allow all, `Map`, antMatcher. Map<String, String>getAuthenticated()(3) authed only, antMatcher. voidsetAuthenticated(Map<String, String> authenticated)(3) authed only, antMatcher. Map<String, Set<String>>getAuthority()(4) has authority, antMatcher. voidsetAuthority(Map<String, Set<String>> authority)(4) has authority, antMatcher. StringgetAnyRequest()(5) defaults, `String`, support the followings. - `permitAll`|`authenticated`|`anonymous`|`fullyAuthenticated` - any non-empty, non-above string, considered as `Authority`, use `comma` or `blank` to separate multiple ones.voidsetAnyRequest(String anyRequest)(5) defaults, `String`, support the followings. - `permitAll`|`authenticated`|`anonymous`|`fullyAuthenticated` - any non-empty, non-above string, considered as `Authority`, use `comma` or `blank` to separate multiple ones.StringgetAuthTypeDefault()Supported validation types, enum full path, one-to-one, otherwise reverse parsing problem; no `-`, `default` is a special value used when there is no match. voidsetAuthTypeDefault(String authTypeDefault)Supported validation types, enum full path, one-to-one, otherwise reverse parsing problem; no `-`, `default` is a special value used when there is no match. Map<String, String>getAuthType()login auth-type and enum mapping, must be one-to-one. voidsetAuthType(Map<String, String> authType)login auth-type and enum mapping, must be one-to-one. Map<String, Set<String>>getZonePerm()Map permissions to authZone, if you have one of them, you can login, otherwise, it will fail with wrong username and password. voidsetZonePerm(Map<String, Set<String>> zonePerm)Map permissions to authZone, if you have one of them, you can login, otherwise, it will fail with wrong username and password. Map<String, Set<String>>getAppPerm()Map permissions to spring.application.name, if you have one of them, you can login, otherwise, it will fail with wrong username and password. voidsetAppPerm(Map<String, Set<String>> appPerm)Map permissions to spring.application.name, if you have one of them, you can login, otherwise, it will fail with wrong username and password. Set<String>getNonceAuthType()which auth-type support Nonce auth. voidsetNonceAuthType(Set<String> nonceAuthType)which auth-type support Nonce auth. StringgetNonceCacheManager()bean name of cache-manager, same as `wings.slardar.cache.primary`. voidsetNonceCacheManager(String nonceCacheManager)bean name of cache-manager, same as `wings.slardar.cache.primary`. StringgetNonceCacheLevel()cache level, see `wings.slardar.cache.level. voidsetNonceCacheLevel(String nonceCacheLevel)cache level, see `wings.slardar.cache.level. Set<String>getAutoregAuthType()which auth-type support to auto register new user. voidsetAutoregAuthType(Set<String> autoregAuthType)which auth-type support to auto register new user. intgetAutoregMaxFailed()max mumber of consecutive failures for auto-registering users, and locking the account when reached. voidsetAutoregMaxFailed(int autoregMaxFailed)max mumber of consecutive failures for auto-registering users, and locking the account when reached. DurationgetAutoregExpired()credential expiration time for auto-registering users, default 3652 days (10 years) voidsetAutoregExpired(Duration autoregExpired)credential expiration time for auto-registering users, default 3652 days (10 years) Map<String, WarlockSecurityProp.Mu>getMemUser()Configure memory user, usually used for special user login. - key is the description, override if duplicate, suggest `username`+(`/`+`auth-type`)? - `auth-type=`, to match all auth-type. - For other settings, see WarlockAuthnService.Details and its defaults.voidsetMemUser(Map<String, WarlockSecurityProp.Mu> memUser)Configure memory user, usually used for special user login. - key is the description, override if duplicate, suggest `username`+(`/`+`auth-type`)? - `auth-type=`, to match all auth-type. - For other settings, see WarlockAuthnService.Details and its defaults.Map<String, WarlockSecurityProp.Ma>getMemAuth()Memory user permissions, key is the description, override if duplicate, suggest naming by type and usage. voidsetMemAuth(Map<String, WarlockSecurityProp.Ma> memAuth)Memory user permissions, key is the description, override if duplicate, suggest naming by type and usage. Enum<out Object>mapAuthTypeDefault()Map<String, Enum<out Object>>mapAuthTypeEnum()Set<Enum<out Object>>mapAutoregAuthEnum()Set<Enum<out Object>>mapNonceAuthEnum()booleanisWebDebug()whether to enable WebSecurity. booleanisAuthorityRole()whether to use Role in AuthX. booleanisAuthorityPerm()whether to use Perm in AuthX. booleanisAnonymous()whether to enable anonymous booleanisLoginForward()true to forward in servlet, otherwise redirect(302) booleanisLoginSuccessRedirect()whether to redirect after successful login. booleanequals(@Nullable() Object o)inthashCode()StringtoString()voidsetWebDebug(boolean webDebug)whether to enable WebSecurity. voidsetAuthorityRole(boolean authorityRole)whether to use Role in AuthX. voidsetAuthorityPerm(boolean authorityPerm)whether to use Perm in AuthX. voidsetAnonymous(boolean anonymous)whether to enable anonymous voidsetLoginForward(boolean loginForward)true to forward in servlet, otherwise redirect(302) voidsetLoginSuccessRedirect(boolean loginSuccessRedirect)whether to redirect after successful login. -
-
Method Detail
-
getLoginPage
String getLoginPage()
the redirect page when not login, need to have controller to handle.
-
setLoginPage
void setLoginPage(String loginPage)
the redirect page when not login, need to have controller to handle.
-
getLoginProcUrl
String getLoginProcUrl()
loginProcessingUrl, the Ant style URL for processing login, handled by filter, no controller required. Support `authType` and `authZone` variables, which can be obtained via param or path (PathPattern)
-
setLoginProcUrl
void setLoginProcUrl(String loginProcUrl)
loginProcessingUrl, the Ant style URL for processing login, handled by filter, no controller required. Support `authType` and `authZone` variables, which can be obtained via param or path (PathPattern)
-
getLoginProcMethod
Set<String> getLoginProcMethod()
Spring is POST only to better follow RESTful, but Oauth has Get.
-
setLoginProcMethod
void setLoginProcMethod(Set<String> loginProcMethod)
Spring is POST only to better follow RESTful, but Oauth has Get.
-
getLogoutUrl
String getLogoutUrl()
logout url, handled by filter, no controller required.
-
setLogoutUrl
void setLogoutUrl(String logoutUrl)
logout url, handled by filter, no controller required.
-
getLoginSuccessRedirectParam
String getLoginSuccessRedirectParam()
redirect parameters if redirect after successful login.
-
setLoginSuccessRedirectParam
void setLoginSuccessRedirectParam(String loginSuccessRedirectParam)
redirect parameters if redirect after successful login.
-
getLoginSuccessRedirectDefault
String getLoginSuccessRedirectDefault()
default address if redirect after successful login.
-
setLoginSuccessRedirectDefault
void setLoginSuccessRedirectDefault(String loginSuccessRedirectDefault)
default address if redirect after successful login.
-
getLoginSuccessBody
String getLoginSuccessBody()
the response body if no redirect after successful login.
-
setLoginSuccessBody
void setLoginSuccessBody(String loginSuccessBody)
the response body if no redirect after successful login.
-
getLoginFailureBody
String getLoginFailureBody()
the response body if login fail.
-
setLoginFailureBody
void setLoginFailureBody(String loginFailureBody)
the response body if login fail.
-
getLogoutSuccessBody
String getLogoutSuccessBody()
the response body after successful logout, no handler is injected when empty.
-
setLogoutSuccessBody
void setLogoutSuccessBody(String logoutSuccessBody)
the response body after successful logout, no handler is injected when empty.
-
getSessionMaximum
int getSessionMaximum()
the response body after successful logout, no handler is injected when empty.
-
setSessionMaximum
void setSessionMaximum(int sessionMaximum)
the response body after successful logout, no handler is injected when empty.
-
getSessionExpiredBody
String getSessionExpiredBody()
the response body when session expired.
-
setSessionExpiredBody
void setSessionExpiredBody(String sessionExpiredBody)
the response body when session expired.
-
getUsernamePara
String getUsernamePara()
username Parameter
-
setUsernamePara
void setUsernamePara(String usernamePara)
username Parameter
-
getPasswordPara
String getPasswordPara()
password Parameter
-
setPasswordPara
void setPasswordPara(String passwordPara)
password Parameter
-
getRolePrefix
String getRolePrefix()
GrantedAuthorityDefaults, suggest keeping the same with spring, do not edit.
-
setRolePrefix
void setRolePrefix(String rolePrefix)
GrantedAuthorityDefaults, suggest keeping the same with spring, do not edit.
-
getWebIgnore
Map<String, String> getWebIgnore()
(1) ignored items, antMatcher, no need of SecurityFilter, such as static resources.
-
setWebIgnore
void setWebIgnore(Map<String, String> webIgnore)
(1) ignored items, antMatcher, no need of SecurityFilter, such as static resources.
-
getPermitAll
Map<String, String> getPermitAll()
(2) allow all, `Map`, antMatcher.
-
setPermitAll
void setPermitAll(Map<String, String> permitAll)
(2) allow all, `Map`, antMatcher.
-
getAuthenticated
Map<String, String> getAuthenticated()
(3) authed only, antMatcher.
-
setAuthenticated
void setAuthenticated(Map<String, String> authenticated)
(3) authed only, antMatcher.
-
getAuthority
Map<String, Set<String>> getAuthority()
(4) has authority, antMatcher. merge authority by URL grouping, and finally set the URL in reverse ASCII order, i.e., the English number comes before the `*`, and the loose rule comes after.
-
setAuthority
void setAuthority(Map<String, Set<String>> authority)
(4) has authority, antMatcher. merge authority by URL grouping, and finally set the URL in reverse ASCII order, i.e., the English number comes before the `*`, and the loose rule comes after.
-
getAnyRequest
String getAnyRequest()
(5) defaults, `String`, support the followings. - `permitAll`|`authenticated`|`anonymous`|`fullyAuthenticated` - any non-empty, non-above string, considered as `Authority`, use `comma` or `blank` to separate multiple ones.
-
setAnyRequest
void setAnyRequest(String anyRequest)
(5) defaults, `String`, support the followings. - `permitAll`|`authenticated`|`anonymous`|`fullyAuthenticated` - any non-empty, non-above string, considered as `Authority`, use `comma` or `blank` to separate multiple ones.
-
getAuthTypeDefault
String getAuthTypeDefault()
Supported validation types, enum full path, one-to-one, otherwise reverse parsing problem; no `-`, `default` is a special value used when there is no match.
-
setAuthTypeDefault
void setAuthTypeDefault(String authTypeDefault)
Supported validation types, enum full path, one-to-one, otherwise reverse parsing problem; no `-`, `default` is a special value used when there is no match.
-
getAuthType
Map<String, String> getAuthType()
login auth-type and enum mapping, must be one-to-one.
-
setAuthType
void setAuthType(Map<String, String> authType)
login auth-type and enum mapping, must be one-to-one.
-
getZonePerm
Map<String, Set<String>> getZonePerm()
Map permissions to authZone, if you have one of them, you can login, otherwise, it will fail with wrong username and password.
-
setZonePerm
void setZonePerm(Map<String, Set<String>> zonePerm)
Map permissions to authZone, if you have one of them, you can login, otherwise, it will fail with wrong username and password.
-
getAppPerm
Map<String, Set<String>> getAppPerm()
Map permissions to spring.application.name, if you have one of them, you can login, otherwise, it will fail with wrong username and password. Support AntPath, eg. `wings-*`, merge all matching permissions, wings default app is `wings-default`.
-
setAppPerm
void setAppPerm(Map<String, Set<String>> appPerm)
Map permissions to spring.application.name, if you have one of them, you can login, otherwise, it will fail with wrong username and password. Support AntPath, eg. `wings-*`, merge all matching permissions, wings default app is `wings-default`.
-
getNonceAuthType
Set<String> getNonceAuthType()
which auth-type support Nonce auth.
-
setNonceAuthType
void setNonceAuthType(Set<String> nonceAuthType)
which auth-type support Nonce auth.
-
getNonceCacheManager
String getNonceCacheManager()
bean name of cache-manager, same as `wings.slardar.cache.primary`.
-
setNonceCacheManager
void setNonceCacheManager(String nonceCacheManager)
bean name of cache-manager, same as `wings.slardar.cache.primary`.
-
getNonceCacheLevel
String getNonceCacheLevel()
cache level, see `wings.slardar.cache.level.`
-
setNonceCacheLevel
void setNonceCacheLevel(String nonceCacheLevel)
cache level, see `wings.slardar.cache.level.`
-
getAutoregAuthType
Set<String> getAutoregAuthType()
which auth-type support to auto register new user. eg. `github,weibo`
-
setAutoregAuthType
void setAutoregAuthType(Set<String> autoregAuthType)
which auth-type support to auto register new user. eg. `github,weibo`
-
getAutoregMaxFailed
int getAutoregMaxFailed()
max mumber of consecutive failures for auto-registering users, and locking the account when reached.
-
setAutoregMaxFailed
void setAutoregMaxFailed(int autoregMaxFailed)
max mumber of consecutive failures for auto-registering users, and locking the account when reached.
-
getAutoregExpired
Duration getAutoregExpired()
credential expiration time for auto-registering users, default 3652 days (10 years)
-
setAutoregExpired
void setAutoregExpired(Duration autoregExpired)
credential expiration time for auto-registering users, default 3652 days (10 years)
-
getMemUser
Map<String, WarlockSecurityProp.Mu> getMemUser()
Configure memory user, usually used for special user login. - key is the description, override if duplicate, suggest `username`+(`/`+`auth-type`)? - `auth-type=`, to match all auth-type. - For other settings, see WarlockAuthnService.Details and its defaults.
-
setMemUser
void setMemUser(Map<String, WarlockSecurityProp.Mu> memUser)
Configure memory user, usually used for special user login. - key is the description, override if duplicate, suggest `username`+(`/`+`auth-type`)? - `auth-type=`, to match all auth-type. - For other settings, see WarlockAuthnService.Details and its defaults.
-
getMemAuth
Map<String, WarlockSecurityProp.Ma> getMemAuth()
Memory user permissions, key is the description, override if duplicate, suggest naming by type and usage.
-
setMemAuth
void setMemAuth(Map<String, WarlockSecurityProp.Ma> memAuth)
Memory user permissions, key is the description, override if duplicate, suggest naming by type and usage.
-
mapAuthTypeDefault
Enum<out Object> mapAuthTypeDefault()
-
mapAuthTypeEnum
Map<String, Enum<out Object>> mapAuthTypeEnum()
-
mapAutoregAuthEnum
Set<Enum<out Object>> mapAutoregAuthEnum()
-
mapNonceAuthEnum
Set<Enum<out Object>> mapNonceAuthEnum()
-
isWebDebug
boolean isWebDebug()
whether to enable WebSecurity.debug
-
isAuthorityRole
boolean isAuthorityRole()
whether to use Role in AuthX.
-
isAuthorityPerm
boolean isAuthorityPerm()
whether to use Perm in AuthX.
-
isAnonymous
boolean isAnonymous()
whether to enable anonymous
-
isLoginForward
boolean isLoginForward()
true to forward in servlet, otherwise redirect(302)
-
isLoginSuccessRedirect
boolean isLoginSuccessRedirect()
whether to redirect after successful login.
-
hashCode
int hashCode()
-
setWebDebug
void setWebDebug(boolean webDebug)
whether to enable WebSecurity.debug
-
setAuthorityRole
void setAuthorityRole(boolean authorityRole)
whether to use Role in AuthX.
-
setAuthorityPerm
void setAuthorityPerm(boolean authorityPerm)
whether to use Perm in AuthX.
-
setAnonymous
void setAnonymous(boolean anonymous)
whether to enable anonymous
-
setLoginForward
void setLoginForward(boolean loginForward)
true to forward in servlet, otherwise redirect(302)
-
setLoginSuccessRedirect
void setLoginSuccessRedirect(boolean loginSuccessRedirect)
whether to redirect after successful login.
-
-
-
-