public class SecureTestUtil extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SecureTestUtil.AccessTestAction
An AccessTestAction performs an action that will be examined to confirm
the results conform to expected access rights.
|
static class |
SecureTestUtil.MasterSyncObserver |
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
LOG |
private static int |
WAIT_TIME |
Constructor and Description |
---|
SecureTestUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkGlobalPerms(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.security.access.Permission.Action... actions) |
private static void |
checkPermissions(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.security.access.Permission... perms) |
static void |
checkTablePerms(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.security.access.Permission... perms) |
static void |
checkTablePerms(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] column,
org.apache.hadoop.hbase.security.access.Permission.Action... actions) |
static void |
configureSuperuser(org.apache.hadoop.conf.Configuration conf) |
static String |
convertToNamespace(String namespace) |
static void |
createNamespace(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.NamespaceDescriptor nsDesc) |
static void |
createTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.client.Admin admin,
org.apache.hadoop.hbase.client.TableDescriptor htd) |
static void |
createTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.client.Admin admin,
org.apache.hadoop.hbase.client.TableDescriptor htd,
byte[][] splitKeys) |
static void |
createTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.client.TableDescriptor htd) |
static void |
createTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.client.TableDescriptor htd,
byte[][] splitKeys) |
static org.apache.hadoop.hbase.client.Table |
createTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.TableName tableName,
byte[][] families) |
static void |
deleteNamespace(HBaseTestingUtility testUtil,
String namespace) |
static void |
deleteTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.client.Admin admin,
org.apache.hadoop.hbase.TableName tableName) |
static void |
deleteTable(HBaseTestingUtility testUtil,
org.apache.hadoop.hbase.TableName tableName) |
static void |
enableSecurity(org.apache.hadoop.conf.Configuration conf) |
private static List<org.apache.hadoop.hbase.security.access.AccessController> |
getAccessControllers(MiniHBaseCluster cluster) |
private static Map<org.apache.hadoop.hbase.security.access.AccessController,Long> |
getAuthManagerMTimes(MiniHBaseCluster cluster) |
static void |
grantGlobal(HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions globally to the given user.
|
static void |
grantGlobal(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions globally to the given user.
|
static void |
grantGlobalUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant global permissions to the given user using AccessControlClient.
|
static void |
grantOnNamespace(HBaseTestingUtility util,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a namespace to the given user.
|
static void |
grantOnNamespace(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a namespace to the given user.
|
static void |
grantOnNamespaceUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a namespace to the given user using AccessControl Client.
|
static void |
grantOnTable(HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a table to the given user.
|
static void |
grantOnTable(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a table to the given user.
|
static void |
grantOnTableUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Grant permissions on a table to the given user using AccessControlClient.
|
static void |
revokeFromNamespace(HBaseTestingUtility util,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a namespace from the given user.
|
static void |
revokeFromNamespace(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a namespace from the given user.
|
static void |
revokeFromNamespaceUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
String namespace,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a namespace from the given user using AccessControl Client.
|
static void |
revokeFromTable(HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a table from the given user.
|
static void |
revokeFromTable(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a table from the given user.
|
static void |
revokeFromTableUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
org.apache.hadoop.hbase.TableName table,
byte[] family,
byte[] qualifier,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions on a table from the given user using AccessControlClient.
|
static void |
revokeGlobal(HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions globally from the given user.
|
static void |
revokeGlobal(org.apache.hadoop.hbase.security.User caller,
HBaseTestingUtility util,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke permissions globally from the given user.
|
static void |
revokeGlobalUsingAccessControlClient(HBaseTestingUtility util,
org.apache.hadoop.hbase.client.Connection connection,
String user,
org.apache.hadoop.hbase.security.access.Permission.Action... actions)
Revoke global permissions from the given user using AccessControlClient.
|
private static void |
updateACLs(HBaseTestingUtility util,
Callable c) |
static void |
verifyAllowed(SecureTestUtil.AccessTestAction action,
org.apache.hadoop.hbase.security.User... users)
This fails only in case of ADE or empty list for any of the users.
|
static void |
verifyAllowed(org.apache.hadoop.hbase.security.User user,
SecureTestUtil.AccessTestAction... actions)
This fails only in case of ADE or empty list for any of the actions.
|
static void |
verifyAllowed(org.apache.hadoop.hbase.security.User user,
SecureTestUtil.AccessTestAction action,
int count) |
static void |
verifyConfiguration(org.apache.hadoop.conf.Configuration conf) |
static void |
verifyDenied(SecureTestUtil.AccessTestAction action,
org.apache.hadoop.hbase.security.User... users)
This passes only in case of ADE for all users.
|
static void |
verifyDenied(org.apache.hadoop.hbase.security.User user,
SecureTestUtil.AccessTestAction... actions)
This passes only in case of ADE for all actions.
|
static void |
verifyIfEmptyList(SecureTestUtil.AccessTestAction action,
org.apache.hadoop.hbase.security.User... users)
This passes only in case of empty list for all users.
|
static void |
verifyIfNull(SecureTestUtil.AccessTestAction action,
org.apache.hadoop.hbase.security.User... users)
This passes only in case of null for all users.
|
private static final org.slf4j.Logger LOG
private static final int WAIT_TIME
public SecureTestUtil()
public static void configureSuperuser(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public static void enableSecurity(org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public static void verifyConfiguration(org.apache.hadoop.conf.Configuration conf)
public static void verifyAllowed(org.apache.hadoop.hbase.security.User user, SecureTestUtil.AccessTestAction... actions) throws Exception
Exception
public static void verifyAllowed(SecureTestUtil.AccessTestAction action, org.apache.hadoop.hbase.security.User... users) throws Exception
Exception
public static void verifyAllowed(org.apache.hadoop.hbase.security.User user, SecureTestUtil.AccessTestAction action, int count) throws Exception
Exception
public static void verifyDenied(SecureTestUtil.AccessTestAction action, org.apache.hadoop.hbase.security.User... users) throws Exception
Exception
public static void verifyIfEmptyList(SecureTestUtil.AccessTestAction action, org.apache.hadoop.hbase.security.User... users) throws Exception
Exception
public static void verifyIfNull(SecureTestUtil.AccessTestAction action, org.apache.hadoop.hbase.security.User... users) throws Exception
Exception
public static void verifyDenied(org.apache.hadoop.hbase.security.User user, SecureTestUtil.AccessTestAction... actions) throws Exception
Exception
private static List<org.apache.hadoop.hbase.security.access.AccessController> getAccessControllers(MiniHBaseCluster cluster)
private static Map<org.apache.hadoop.hbase.security.access.AccessController,Long> getAuthManagerMTimes(MiniHBaseCluster cluster)
private static void updateACLs(HBaseTestingUtility util, Callable c) throws Exception
Exception
public static void grantGlobal(HBaseTestingUtility util, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantGlobal(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeGlobal(HBaseTestingUtility util, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeGlobal(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnNamespace(HBaseTestingUtility util, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnNamespace(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnNamespaceUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromNamespaceUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromNamespace(HBaseTestingUtility util, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromNamespace(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, String namespace, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnTable(HBaseTestingUtility util, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnTable(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantOnTableUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void grantGlobalUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromTable(HBaseTestingUtility util, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromTable(org.apache.hadoop.hbase.security.User caller, HBaseTestingUtility util, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeFromTableUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] qualifier, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static void revokeGlobalUsingAccessControlClient(HBaseTestingUtility util, org.apache.hadoop.hbase.client.Connection connection, String user, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws Exception
Exception
public static org.apache.hadoop.hbase.client.Table createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.TableName tableName, byte[][] families) throws Exception
Exception
public static void createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.client.TableDescriptor htd) throws Exception
Exception
public static void createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.client.TableDescriptor htd, byte[][] splitKeys) throws Exception
Exception
public static void createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.TableDescriptor htd) throws Exception
Exception
public static void createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.client.TableDescriptor htd, byte[][] splitKeys) throws Exception
Exception
public static void deleteTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.TableName tableName) throws Exception
Exception
public static void createNamespace(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.NamespaceDescriptor nsDesc) throws Exception
Exception
public static void deleteNamespace(HBaseTestingUtility testUtil, String namespace) throws Exception
Exception
public static void deleteTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.client.Admin admin, org.apache.hadoop.hbase.TableName tableName) throws Exception
Exception
public static String convertToNamespace(String namespace)
public static void checkGlobalPerms(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws IOException
IOException
public static void checkTablePerms(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.TableName table, byte[] family, byte[] column, org.apache.hadoop.hbase.security.access.Permission.Action... actions) throws IOException
IOException
public static void checkTablePerms(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.security.access.Permission... perms) throws IOException
IOException
private static void checkPermissions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.security.access.Permission... perms) throws IOException
IOException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.