类 AuthFilter
- java.lang.Object
-
- com.alibaba.nacos.core.auth.AuthFilter
-
- 所有已实现的接口:
javax.servlet.Filter
public class AuthFilter extends java.lang.Object implements javax.servlet.FilterUnified filter to handle authentication and authorization.- 从以下版本开始:
- 1.2.0
- 作者:
- nkorange
-
-
字段概要
字段 修饰符和类型 字段 说明 private com.alibaba.nacos.auth.config.AuthConfigsauthConfigsprivate ControllerMethodsCachemethodsCacheprivate com.alibaba.nacos.auth.HttpProtocolAuthServiceprotocolAuthService
-
构造器概要
构造器 构造器 说明 AuthFilter(com.alibaba.nacos.auth.config.AuthConfigs authConfigs, ControllerMethodsCache methodsCache)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)private voidinjectIdentityId(javax.servlet.http.HttpServletRequest request, com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)Set identity id to request session, make sure some actual logic can get identity information.
-
-
-
字段详细资料
-
authConfigs
private final com.alibaba.nacos.auth.config.AuthConfigs authConfigs
-
methodsCache
private final ControllerMethodsCache methodsCache
-
protocolAuthService
private final com.alibaba.nacos.auth.HttpProtocolAuthService protocolAuthService
-
-
构造器详细资料
-
AuthFilter
public AuthFilter(com.alibaba.nacos.auth.config.AuthConfigs authConfigs, ControllerMethodsCache methodsCache)
-
-
方法详细资料
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException- 指定者:
doFilter在接口中javax.servlet.Filter- 抛出:
java.io.IOExceptionjavax.servlet.ServletException
-
injectIdentityId
private void injectIdentityId(javax.servlet.http.HttpServletRequest request, com.alibaba.nacos.plugin.auth.api.IdentityContext identityContext)Set identity id to request session, make sure some actual logic can get identity information.May be replaced with whole identityContext.
- 参数:
request- http requestidentityContext- identity context
-
-