protected void setWithCredentialProviders(String name, String credentialProviders) throws IOException { this.name = name; this.credentialProviders = credentialProviders; final Configuration conf = new Configuration(); conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders); char[] password = CredentialProviderFactoryShim.getValueFromCredentialProvider(conf, name); if (password == null) { throw new IOException( "No password could be extracted from CredentialProvider(s) with " + name); } setPassword(CharBuffer.wrap(password)); }
for (Property property : Property.values()) { if (property.isSensitive()) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, property.getKey()); if (value != null) {
.getValueFromCredentialProvider(hadoopConf, key); if (value != null) { props.put(key, new String(value));
org.apache.hadoop.conf.Configuration hadoopConf = getHadoopConfiguration(); if (hadoopConf != null) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, key); if (value != null) {
protected void setWithCredentialProviders(String name, String credentialProviders) throws IOException { final Configuration conf = new Configuration(CachedConfiguration.getInstance()); conf.set(CredentialProviderFactoryShim.CREDENTIAL_PROVIDER_PATH, credentialProviders); char[] password = CredentialProviderFactoryShim.getValueFromCredentialProvider(conf, name); if (null == password) { throw new IOException( "No password could be extracted from CredentialProvider(s) with " + name); } setPassword(CharBuffer.wrap(password)); }
@Override public void getProperties(Map<String,String> props, Predicate<String> filter) { parent.getProperties(props, filter); for (Entry<String,String> entry : getXmlConfig()) if (filter.apply(entry.getKey())) props.put(entry.getKey(), entry.getValue()); // CredentialProvider should take precedence over site Configuration hadoopConf = getHadoopConfiguration(); if (null != hadoopConf) { try { for (String key : CredentialProviderFactoryShim.getKeys(hadoopConf)) { if (!Property.isValidPropertyKey(key) || !Property.isSensitive(key)) { continue; } if (filter.apply(key)) { char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, key); if (null != value) { props.put(key, new String(value)); } } } } catch (IOException e) { log.warn("Failed to extract sensitive properties from Hadoop" + " CredentialProvider, falling back to accumulo-site.xml", e); } } }
.getValueFromCredentialProvider(hadoopConf, key); if (null != value) { props.put(key, new String(value));
char[] value = CredentialProviderFactoryShim.getValueFromCredentialProvider(hadoopConf, key); if (null != value) {
try { char[] value = CredentialProviderFactoryShim .getValueFromCredentialProvider(hadoopConf, key); if (null != value) { log.trace("Loaded sensitive value for {} from CredentialProvider", key);