2022-06-08 21:13:22 -04:00
|
|
|
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";
|
2023-11-14 14:06:33 -06:00
|
|
|
public static final String NATIVE_AUTHENTICATION_ENFORCE_VALID_EMAIL_ENABLED_CONFIG_PATH = "auth.native.signUp.enforceValidEmail";
|
2022-06-08 21:13:22 -04:00
|
|
|
|
|
|
|
private Boolean _isEnabled = true;
|
2023-11-14 14:06:33 -06:00
|
|
|
private Boolean _isEnforceValidEmailEnabled = true;
|
2022-06-08 21:13:22 -04:00
|
|
|
|
|
|
|
public NativeAuthenticationConfigs(final com.typesafe.config.Config configs) {
|
2023-11-14 14:06:33 -06:00
|
|
|
if (configs.hasPath(NATIVE_AUTHENTICATION_ENABLED_CONFIG_PATH)) {
|
|
|
|
_isEnabled = Boolean.parseBoolean(configs.getValue(NATIVE_AUTHENTICATION_ENABLED_CONFIG_PATH).toString());
|
|
|
|
}
|
|
|
|
if (configs.hasPath(NATIVE_AUTHENTICATION_ENFORCE_VALID_EMAIL_ENABLED_CONFIG_PATH)) {
|
|
|
|
_isEnforceValidEmailEnabled =
|
|
|
|
Boolean.parseBoolean(configs.getValue(NATIVE_AUTHENTICATION_ENFORCE_VALID_EMAIL_ENABLED_CONFIG_PATH).toString());
|
2022-06-08 21:13:22 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isNativeAuthenticationEnabled() {
|
|
|
|
return _isEnabled;
|
|
|
|
}
|
2023-11-14 14:06:33 -06:00
|
|
|
|
|
|
|
public boolean isEnforceValidEmailEnabled() {
|
|
|
|
return _isEnforceValidEmailEnabled;
|
|
|
|
}
|
2022-06-08 21:13:22 -04:00
|
|
|
}
|