Tabnine Logo
SecurityUtils.getOwnerFromLoginModule
Code IndexAdd Tabnine to your IDE (free)

How to use
getOwnerFromLoginModule
method
in
alluxio.util.SecurityUtils

Best Java code snippets using alluxio.util.SecurityUtils.getOwnerFromLoginModule (Showing top 6 results out of 315)

origin: Alluxio/alluxio

 private CreateUfsFileOptions(AlluxioConfiguration alluxioConf) {
  mOwner = SecurityUtils.getOwnerFromLoginModule(alluxioConf);
  mGroup = SecurityUtils.getGroupFromLoginModule(alluxioConf);
  mMode = ModeUtils.applyFileUMask(Mode.defaults(), alluxioConf
    .get(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK));
  // TODO(chaomin): set permission based on the alluxio file. Not needed for now since the
  // file is always created with default permission.
 }
}
origin: Alluxio/alluxio

 private CompleteUfsFileOptions(AlluxioConfiguration alluxioConf) {
  mOwner = SecurityUtils.getOwnerFromLoginModule(alluxioConf);
  mGroup = SecurityUtils.getGroupFromLoginModule(alluxioConf);
  mMode = ModeUtils.applyFileUMask(Mode.defaults(),
    alluxioConf.get(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK));
  // TODO(chaomin): set permission based on the alluxio file. Not needed for now since the
  // file is always created with default permission.
 }
}
origin: Alluxio/alluxio

/**
 * Tests the {@link SecurityUtils#getOwnerFromLoginModule()} method.
 */
@Test
public void getOwnerFromLoginModule() throws Exception {
 // When security is not enabled, user and group are not set
 mConfiguration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.NOSASL.getAuthName());
 Assert.assertEquals("", SecurityUtils.getOwnerFromLoginModule(mConfiguration));
 // When authentication is enabled, user and group are inferred from login module
 mConfiguration.set(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.SIMPLE.getAuthName());
 mConfiguration.set(PropertyKey.SECURITY_LOGIN_USERNAME, "test_login_user");
 mConfiguration.set(PropertyKey.SECURITY_GROUP_MAPPING_CLASS,
   IdentityUserGroupsMapping.class.getName());
 Assert.assertEquals("test_login_user", SecurityUtils.getOwnerFromLoginModule(mConfiguration));
}
origin: Alluxio/alluxio

private OutStreamOptions(AlluxioConfiguration alluxioConf) {
 mBlockSizeBytes = alluxioConf.getBytes(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT);
 mTtl = Constants.NO_TTL;
 mTtlAction = TtlAction.DELETE;
 mLocationPolicy =
   CommonUtils.createNewClassInstance(alluxioConf.<FileWriteLocationPolicy>getClass(
     PropertyKey.USER_FILE_WRITE_LOCATION_POLICY), new Class[] {AlluxioConfiguration.class},
     new Object[] {alluxioConf});
 mWriteTier = alluxioConf.getInt(PropertyKey.USER_FILE_WRITE_TIER_DEFAULT);
 mWriteType = alluxioConf.getEnum(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.class);
 mOwner = SecurityUtils.getOwnerFromLoginModule(alluxioConf);
 mGroup = SecurityUtils.getGroupFromLoginModule(alluxioConf);
 mMode = ModeUtils.applyFileUMask(Mode.defaults(), alluxioConf
   .get(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_UMASK));
 mMountId = IdUtils.INVALID_MOUNT_ID;
 mReplicationDurable = alluxioConf.getInt(PropertyKey.USER_FILE_REPLICATION_DURABLE);
 mReplicationMax = alluxioConf.getInt(PropertyKey.USER_FILE_REPLICATION_MAX);
 mReplicationMin = alluxioConf.getInt(PropertyKey.USER_FILE_REPLICATION_MIN);
}
origin: Alluxio/alluxio

try (JournalContext context = createJournalContext()) {
 mInodeTree.initializeRoot(
   SecurityUtils.getOwnerFromLoginModule(ServerConfiguration.global()),
   SecurityUtils.getGroupFromLoginModule(ServerConfiguration.global()),
   ModeUtils.applyDirectoryUMask(Mode.createFullAccess(),
String serverOwner = SecurityUtils.getOwnerFromLoginModule(ServerConfiguration.global());
if (SecurityUtils.isSecurityEnabled(ServerConfiguration.global())
  && !root.getOwner().isEmpty() && !root.getOwner().equals(serverOwner)) {
origin: org.alluxio/alluxio-core-server-master

if (root == null) {
 try (JournalContext context = createJournalContext()) {
  mInodeTree.initializeRoot(SecurityUtils.getOwnerFromLoginModule(),
    SecurityUtils.getGroupFromLoginModule(),
    Mode.createFullAccess().applyDirectoryUMask(), context);
 String serverOwner = SecurityUtils.getOwnerFromLoginModule();
 if (SecurityUtils.isSecurityEnabled() && !root.getOwner().isEmpty()
   && !root.getOwner().equals(serverOwner)) {
alluxio.utilSecurityUtilsgetOwnerFromLoginModule

Popular methods of SecurityUtils

  • isSecurityEnabled
    Checks if security is enabled.
  • getGroupFromGrpcClient
  • getGroupFromLoginModule
  • getOwnerFromGrpcClient
  • isAuthenticationEnabled
    Checks if authentication is enabled.
  • getGroupFromThriftClient
  • getOwnerFromThriftClient
  • isAuthorizationEnabled
    Checks if authorization is enabled.

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • addToBackStack (FragmentTransaction)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now