Package org.apache.hadoop.hive.ql.security

Examples of org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator


    SessionState.start(conf);
    Mockito.when(db.getTable(TABLE, false)).thenReturn(table);
    Mockito.when(db.getPartition(table, new HashMap<String, String>(), false))
    .thenReturn(partition);

    HadoopDefaultAuthenticator auth = new HadoopDefaultAuthenticator();
    auth.setConf(conf);
    currentUser = auth.getUserName();

  }
View Full Code Here


    analyzer = new DDLSemanticAnalyzer(conf, db);
    SessionState.start(conf);
    Mockito.when(db.getTable(DB, TABLE, false)).thenReturn(table);
    Mockito.when(db.getPartition(table, new HashMap<String, String>(), false))
      .thenReturn(partition);
    HadoopDefaultAuthenticator auth = new HadoopDefaultAuthenticator();
    auth.setConf(conf);
    currentUser = auth.getUserName();

  }
View Full Code Here

  @Test
  public void checkConfigProcessing() throws HiveAuthzPluginException {
    HiveConf processedConf = new HiveConf();

    SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null,
        processedConf, new HadoopDefaultAuthenticator());
    accessController.applyAuthorizationConfigPolicy(processedConf);

    // check that unsafe commands have been disabled
    assertEquals("only set command should be allowed",
        processedConf.getVar(ConfVars.HIVE_SECURITY_COMMAND_WHITELIST), "set");
View Full Code Here

    processedConf.setVar(HiveConf.ConfVars.HIVE_AUTHORIZATION_SQL_STD_AUTH_CONFIG_WHITELIST,
        Joiner.on(",").join(settableParams));


    SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null,
        processedConf, new HadoopDefaultAuthenticator());
    accessController.applyAuthorizationConfigPolicy(processedConf);
    verifyParamSettability(settableParams, processedConf);


  }
View Full Code Here

   */
  @Test
  public void testConfigProcessing() throws HiveAuthzPluginException {
    HiveConf processedConf = new HiveConf();
    SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null,
        processedConf, new HadoopDefaultAuthenticator(), getCLISessionCtx()
        );
    accessController.applyAuthorizationConfigPolicy(processedConf);

    // check that hook to disable transforms has not been added
    assertFalse("Check for transform query disabling hook",
View Full Code Here

    HiveConf processedConf = new HiveConf();
    processedConf.setBoolVar(ConfVars.HIVE_AUTHORIZATION_ENABLED, true);
    try {
      HiveAuthorizerFactory authorizerFactory = new SQLStdHiveAuthorizerFactory();
      HiveAuthorizer authorizer = authorizerFactory.createHiveAuthorizer(null, processedConf,
          new HadoopDefaultAuthenticator(), getCLISessionCtx());
      fail("Exception expected");
    } catch (HiveAuthzPluginException e) {
      assertTrue(e.getMessage().contains(
          "SQL standards based authorization should not be enabled from hive cli"));
    }
View Full Code Here

  @Test
  public void testConfigProcessing() throws HiveAuthzPluginException, SecurityException,
      IllegalArgumentException, NoSuchFieldException, IllegalAccessException {
    HiveConf processedConf = newAuthEnabledConf();
    SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null,
        processedConf, new HadoopDefaultAuthenticator(), getHS2SessionCtx());
    accessController.applyAuthorizationConfigPolicy(processedConf);

    // check that hook to disable transforms has been added
    assertTrue("Check for transform query disabling hook",
        processedConf.getVar(ConfVars.PREEXECHOOKS).contains(DisallowTransformHook.class.getName()));
View Full Code Here

    HiveConf processedConf = newAuthEnabledConf();
    processedConf.setVar(whiteListParam,
        Joiner.on("|").join(paramRegexes));

    SQLStdHiveAccessController accessController = new SQLStdHiveAccessController(null,
        processedConf, new HadoopDefaultAuthenticator(), getHS2SessionCtx());
    accessController.applyAuthorizationConfigPolicy(processedConf);

    verifyParamSettability(settableParams, processedConf);
  }
View Full Code Here

    analyzer = new DDLSemanticAnalyzer(conf, db);
    Mockito.when(db.getTable(DB, TABLE, false)).thenReturn(table);
    Mockito.when(db.getTable(TABLE_QNAME, false)).thenReturn(table);
    Mockito.when(db.getPartition(table, new HashMap<String, String>(), false))
      .thenReturn(partition);
    HadoopDefaultAuthenticator auth = new HadoopDefaultAuthenticator();
    auth.setConf(conf);
    currentUser = auth.getUserName();
    DummyHiveAuthorizationTaskFactoryImpl.reset();

  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hive.ql.security.HadoopDefaultAuthenticator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.