Class AuthenticationConfigUtils

java.lang.Object
com.atlassian.secrets.vault.auth.AuthenticationConfigUtils

public class AuthenticationConfigUtils extends Object
Utility class for parsing authentication values from environmental variables or system properties.
Since:
3.2
  • Method Details

    • parseRequiredValueFromEnv

      public static String parseRequiredValueFromEnv(String envVariableName, String sysPropName)
      Parses a value from environmental variables or system properties. The environmental variable has a priority.
      Parameters:
      envVariableName - The name of the environmental variable to read from.
      sysPropName - The name of the system property to read from.
      Returns:
      The value parsed from either the environmental variable or system property.
      Throws:
      SecretStoreException - if the value is not found for the provided environmental variable and system property.
    • parseOptionalValueFromEnv

      public static String parseOptionalValueFromEnv(String envVariableName, String sysPropName)
      Parses an optional value from environmental variables or system properties. The environmental variable has a priority.
      Parameters:
      envVariableName - The name of the environmental variable to read from.
      sysPropName - The name of the system property to read from.
      Returns:
      The value parsed from either the environmental variable or system property. If both absent return null.