public class ProxiedFileSystemUtils extends Object
FileSystem objects while proxied as another user. This class requires access to a
user with secure impersonation priveleges. The FileSystem objects returned will have full permissions to
access any operations on behalf of the specified user.
As a user, use methods in ProxiedFileSystemCache to generate the proxied file systems.
| Modifier and Type | Class and Description |
|---|---|
static class |
ProxiedFileSystemUtils.AuthType |
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_TOKEN_PATH |
static String |
AUTH_TYPE_KEY |
| Constructor and Description |
|---|
ProxiedFileSystemUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canProxyAs(String userNameToProxyAs,
String superUserName,
org.apache.hadoop.fs.Path superUserKeytabLocation)
Returns true if superUserName can proxy as userNameToProxyAs using the specified superUserKeytabLocation, false
otherwise.
|
static com.google.common.base.Optional<org.apache.hadoop.security.token.Token<?>> |
getTokenFromSeqFile(String userNameKey,
org.apache.hadoop.fs.Path tokenFilePath)
Retrives a
Token from a given sequence file for a specified user. |
public static final String AUTH_TYPE_KEY
public static final String AUTH_TOKEN_PATH
public static boolean canProxyAs(String userNameToProxyAs, String superUserName, org.apache.hadoop.fs.Path superUserKeytabLocation)
public static com.google.common.base.Optional<org.apache.hadoop.security.token.Token<?>> getTokenFromSeqFile(String userNameKey, org.apache.hadoop.fs.Path tokenFilePath) throws IOException
Token from a given sequence file for a specified user. The sequence file should contain a list
of key, value pairs where each key corresponds to a user and each value corresponds to a Token for that
user.userNameKey - The name of the user to retrieve a Token fortokenFilePath - The path to the sequence file containing the TokensToken for the given user nameIOException