2021-08-20 10:58:07 -07:00
|
|
|
package auth;
|
2021-03-11 13:38:35 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Currently, this config enables or disable custom Java Authentication and Authorization Service
|
|
|
|
* authentication that has traditionally existed in DH.
|
|
|
|
*/
|
|
|
|
public class JAASConfigs {
|
|
|
|
|
2023-12-06 11:02:42 +05:30
|
|
|
public static final String JAAS_ENABLED_CONFIG_PATH = "auth.jaas.enabled";
|
2021-03-11 13:38:35 -08:00
|
|
|
|
2024-10-28 09:05:16 -05:00
|
|
|
private Boolean isEnabled = true;
|
2021-03-11 13:38:35 -08:00
|
|
|
|
2023-12-06 11:02:42 +05:30
|
|
|
public JAASConfigs(final com.typesafe.config.Config configs) {
|
|
|
|
if (configs.hasPath(JAAS_ENABLED_CONFIG_PATH)
|
|
|
|
&& !configs.getBoolean(JAAS_ENABLED_CONFIG_PATH)) {
|
2024-10-28 09:05:16 -05:00
|
|
|
isEnabled = false;
|
2021-03-11 13:38:35 -08:00
|
|
|
}
|
2023-12-06 11:02:42 +05:30
|
|
|
}
|
2021-03-11 13:38:35 -08:00
|
|
|
|
2023-12-06 11:02:42 +05:30
|
|
|
public boolean isJAASEnabled() {
|
2024-10-28 09:05:16 -05:00
|
|
|
return isEnabled;
|
2023-12-06 11:02:42 +05:30
|
|
|
}
|
2021-03-11 13:38:35 -08:00
|
|
|
}
|