Class CredentialsHelper

java.lang.Object
org.jenkinsci.plugins.configfiles.maven.security.CredentialsHelper

public class CredentialsHelper extends Object
  • Method Details

    • resolveCredentials

      public static Map<String,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials> resolveCredentials(Run<?,?> build, List<ServerCredentialMapping> serverCredentialMappings, TaskListener listener)
      Resolves the given serverCredential mappings and returns a map paring serverId to credential
      Parameters:
      build - authentication scope
      serverCredentialMappings - the mappings to be resolved
      listener - the listener
      Returns:
      map of serverId - credential
    • resolveCredentials

      @Deprecated public static Map<String,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials> resolveCredentials(Run<?,?> build, List<ServerCredentialMapping> serverCredentialMappings)
      Deprecated.
    • fillAuthentication

      public static String fillAuthentication(String mavenSettingsContent, Boolean isReplaceAllServerDefinitions, Map<String,com.cloudbees.plugins.credentials.common.StandardUsernameCredentials> mavenServerId2jenkinsCredential, FilePath workDir, List<String> tempFiles) throws Exception
      Parameters:
      mavenSettingsContent - Maven settings.xml (must be valid XML)
      mavenServerId2jenkinsCredential - the credentials to be inserted into the XML (key: Maven serverId, value: Jenkins credentials)
      isReplaceAllServerDefinitions - overwrite all the <server> declarations. If false, only the <server> with an id matching the given mavenServerId2jenkinsCredential are overwritten.
      workDir - folder in which credentials files are created if needed (private key files...)
      tempFiles - temp files created by this method, these files MUST be deleted by the caller
      Returns:
      the updated version of the mavenSettingsContent with the server credentials added
      Throws:
      Exception
    • secretsForMasking

      @NonNull public static List<String> secretsForMasking(Run<?,?> build, List<ServerCredentialMapping> propertiesCredentialMappings)