if(tokenStrForm != null) { transport = authBridge.createClientTransport(null, store.getHost(), "DIGEST", tokenStrForm, transport, MetaStoreUtils.getMetaStoreSaslProperties(conf)); String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); transport = authBridge.createClientTransport( principalConfig, store.getHost(), "KERBEROS", null, transport, MetaStoreUtils.getMetaStoreSaslProperties(conf));
public Client createClientWithConf(String authMethod) { UserGroupInformation ugi; try { ugi = UserGroupInformation.getLoginUser(); } catch(IOException e) { throw new IllegalStateException("Unable to get current login user: " + e, e); } if (loginUserHasCurrentAuthMethod(ugi, authMethod)) { LOG.debug("Not setting UGI conf as passed-in authMethod of " + authMethod + " = current."); return new Client(); } else { LOG.debug("Setting UGI conf as passed-in authMethod of " + authMethod + " != current."); Configuration conf = new Configuration(); conf.set(HADOOP_SECURITY_AUTHENTICATION, authMethod); UserGroupInformation.setConfiguration(conf); return new Client(); } }
if(tokenStrForm != null) { transport = authBridge.createClientTransport(null, store.getHost(), "DIGEST", tokenStrForm, transport, MetaStoreUtils.getMetaStoreSaslProperties(conf)); String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); transport = authBridge.createClientTransport( principalConfig, store.getHost(), "KERBEROS", null, transport, MetaStoreUtils.getMetaStoreSaslProperties(conf));
transport = authBridge.createClientTransport(null, store.getHost(), "DIGEST", tokenStrForm, transport); } else { String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); transport = authBridge.createClientTransport( principalConfig, store.getHost(), "KERBEROS", null, transport);
transport = authBridge.createClientTransport(null, store.getHost(), "DIGEST", tokenStrForm, transport); } else { String principalConfig = conf.getVar(HiveConf.ConfVars.METASTORE_KERBEROS_PRINCIPAL); transport = authBridge.createClientTransport( principalConfig, store.getHost(), "KERBEROS", null, transport);
public static TTransport getKerberosTransport(String principal, String host, TTransport underlyingTransport, Map<String, String> saslProps, boolean assumeSubject) throws SaslException { try { String[] names = principal.split("[/@]"); if (names.length != 3) { throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); } if (assumeSubject) { return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); } else { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); return authBridge.createClientTransport(principal, host, "KERBEROS", null, underlyingTransport, saslProps); } } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getKerberosTransport(String principal, String host, TTransport underlyingTransport, Map<String, String> saslProps, boolean assumeSubject) throws SaslException { try { String[] names = principal.split("[/@]"); if (names.length != 3) { throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); } if (assumeSubject) { return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); } else { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); return authBridge.createClientTransport(principal, host, "KERBEROS", null, underlyingTransport, saslProps); } } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getKerberosTransport(String principal, String host, TTransport underlyingTransport, Map<String, String> saslProps, boolean assumeSubject) throws SaslException { try { String[] names = principal.split("[/@]"); if (names.length != 3) { throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); } if (assumeSubject) { return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); } else { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); return authBridge.createClientTransport(principal, host, "KERBEROS", null, underlyingTransport, saslProps); } } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getKerberosTransport(String principal, String host, TTransport underlyingTransport, Map<String, String> saslProps, boolean assumeSubject) throws SaslException { try { String[] names = principal.split("[/@]"); if (names.length != 3) { throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); } if (assumeSubject) { return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); } else { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); return authBridge.createClientTransport(principal, host, "KERBEROS", null, underlyingTransport, saslProps); } } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public Client createClientWithConf(String authMethod) { UserGroupInformation ugi; try { ugi = UserGroupInformation.getLoginUser(); } catch(IOException e) { throw new IllegalStateException("Unable to get current login user: " + e, e); } if (loginUserHasCurrentAuthMethod(ugi, authMethod)) { LOG.debug("Not setting UGI conf as passed-in authMethod of " + authMethod + " = current."); return new Client(); } else { LOG.debug("Setting UGI conf as passed-in authMethod of " + authMethod + " != current."); Configuration conf = new Configuration(); conf.set(HADOOP_SECURITY_AUTHENTICATION, authMethod); UserGroupInformation.setConfiguration(conf); return new Client(); } }
public Client createClient() { return new Client(); }
public Client createClient() { return new Client(); }
public static TTransport getTokenTransport(String tokenStr, String host, TTransport underlyingTransport, Map<String, String> saslProps) throws SaslException { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); try { return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, saslProps); } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getTokenTransport(String tokenStr, String host, TTransport underlyingTransport, Map<String, String> saslProps) throws SaslException { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); try { return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, saslProps); } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getTokenTransport(String tokenStr, String host, TTransport underlyingTransport, Map<String, String> saslProps) throws SaslException { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); try { return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, saslProps); } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }
public static TTransport getTokenTransport(String tokenStr, String host, TTransport underlyingTransport, Map<String, String> saslProps) throws SaslException { HadoopThriftAuthBridge.Client authBridge = ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); try { return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, saslProps); } catch (IOException e) { throw new SaslException("Failed to open client transport", e); } }