org.apache.hadoop.security.authorize.Service Java Examples

The following examples show how to use org.apache.hadoop.security.authorize.Service. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StreamingContainerParent.java    From Bats with Apache License 2.0 5 votes vote down vote up
protected void startRpcServer()
{
  Configuration conf = getConfig();
  LOG.info("Config: " + conf);
  LOG.info("Listener thread count " + listenerThreadCount);
  try {
    server = new RPC.Builder(conf).setProtocol(StreamingContainerUmbilicalProtocol.class).setInstance(this)
        .setBindAddress("0.0.0.0").setPort(0).setNumHandlers(listenerThreadCount).setSecretManager(tokenSecretManager)
        .setVerbose(false).build();

    // Enable service authorization?
    if (conf.getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      //refreshServiceAcls(conf, new MRAMPolicyProvider());
      server.refreshServiceAcl(conf, new PolicyProvider()
      {

        @Override
        public Service[] getServices()
        {
          return (new Service[]{
              new Service(StreamingContainerUmbilicalProtocol.class
                  .getName(), StreamingContainerUmbilicalProtocol.class)
          });
        }

      });
    }

    server.start();
    this.address = NetUtils.getConnectAddress(server);
    LOG.info("Container callback server listening at " + this.address);
  } catch (IOException e) {
    throw new YarnRuntimeException(e);
  }
}
 
Example #2
Source File: TimelinePolicyProvider.java    From hadoop with Apache License 2.0 5 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] {
      new Service(
          YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONHISTORY_PROTOCOL,
          ApplicationHistoryProtocolPB.class)
  };
}
 
Example #3
Source File: TestTokenAuthentication.java    From hbase with Apache License 2.0 5 votes vote down vote up
@Before
public void setUp() throws Exception {
  TEST_UTIL = new HBaseTestingUtility();
  // Override the connection registry to avoid spinning up a mini cluster for the connection below
  // to go through.
  TEST_UTIL.getConfiguration().set(HConstants.CLIENT_CONNECTION_REGISTRY_IMPL_CONF_KEY,
      HConstants.ZK_CONNECTION_REGISTRY_CLASS);
  TEST_UTIL.startMiniZKCluster();
  // register token type for protocol
  SecurityInfo.addInfo(AuthenticationProtos.AuthenticationService.getDescriptor().getName(),
    new SecurityInfo("hbase.test.kerberos.principal",
      AuthenticationProtos.TokenIdentifier.Kind.HBASE_AUTH_TOKEN));
  // security settings only added after startup so that ZK does not require SASL
  Configuration conf = TEST_UTIL.getConfiguration();
  conf.set("hadoop.security.authentication", "kerberos");
  conf.set("hbase.security.authentication", "kerberos");
  conf.setBoolean(HADOOP_SECURITY_AUTHORIZATION, true);
  conf.set(RpcServerFactory.CUSTOM_RPC_SERVER_IMPL_CONF_KEY, rpcServerImpl);
  server = new TokenServer(conf, TEST_UTIL);
  serverThread = new Thread(server);
  Threads.setDaemonThreadRunning(serverThread, "TokenServer:"+server.getServerName().toString());
  // wait for startup
  while (!server.isStarted() && !server.isStopped()) {
    Thread.sleep(10);
  }
  server.rpcServer.refreshAuthManager(conf, new PolicyProvider() {
    @Override
    public Service[] getServices() {
      return new Service [] {
        new Service("security.client.protocol.acl",
          AuthenticationProtos.AuthenticationService.BlockingInterface.class)};
    }
  });
  ZKClusterId.setClusterId(server.getZooKeeper(), clusterId);
  secretManager = (AuthenticationTokenSecretManager)server.getSecretManager();
  while(secretManager.getCurrentKey() == null) {
    Thread.sleep(1);
  }
}
 
Example #4
Source File: TimelinePolicyProvider.java    From big-c with Apache License 2.0 5 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] {
      new Service(
          YarnConfiguration.YARN_SECURITY_SERVICE_AUTHORIZATION_APPLICATIONHISTORY_PROTOCOL,
          ApplicationHistoryProtocolPB.class)
  };
}
 
Example #5
Source File: StreamingContainerParent.java    From attic-apex-core with Apache License 2.0 5 votes vote down vote up
protected void startRpcServer()
{
  Configuration conf = getConfig();
  LOG.info("Config: " + conf);
  LOG.info("Listener thread count " + listenerThreadCount);
  try {
    server = new RPC.Builder(conf).setProtocol(StreamingContainerUmbilicalProtocol.class).setInstance(this)
        .setBindAddress("0.0.0.0").setPort(0).setNumHandlers(listenerThreadCount).setSecretManager(tokenSecretManager)
        .setVerbose(false).build();

    // Enable service authorization?
    if (conf.getBoolean(
        CommonConfigurationKeysPublic.HADOOP_SECURITY_AUTHORIZATION,
        false)) {
      //refreshServiceAcls(conf, new MRAMPolicyProvider());
      server.refreshServiceAcl(conf, new PolicyProvider()
      {

        @Override
        public Service[] getServices()
        {
          return (new Service[]{
              new Service(StreamingContainerUmbilicalProtocol.class
                  .getName(), StreamingContainerUmbilicalProtocol.class)
          });
        }

      });
    }

    server.start();
    this.address = NetUtils.getConnectAddress(server);
    LOG.info("Container callback server listening at " + this.address);
  } catch (IOException e) {
    throw new YarnRuntimeException(e);
  }
}
 
Example #6
Source File: ClientHSPolicyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mrHSServices;
}
 
Example #7
Source File: HDFSPolicyProvider.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return hdfsServices;
}
 
Example #8
Source File: TestRPC.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestProtocol.class) };
}
 
Example #9
Source File: MapReducePolicyProvider.java    From hadoop-gpu with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mapReduceServices;
}
 
Example #10
Source File: TezAMPolicyProvider.java    From tez with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return tezApplicationMasterServices.clone();
}
 
Example #11
Source File: TezAMPolicyProvider.java    From incubator-tez with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return tezApplicationMasterServices;
}
 
Example #12
Source File: HDFSPolicyProvider.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return hdfsServices;
}
 
Example #13
Source File: TestRPC.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestProtocol.class) };
}
 
Example #14
Source File: MapReducePolicyProvider.java    From RDFS with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mapReduceServices;
}
 
Example #15
Source File: HBasePolicyProvider.java    From hbase with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return services;
}
 
Example #16
Source File: TestRPC.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestProtocol.class) };
}
 
Example #17
Source File: HDFSPolicyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return hdfsServices;
}
 
Example #18
Source File: MRAMPolicyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mapReduceApplicationMasterServices;
}
 
Example #19
Source File: SCMPolicyProvider.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@SuppressFBWarnings("EI_EXPOSE_REP")
@Override
public Service[] getServices() {
  return SCM_SERVICES;
}
 
Example #20
Source File: RMPolicyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return resourceManagerServices;
}
 
Example #21
Source File: NMPolicyProvider.java    From big-c with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return nodeManagerServices;
}
 
Example #22
Source File: TestRPC.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return new Service[] { new Service(ACL_CONFIG, TestProtocol.class) };
}
 
Example #23
Source File: HDFSPolicyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return hdfsServices;
}
 
Example #24
Source File: MRAMPolicyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mapReduceApplicationMasterServices;
}
 
Example #25
Source File: ClientHSPolicyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return mrHSServices;
}
 
Example #26
Source File: RMPolicyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return resourceManagerServices;
}
 
Example #27
Source File: NMPolicyProvider.java    From hadoop with Apache License 2.0 4 votes vote down vote up
@Override
public Service[] getServices() {
  return nodeManagerServices;
}
 
Example #28
Source File: OMPolicyProvider.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@SuppressFBWarnings("EI_EXPOSE_REP")
@Override
public Service[] getServices() {
  return OM_SERVICES;
}
 
Example #29
Source File: ReconPolicyProvider.java    From hadoop-ozone with Apache License 2.0 4 votes vote down vote up
@SuppressFBWarnings("EI_EXPOSE_REP")
@Override
public Service[] getServices() {
  return RECON_SERVICES;
}