public class DefaultJwtSharedSecretProvider extends Object implements JwtSecretProvider
JwtSecretProvider.
1. It first tries to get shared secret from conf HiveConf.ConfVars#LLAP_EXTERNAL_CLIENT_CLOUD_JWT_SHARED_SECRET
using Configuration.getPassword(String).
2. If not found, it tries to read from env var LLAP_EXTERNAL_CLIENT_CLOUD_JWT_SHARED_SECRET_ENV_VAR.
If secret is not found even after 1) and 2), init(Configuration) methods throws IllegalStateException.
Length of shared secret provided in 1) or 2) should be > 32 bytes.
It uses the same encryption and decryption secret which can be used to sign and verify JWT.| Modifier and Type | Field and Description |
|---|---|
static String |
LLAP_EXTERNAL_CLIENT_CLOUD_JWT_SHARED_SECRET_ENV_VAR |
| Constructor and Description |
|---|
DefaultJwtSharedSecretProvider() |
| Modifier and Type | Method and Description |
|---|---|
Key |
getDecryptionSecret()
returns secret for parsing JWT.
|
Key |
getEncryptionSecret()
returns secret for signing JWT.
|
void |
init(org.apache.hadoop.conf.Configuration conf)
Initializes the provider.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitAndGetpublic static final String LLAP_EXTERNAL_CLIENT_CLOUD_JWT_SHARED_SECRET_ENV_VAR
public Key getEncryptionSecret()
JwtSecretProvidergetEncryptionSecret in interface JwtSecretProviderpublic Key getDecryptionSecret()
JwtSecretProvidergetDecryptionSecret in interface JwtSecretProviderpublic void init(org.apache.hadoop.conf.Configuration conf)
JwtSecretProviderinit in interface JwtSecretProviderconf - configurationCopyright © 2022 The Apache Software Foundation. All rights reserved.