use of com.facebook.presto.spi.security.PasswordAuthenticator in project presto by prestodb.
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<>(loadProperties(configFileLocation));
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 authenticator = factory.create(ImmutableMap.copyOf(properties));
this.authenticator.set(requireNonNull(authenticator, "authenticator is null"));
log.info("-- Loaded password authenticator %s --", name);
}
Aggregations