类 SecurityProxy
- java.lang.Object
-
- com.alibaba.nacos.client.security.SecurityProxy
-
public class SecurityProxy extends java.lang.ObjectSecurity proxy to update security information.- 从以下版本开始:
- 1.2.0
- 作者:
- nkorange
-
-
字段概要
字段 修饰符和类型 字段 说明 private java.lang.StringaccessTokenA token to take with when sending request to Nacos server.private java.lang.StringcontextPathprivate longlastRefreshTimeLast timestamp refresh security info from server.private static java.lang.StringLOGIN_URLprivate com.alibaba.nacos.common.http.client.NacosRestTemplatenacosRestTemplateprivate java.lang.StringpasswordUser's password.private static org.slf4j.LoggerSECURITY_LOGGERprivate longtokenRefreshWindowtime window to refresh security info in seconds.private longtokenTtlTTL of token in seconds.private java.lang.StringusernameUser's name.
-
构造器概要
构造器 构造器 说明 SecurityProxy(java.util.Properties properties, com.alibaba.nacos.common.http.client.NacosRestTemplate nacosRestTemplate)Construct from properties, keeping flexibility.
-
-
-
字段详细资料
-
SECURITY_LOGGER
private static final org.slf4j.Logger SECURITY_LOGGER
-
LOGIN_URL
private static final java.lang.String LOGIN_URL
- 另请参阅:
- 常量字段值
-
nacosRestTemplate
private final com.alibaba.nacos.common.http.client.NacosRestTemplate nacosRestTemplate
-
contextPath
private final java.lang.String contextPath
-
username
private final java.lang.String username
User's name.
-
password
private final java.lang.String password
User's password.
-
accessToken
private volatile java.lang.String accessToken
A token to take with when sending request to Nacos server.
-
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.
-
-
方法详细资料
-
login
public boolean login(java.util.List<java.lang.String> servers)
Login to servers.- 参数:
servers- server list- 返回:
- true if login successfully
-
login
public boolean login(java.lang.String server)
Login to server.- 参数:
server- server address- 返回:
- true if login successfully
-
getAccessToken
public java.lang.String getAccessToken()
-
isEnabled
public boolean isEnabled()
-
-