类 NacosClientAuthServiceImpl

java.lang.Object
com.alibaba.nacos.plugin.auth.spi.client.AbstractClientAuthService
com.alibaba.nacos.client.auth.impl.NacosClientAuthServiceImpl
所有已实现的接口:
Closeable, ClientAuthService

public class NacosClientAuthServiceImpl extends AbstractClientAuthService
a ClientAuthService implement.
作者:
wuyfee
  • 字段详细资料

    • SECURITY_LOGGER

      private static final org.slf4j.Logger SECURITY_LOGGER
    • tokenTtl

      private long tokenTtl
      TTL of token in seconds.
    • lastRefreshTime

      private long lastRefreshTime
      Last timestamp refresh security info from server.
    • tokenRefreshWindow

      private long tokenRefreshWindow
      time window to refresh security info in seconds.
    • loginIdentityContext

      private volatile LoginIdentityContext loginIdentityContext
      A context to take with when sending request to Nacos server.
    • reLoginWindow

      private final long reLoginWindow
      Re-login window in milliseconds.
      另请参阅:
  • 构造器详细资料

    • NacosClientAuthServiceImpl

      public NacosClientAuthServiceImpl()
  • 方法详细资料

    • login

      public Boolean login(Properties properties)
      Login to servers.
      返回:
      true if login successfully
    • getLoginIdentityContext

      public LoginIdentityContext getLoginIdentityContext(RequestResource resource)
    • shutdown

      public void shutdown() throws NacosException
      抛出:
      NacosException
    • generateTokenRefreshWindow

      public long generateTokenRefreshWindow(long tokenTtl)
      Randomly generate TokenRefreshWindow, Avoid a large number of logins causing pressure on the Nacos server.
      参数:
      tokenTtl - TTL of token in seconds.
      返回:
      tokenRefreshWindow, numerical range [tokenTtl/15 ~ tokenTtl/10]