类 AbstractProtocolAuthService<R>
- java.lang.Object
-
- com.alibaba.nacos.auth.AbstractProtocolAuthService<R>
-
- 所有已实现的接口:
ProtocolAuthService<R>
public abstract class AbstractProtocolAuthService<R> extends java.lang.Object implements ProtocolAuthService<R>
Abstract protocol auth service.Implement #validateIdentity and #validateAuthority method template.
- 作者:
- xiweng.yy
-
-
字段概要
字段 修饰符和类型 字段 说明 protected AuthConfigsauthConfigs
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractProtocolAuthService(AuthConfigs authConfigs)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanenableAuth(Secured secured)Judgement whether enable auth feature according to secured information.protected com.alibaba.nacos.plugin.auth.api.ResourceparseSpecifiedResource(Secured secured)Get resource from secured annotation specified resource.protected com.alibaba.nacos.plugin.auth.api.ResourceuseSpecifiedParserToParse(Secured secured, R request)Parse resource by specified resource parser.booleanvalidateAuthority(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext, com.alibaba.nacos.plugin.auth.api.Permission permission)Validate identity whether had permission for the resource and action.booleanvalidateIdentity(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext, com.alibaba.nacos.plugin.auth.api.Resource resource)Validate identity whether is legal.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 com.alibaba.nacos.auth.ProtocolAuthService
initialize, parseIdentity, parseResource
-
-
-
-
字段详细资料
-
authConfigs
protected final AuthConfigs authConfigs
-
-
构造器详细资料
-
AbstractProtocolAuthService
protected AbstractProtocolAuthService(AuthConfigs authConfigs)
-
-
方法详细资料
-
enableAuth
public boolean enableAuth(Secured secured)
从接口复制的说明:ProtocolAuthServiceJudgement whether enable auth feature according to secured information.configuration authEnabled in
AuthConfigsis the main switch. If authEnabled isfalse, this method and other follow methods should not be called. This method is only for plugin to judge whether auth thisSecured. For example, plugins can only auth for write action or only for naming type request.- 指定者:
enableAuth在接口中ProtocolAuthService<R>- 参数:
secured- secured information- 返回:
trueif enable auth, otherwisefalse
-
validateIdentity
public boolean validateIdentity(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext, com.alibaba.nacos.plugin.auth.api.Resource resource) throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:ProtocolAuthServiceValidate identity whether is legal.- 指定者:
validateIdentity在接口中ProtocolAuthService<R>- 参数:
identityContext- identity contextresource- resource- 返回:
trueif legal, otherwisefalse- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- exception during validating
-
validateAuthority
public boolean validateAuthority(com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext, com.alibaba.nacos.plugin.auth.api.Permission permission) throws com.alibaba.nacos.plugin.auth.exception.AccessException从接口复制的说明:ProtocolAuthServiceValidate identity whether had permission for the resource and action.- 指定者:
validateAuthority在接口中ProtocolAuthService<R>- 参数:
identityContext- identity contextpermission- permission include resource and action- 返回:
trueif legal, otherwisefalse- 抛出:
com.alibaba.nacos.plugin.auth.exception.AccessException- exception during validating
-
parseSpecifiedResource
protected com.alibaba.nacos.plugin.auth.api.Resource parseSpecifiedResource(Secured secured)
Get resource from secured annotation specified resource.- 参数:
secured- secured annotation- 返回:
- resource
-
-