use of io.prestosql.spi.security.PasswordAuthenticator in project hetu-core by openlookeng.
the class PasswordAuthenticatorManager method loadPasswordAuthenticator.
public void loadPasswordAuthenticator() throws Exception {
if (!required.get()) {
return;
}
File configFileLocation = CONFIG_FILE.getAbsoluteFile();
Map<String, String> properties = new HashMap<>(loadPropertiesFrom(configFileLocation.getPath()));
String name = properties.remove(NAME_PROPERTY);
checkArgument(!isNullOrEmpty(name), "Password authenticator configuration %s does not contain %s", configFileLocation, NAME_PROPERTY);
log.info("-- Loading password authenticator --");
PasswordAuthenticatorFactory factory = factories.get(name);
checkState(factory != null, "Password authenticator %s is not registered", name);
PasswordAuthenticator tmpAuthenticator = factory.create(ImmutableMap.copyOf(properties));
this.authenticator.set(requireNonNull(tmpAuthenticator, "authenticator is null"));
log.info("-- Loaded password authenticator %s --", name);
}
Aggregations