public class StorageBasedAuthorizationProvider extends HiveAuthorizationProviderBase implements HiveMetastoreAuthorizationProvider
HiveAuthorizationProviderBase.HiveProxy
authenticator, hive_db, LOG
Constructor and Description |
---|
StorageBasedAuthorizationProvider() |
Modifier and Type | Method and Description |
---|---|
void |
authorize(Database db,
Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization privileges against a database object.
|
void |
authorize(Partition part,
Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization privileges against a hive partition object.
|
void |
authorize(Path path,
Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization privileges against a path.
|
void |
authorize(Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization user level privileges.
|
void |
authorize(Table table,
Partition part,
java.util.List<java.lang.String> columns,
Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization privileges against a list of columns.
|
void |
authorize(Table table,
Privilege[] readRequiredPriv,
Privilege[] writeRequiredPriv)
Authorization privileges against a hive table object.
|
protected void |
checkPermissions(Configuration conf,
Path path,
java.util.EnumSet<FsAction> actions)
Checks the permissions for the given path and current user on Hadoop FS.
|
protected static void |
checkPermissions(FileSystem fs,
Path path,
java.util.EnumSet<FsAction> actions,
java.lang.String user,
java.util.List<java.lang.String> groups)
Checks the permissions for the given path and current user on Hadoop FS.
|
protected Path |
getDbLocation(Database db) |
protected FsAction |
getFsAction(Privilege priv)
Given a privilege, return what FsActions are required
|
protected java.util.EnumSet<FsAction> |
getFsActions(Privilege[] privs)
Given a Privilege[], find out what all FsActions are required
|
void |
init(Configuration conf) |
void |
setMetaStoreHandler(HiveMetaStore.HMSHandler handler)
Allows invoker of HiveMetaStoreAuthorizationProvider to send in a
hive metastore handler that can be used to make calls to test
whether or not authorizations can/will succeed.
|
getAuthenticator, getConf, setAuthenticator, setConf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAuthenticator, setAuthenticator
public void init(Configuration conf) throws HiveException
init
in interface HiveAuthorizationProvider
HiveException
public void authorize(Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
HiveAuthorizationProvider
authorize
in interface HiveAuthorizationProvider
readRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
public void authorize(Database db, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
HiveAuthorizationProvider
authorize
in interface HiveAuthorizationProvider
db
- databasereadRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
public void authorize(Table table, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
HiveAuthorizationProvider
authorize
in interface HiveAuthorizationProvider
table
- table objectreadRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
public void authorize(Partition part, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
HiveAuthorizationProvider
authorize
in interface HiveAuthorizationProvider
part
- partition objectreadRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
public void authorize(Table table, Partition part, java.util.List<java.lang.String> columns, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
HiveAuthorizationProvider
authorize
in interface HiveAuthorizationProvider
table
- table objectpart
- partition objectcolumns
- a list of columnsreadRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
public void setMetaStoreHandler(HiveMetaStore.HMSHandler handler)
HiveMetastoreAuthorizationProvider
setMetaStoreHandler
in interface HiveMetastoreAuthorizationProvider
protected FsAction getFsAction(Privilege priv)
protected java.util.EnumSet<FsAction> getFsActions(Privilege[] privs)
public void authorize(Path path, Privilege[] readRequiredPriv, Privilege[] writeRequiredPriv) throws HiveException, AuthorizationException
authorize
in interface HiveAuthorizationProvider
path
- a filesystem pathreadRequiredPriv
- a list of privileges needed for inputs.writeRequiredPriv
- a list of privileges needed for outputs.HiveException
AuthorizationException
protected void checkPermissions(Configuration conf, Path path, java.util.EnumSet<FsAction> actions) throws java.io.IOException, javax.security.auth.login.LoginException
java.io.IOException
javax.security.auth.login.LoginException
protected static void checkPermissions(FileSystem fs, Path path, java.util.EnumSet<FsAction> actions, java.lang.String user, java.util.List<java.lang.String> groups) throws java.io.IOException, java.security.AccessControlException
java.io.IOException
java.security.AccessControlException
protected Path getDbLocation(Database db) throws HiveException
HiveException
Copyright © 2012 The Apache Software Foundation