Skip to content

Commit

Permalink
fix(system): hawtio.auth should be better abbrev than hawtio.ae
Browse files Browse the repository at this point in the history
  • Loading branch information
tadayosi committed Dec 14, 2023
1 parent 9ba8aa8 commit 181dc1c
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AuthenticationConfiguration {
/**
* Shorthand for {@link AuthenticationConfiguration#AUTHENTICATION_ENABLED}.
*/
public static final String AE = "ae";
public static final String AUTH = "auth";

/**
* JAAS realm used to authenticate users.
Expand Down Expand Up @@ -71,7 +71,7 @@ public class AuthenticationConfiguration {

// JVM system properties
public static final String HAWTIO_AUTHENTICATION_ENABLED = "hawtio." + AUTHENTICATION_ENABLED;
public static final String HAWTIO_AE = "hawtio." + AE;
public static final String HAWTIO_AUTH = "hawtio." + AUTH;
public static final String HAWTIO_REALM = "hawtio." + REALM;
public static final String HAWTIO_ROLES = "hawtio." + ROLES;
public static final String HAWTIO_ROLE_PRINCIPAL_CLASSES = "hawtio." + ROLE_PRINCIPAL_CLASSES;
Expand Down Expand Up @@ -106,11 +106,11 @@ private AuthenticationConfiguration(ServletContext servletContext) {
throw new RuntimeException("Hawtio config manager not found, cannot proceed Hawtio configuration");
}

// AE takes precedence over AUTHENTICATION_ENABLED because AE is mostly set manually by the user
// AUTH takes precedence over AUTHENTICATION_ENABLED because AUTH is mostly set manually by the user
// whereas AUTHENTICATION_ENABLED may be predefined in a distribution.
String ae = System.getProperty(HAWTIO_AE);
if (ae != null) {
System.setProperty(HAWTIO_AUTHENTICATION_ENABLED, ae);
String auth = System.getProperty(HAWTIO_AUTH);
if (auth != null) {
System.setProperty(HAWTIO_AUTHENTICATION_ENABLED, auth);
}

this.enabled = config.getBoolean(AUTHENTICATION_ENABLED, true);
Expand Down

0 comments on commit 181dc1c

Please sign in to comment.