@InterfaceAudience.Private public class KMSACLs extends Object implements Runnable, KeyAuthorizationKeyProvider.KeyACLs
AccessControlLists used by KMS,
hot-reloading them if the kms-acls.xml file where the ACLs
are defined has been updated.| Modifier and Type | Class and Description |
|---|---|
static class |
KMSACLs.Type |
| Modifier and Type | Field and Description |
|---|---|
static String |
ACL_DEFAULT |
static int |
RELOADER_SLEEP_MILLIS |
| Constructor and Description |
|---|
KMSACLs() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertAccess(KMSACLs.Type aclType,
UserGroupInformation ugi,
KMS.KMSOp operation,
String key) |
boolean |
hasAccess(KMSACLs.Type type,
UserGroupInformation ugi)
First Check if user is in ACL for the KMS operation, if yes, then
return true if user is not present in any configured blacklist for
the operation
|
boolean |
hasAccessToKey(String keyName,
UserGroupInformation ugi,
KeyAuthorizationKeyProvider.KeyOpType opType)
This is called by the KeyProvider to check if the given user is
authorized to perform the specified operation on the given acl name.
|
boolean |
isACLPresent(String keyName,
KeyAuthorizationKeyProvider.KeyOpType opType) |
void |
run() |
void |
startReloader() |
void |
stopReloader() |
public static final String ACL_DEFAULT
public static final int RELOADER_SLEEP_MILLIS
public void startReloader()
public void stopReloader()
public boolean hasAccess(KMSACLs.Type type, UserGroupInformation ugi)
type - KMS Operationugi - UserGroupInformation of userpublic void assertAccess(KMSACLs.Type aclType, UserGroupInformation ugi, KMS.KMSOp operation, String key) throws AccessControlException
AccessControlExceptionpublic boolean hasAccessToKey(String keyName, UserGroupInformation ugi, KeyAuthorizationKeyProvider.KeyOpType opType)
KeyAuthorizationKeyProvider.KeyACLshasAccessToKey in interface KeyAuthorizationKeyProvider.KeyACLskeyName - name of the key ACLugi - User's UserGroupInformationopType - Operation Typepublic boolean isACLPresent(String keyName, KeyAuthorizationKeyProvider.KeyOpType opType)
isACLPresent in interface KeyAuthorizationKeyProvider.KeyACLskeyName - ACL nameopType - Operation TypeCopyright © 2018 CERN. All Rights Reserved.