Class BuildStrategyCredentialsProperty

java.lang.Object
hudson.model.AbstractDescribableImpl<com.cloudbees.hudson.plugins.folder.AbstractFolderProperty<?>>
com.cloudbees.hudson.plugins.folder.AbstractFolderProperty<com.cloudbees.hudson.plugins.folder.AbstractFolder<?>>
com.igalg.jenkins.plugins.multibranch.buildstrategy.BuildStrategyCredentialsProperty
All Implemented Interfaces:
ExtensionPoint, Describable<com.cloudbees.hudson.plugins.folder.AbstractFolderProperty<?>>, ReconfigurableDescribable<com.cloudbees.hudson.plugins.folder.AbstractFolderProperty<?>>

public class BuildStrategyCredentialsProperty extends com.cloudbees.hudson.plugins.folder.AbstractFolderProperty<com.cloudbees.hudson.plugins.folder.AbstractFolder<?>>
Per-project override for the credential used by branch build strategies when they perform Git protocol operations (fetch, log) during branch scan.

The strategies always talk Git, not REST. When the SCM source credential is a REST-only API token (for example an Atlassian API scoped token with an email username), Git HTTPS auth fails. Setting this property lets the strategies use a separate, Git-compatible credential without changing the credential used for branch discovery.

The property is only read from the multibranch project itself; it is never inherited from enclosing folders. The credential is only sent when every remote of the branch's SCM is on one of the configured hosts, so changing the project's repository URL to another host cannot redirect the credential there. Several hosts can be listed for providers that use separate hosts for HTTPS and SSH, for example bitbucket.org and ssh.bitbucket.org.

  • Constructor Details

    • BuildStrategyCredentialsProperty

      @DataBoundConstructor public BuildStrategyCredentialsProperty(String credentialsId, String hosts)
  • Method Details

    • getCredentialsId

      @CheckForNull public String getCredentialsId()
      Returns:
      the credential ID, or null when blank (including blank values loaded from config.xml)
    • getHosts

      @CheckForNull public String getHosts()
      Returns:
      the Git hosts the credential may be sent to, lower-cased and comma-separated, or null when blank