Class FeishuAccessTokenProvider
java.lang.Object
io.agentscope.extensions.channel.feishu.FeishuAccessTokenProvider
Fetches and caches a Feishu
tenant_access_token for one app_id + app_secret
pair. Tokens are valid for ~7200 s; this provider proactively refreshes at ~80% of TTL.
The cache defaults to a process-local InMemoryAccessTokenStore; pass a
shared-storage AccessTokenStore to share tokens across instances.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFeishuAccessTokenProvider(String apiBase, String appId, String appSecret) FeishuAccessTokenProvider(String apiBase, String appId, String appSecret, io.agentscope.extensions.channel.common.AccessTokenStore store) Constructor variant that lets the application choose where the token is cached — for example a shared-storageAccessTokenStoreso one refresh or invalidation serves all instances. -
Method Summary
-
Constructor Details
-
FeishuAccessTokenProvider
-
FeishuAccessTokenProvider
public FeishuAccessTokenProvider(String apiBase, String appId, String appSecret, io.agentscope.extensions.channel.common.AccessTokenStore store) Constructor variant that lets the application choose where the token is cached — for example a shared-storageAccessTokenStoreso one refresh or invalidation serves all instances.- Parameters:
store- cache for the fetched token; must be thread-safe
-
-
Method Details
-
token
Returns a valid tenant_access_token, refreshing in-band when missing or near-expiry. -
invalidate
public void invalidate()Forces the nexttoken()call to refresh. Useful for tests / error recovery.
-