java.lang.Object
org.jenkinsci.plugins.ParameterizedRemoteTrigger.utils.Base64Utils

public class Base64Utils extends Object
  • Field Details

  • Constructor Details

    • Base64Utils

      public Base64Utils()
  • Method Details

    • encode

      public static String encode(String input) throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • generateAuthorizationHeaderValue

      @NonNull public static String generateAuthorizationHeaderValue(String authType, String user, String password, BuildContext context, boolean applyMacro) throws IOException
      Creates the value for an Authorization header consisting of:
      "authType base64Encoded(user:password)"
      e.g. "Basic zhwef9tz33ergwerg4394zh370345zh=="
      Parameters:
      authType - the authorization type.
      user - the user name.
      password - the user password.
      context - the context of this Builder/BuildStep.
      applyMacro - boolean to control if macro replacements occur
      Returns:
      the base64 encoded authorization.
      Throws:
      IOException - if there is a failure while replacing token macros, or if there is a failure while encoding user:password.