接口 AuthPluginService
public interface AuthPluginService
Auth service.
- 作者:
- Wuyfee, xiweng.yy
-
方法概要
修饰符和类型方法说明booleanenableAuth(ActionTypes action, String type) Judgement whether this plugin enable auth for this action and type.AuthPluginService Name which for conveniently find AuthPluginService instance.Define which identity information needed from request. e.q: username, password, accessToken.default booleanWhether need administrator .default booleanIs the plugin enable login.validateAuthority(IdentityContext identityContext, Permission permission) Validate the identity whether has the resource authority.validateIdentity(IdentityContext identityContext, Resource resource) To validate whether the identity context from request is legal or illegal.
-
方法详细资料
-
identityNames
Collection<String> identityNames()Define which identity information needed from request. e.q: username, password, accessToken.- 返回:
- identity names
-
enableAuth
Judgement whether this plugin enable auth for this action and type.- 参数:
action- action of request, seeActionTypestype- type of request, seeSignType- 返回:
- @return
trueif enable auth, otherwisefalse
-
validateIdentity
AuthResult validateIdentity(IdentityContext identityContext, Resource resource) throws AccessException To validate whether the identity context from request is legal or illegal.- 参数:
identityContext- where we can find the user informationresource- resource about this user information- 返回:
AuthResultof validate result- 抛出:
AccessException- if authentication is failed
-
validateAuthority
AuthResult validateAuthority(IdentityContext identityContext, Permission permission) throws AccessException Validate the identity whether has the resource authority.- 参数:
identityContext- where we can find the user information.permission- permission to auth.- 返回:
AuthResultof validate result- 抛出:
AccessException- if authentication is failed
-
getAuthServiceName
String getAuthServiceName()AuthPluginService Name which for conveniently find AuthPluginService instance.- 返回:
- AuthServiceName mark a AuthPluginService instance.
-
isLoginEnabled
default boolean isLoginEnabled()Is the plugin enable login.- 返回:
trueif plugin need login, otherwisefalse- 从以下版本开始:
- 2.2.2
-
isAdminRequest
default boolean isAdminRequest()Whether need administrator .- 返回:
- if need the administrator role.
-