|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.security.authentication.util.SignerSecretProvider
org.apache.hadoop.security.authentication.util.RolloverSignerSecretProvider
org.apache.hadoop.security.authentication.util.ZKSignerSecretProvider
@InterfaceStability.Unstable @InterfaceAudience.Private public class ZKSignerSecretProvider
A SignerSecretProvider that synchronizes a rolling random secret between multiple servers using ZooKeeper.
It works by storing the secrets and next rollover time in a ZooKeeper znode. All ZKSignerSecretProviders looking at that znode will use those secrets and next rollover time to ensure they are synchronized. There is no "leader" -- any of the ZKSignerSecretProviders can choose the next secret; which one is indeterminate. Kerberos-based ACLs can also be enforced to prevent a malicious third-party from getting or setting the secrets. It uses its own CuratorFramework client for talking to ZooKeeper. If you want to use your own Curator client, you can pass it to ZKSignerSecretProvider; seeAuthenticationFilter
for more details.
The supported configuration properties are:
| Nested Class Summary | |
|---|---|
static class |
ZKSignerSecretProvider.JaasConfiguration
Creates a programmatic version of a jaas.conf file. |
| Field Summary | |
|---|---|
static String |
DISCONNECT_FROM_ZOOKEEPER_ON_SHUTDOWN
Constant for the property that specifies whether or not the Curator client should disconnect from ZooKeeper on shutdown. |
static String |
ZOOKEEPER_AUTH_TYPE
Constant for the property that specifies the auth type to use. |
static String |
ZOOKEEPER_CONNECTION_STRING
Constant for the property that specifies the ZooKeeper connection string. |
static String |
ZOOKEEPER_KERBEROS_KEYTAB
Constant for the property that specifies the Kerberos keytab file. |
static String |
ZOOKEEPER_KERBEROS_PRINCIPAL
Constant for the property that specifies the Kerberos principal. |
static String |
ZOOKEEPER_PATH
Constant for the property that specifies the ZooKeeper path. |
static String |
ZOOKEEPER_SIGNER_SECRET_PROVIDER_CURATOR_CLIENT_ATTRIBUTE
Constant for the ServletContext attribute that can be used for providing a custom CuratorFramework client. |
| Constructor Summary | |
|---|---|
ZKSignerSecretProvider()
|
|
ZKSignerSecretProvider(long seed)
This constructor lets you set the seed of the Random Number Generator and is meant for testing. |
|
| Method Summary | |
|---|---|
protected org.apache.curator.framework.CuratorFramework |
createCuratorClient(Properties config)
This method creates the Curator client and connects to ZooKeeper. |
void |
destroy()
Disconnects from ZooKeeper unless told not to. |
protected byte[] |
generateNewSecret()
Subclasses should implement this to return a new secret. |
void |
init(Properties config,
javax.servlet.ServletContext servletContext,
long tokenValidity)
Initialize the SignerSecretProvider. |
protected void |
rollSecret()
Rolls the secret. |
| Methods inherited from class org.apache.hadoop.security.authentication.util.RolloverSignerSecretProvider |
|---|
getAllSecrets, getCurrentSecret, initSecrets, startScheduler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ZOOKEEPER_CONNECTION_STRING
public static final String ZOOKEEPER_PATH
public static final String ZOOKEEPER_AUTH_TYPE
public static final String ZOOKEEPER_KERBEROS_KEYTAB
public static final String ZOOKEEPER_KERBEROS_PRINCIPAL
public static final String DISCONNECT_FROM_ZOOKEEPER_ON_SHUTDOWN
public static final String ZOOKEEPER_SIGNER_SECRET_PROVIDER_CURATOR_CLIENT_ATTRIBUTE
| Constructor Detail |
|---|
public ZKSignerSecretProvider()
public ZKSignerSecretProvider(long seed)
seed - the seed for the random number generator| Method Detail |
|---|
public void init(Properties config,
javax.servlet.ServletContext servletContext,
long tokenValidity)
throws Exception
RolloverSignerSecretProvider
init in class RolloverSignerSecretProviderconfig - configuration propertiesservletContext - servlet contexttokenValidity - The amount of time a token is valid for
Exceptionpublic void destroy()
destroy in class RolloverSignerSecretProviderprotected void rollSecret()
RolloverSignerSecretProvider
rollSecret in class RolloverSignerSecretProviderprotected byte[] generateNewSecret()
RolloverSignerSecretProvider
generateNewSecret in class RolloverSignerSecretProvider
protected org.apache.curator.framework.CuratorFramework createCuratorClient(Properties config)
throws Exception
config - configuration properties
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||