datahub/datahub-frontend/app/auth/NativeAuthenticationConfigs.java
Aditya Radhakrishnan fdf4e48495
feat(users): add ability to add native users from the UI (#5097)
Co-authored-by: John Joyce <john@acryl.io>
2022-06-08 18:13:22 -07:00

24 lines
678 B
Java

package auth;
/**
* Currently, this config enables or disable native user authentication.
*/
public class NativeAuthenticationConfigs {
public static final String NATIVE_AUTHENTICATION_ENABLED_CONFIG_PATH = "auth.native.enabled";
private Boolean _isEnabled = true;
public NativeAuthenticationConfigs(final com.typesafe.config.Config configs) {
if (configs.hasPath(NATIVE_AUTHENTICATION_ENABLED_CONFIG_PATH)
&& Boolean.FALSE.equals(
Boolean.parseBoolean(configs.getValue(NATIVE_AUTHENTICATION_ENABLED_CONFIG_PATH).toString()))) {
_isEnabled = false;
}
}
public boolean isNativeAuthenticationEnabled() {
return _isEnabled;
}
}