类 AbstractProtocolAuthService<R>

    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      boolean enableAuth​(Secured secured)
      Judgement whether enable auth feature according to secured information.
      protected com.alibaba.nacos.plugin.auth.api.Resource parseSpecifiedResource​(Secured secured)
      Get resource from secured annotation specified resource.
      protected com.alibaba.nacos.plugin.auth.api.Resource useSpecifiedParserToParse​(Secured secured, R request)
      Parse resource by specified resource parser.
      boolean validateAuthority​(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.
      boolean validateIdentity​(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
    • 字段详细资料

    • 构造器详细资料

      • AbstractProtocolAuthService

        protected AbstractProtocolAuthService​(AuthConfigs authConfigs)
    • 方法详细资料

      • enableAuth

        public boolean enableAuth​(Secured secured)
        从接口复制的说明: ProtocolAuthService
        Judgement whether enable auth feature according to secured information.

        configuration authEnabled in AuthConfigs is the main switch. If authEnabled is false, this method and other follow methods should not be called. This method is only for plugin to judge whether auth this Secured. For example, plugins can only auth for write action or only for naming type request.

        指定者:
        enableAuth 在接口中 ProtocolAuthService<R>
        参数:
        secured - secured information
        返回:
        true if enable auth, otherwise false
      • 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
        从接口复制的说明: ProtocolAuthService
        Validate identity whether is legal.
        指定者:
        validateIdentity 在接口中 ProtocolAuthService<R>
        参数:
        identityContext - identity context
        resource - resource
        返回:
        true if legal, otherwise false
        抛出:
        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
        从接口复制的说明: ProtocolAuthService
        Validate identity whether had permission for the resource and action.
        指定者:
        validateAuthority 在接口中 ProtocolAuthService<R>
        参数:
        identityContext - identity context
        permission - permission include resource and action
        返回:
        true if legal, otherwise false
        抛出:
        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
      • useSpecifiedParserToParse

        protected com.alibaba.nacos.plugin.auth.api.Resource useSpecifiedParserToParse​(Secured secured,
                                                                                       R request)
        Parse resource by specified resource parser.
        参数:
        secured - secured annotation
        request - request
        返回:
        resource