public class WorkerTokenManager extends Object
| Constructor and Description |
|---|
WorkerTokenManager(Map<String,Object> daemonConf,
IStormClusterState state)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
WorkerToken |
createOrUpdateTokenFor(WorkerTokenServiceType serviceType,
String user,
String topologyId)
Create or update an existing key.
|
protected SecretKey |
generateSecret()
Generate a new random secret key.
|
protected SecretKey |
getCurrentSecret()
Get the secret that should be used to sign a token.
|
boolean |
shouldRenewWorkerToken(Map<String,String> creds,
WorkerTokenServiceType type) |
void |
upsertWorkerTokensInCredsForTopo(Map<String,String> creds,
String user,
String topologyId)
Create or renew WorkerToken credentials for a topology.
|
public WorkerTokenManager(Map<String,Object> daemonConf, IStormClusterState state)
daemonConf - the config for nimbus.state - the state used to store private keys.protected SecretKey generateSecret()
protected SecretKey getCurrentSecret()
public WorkerToken createOrUpdateTokenFor(WorkerTokenServiceType serviceType, String user, String topologyId)
serviceType - the type of service to create a token foruser - the user the token is fortopologyId - the topology the token is forpublic void upsertWorkerTokensInCredsForTopo(Map<String,String> creds, String user, String topologyId)
creds - the map of credentials for.user - the user the credentials are fortopologyId - the topology the credentials are forpublic boolean shouldRenewWorkerToken(Map<String,String> creds, WorkerTokenServiceType type)
Copyright © 2023 The Apache Software Foundation. All rights reserved.