Class SauceCredentials

java.lang.Object
com.cloudbees.plugins.credentials.BaseCredentials
com.cloudbees.plugins.credentials.impl.BaseStandardCredentials
hudson.plugins.sauce_ondemand.credentials.SauceCredentials
All Implemented Interfaces:
com.cloudbees.plugins.credentials.common.IdCredentials, com.cloudbees.plugins.credentials.common.PasswordCredentials, com.cloudbees.plugins.credentials.common.StandardCredentials, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials, com.cloudbees.plugins.credentials.common.UsernameCredentials, com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials, com.cloudbees.plugins.credentials.Credentials, ExtensionPoint, Describable<com.cloudbees.plugins.credentials.Credentials>, Serializable

public class SauceCredentials extends com.cloudbees.plugins.credentials.impl.BaseStandardCredentials implements com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials
See Also:
  • Field Details

    • username

      protected final String username
      The username.
    • apiKey

      protected final Secret apiKey
      The Password/apikey
    • restEndpoint

      protected final String restEndpoint
      The data center endpoint
    • shortLivedConfig

      protected SauceCredentials.ShortLivedConfig shortLivedConfig
    • DOMAIN_REQUIREMENT

      public static final com.cloudbees.plugins.credentials.domains.DomainRequirement DOMAIN_REQUIREMENT
  • Constructor Details

    • SauceCredentials

      @DataBoundConstructor public SauceCredentials(@CheckForNull com.cloudbees.plugins.credentials.CredentialsScope scope, @CheckForNull String id, @NonNull String username, @NonNull String apiKey, @NonNull String restEndpoint, @CheckForNull String description)
  • Method Details

    • getShortLivedConfig

      public SauceCredentials.ShortLivedConfig getShortLivedConfig()
    • setShortLivedConfig

      @DataBoundSetter public void setShortLivedConfig(SauceCredentials.ShortLivedConfig shortLivedConfig)
    • getCredentials

      public static SauceCredentials getCredentials(AbstractProject project)
    • getCredentials

      public static SauceCredentials getCredentials(AbstractBuild build)
    • getPassword

      @NonNull public Secret getPassword()
      Specified by:
      getPassword in interface com.cloudbees.plugins.credentials.common.PasswordCredentials
    • getApiKey

      @NonNull public Secret getApiKey()
    • getRestEndpoint

      @NonNull public String getRestEndpoint()
    • getRestEndpointName

      @NonNull public String getRestEndpointName()
    • getRegion

      @NonNull public String getRegion()
    • getUsername

      @NonNull public String getUsername()
      Specified by:
      getUsername in interface com.cloudbees.plugins.credentials.common.UsernameCredentials
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSauceCredentials

      public static SauceCredentials getSauceCredentials(AbstractBuild build, SauceOnDemandBuildWrapper wrapper)
    • getSauceREST

      public JenkinsSauceREST getSauceREST(ProxyConfiguration proxy)
    • migrateToCredentials

      public static String migrateToCredentials(String username, String accessKey, String restEndpoint, String migratedFrom) throws InterruptedException, IOException
      Throws:
      InterruptedException
      IOException
    • all

      @Deprecated public static List<SauceCredentials> all(ItemGroup context)
      Deprecated.
      no longer used by the plugin; UI code must use fillCredentialsIdItems(Item, String) so that the caller's permissions are honoured.
    • all

      public static List<SauceCredentials> all(Item context)
    • fillCredentialsIdItems

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static ListBoxModel fillCredentialsIdItems(@CheckForNull Item item, @CheckForNull String currentValue)
      Fills a credentials dropdown with the Sauce credentials the current user is allowed to see, following the credentials plugin consumer guide (SECURITY-3770):
      • outside of an item (global configuration) only administrators get the list, looked up against the Jenkins root;
      • inside an item only users with Item.EXTENDED_READ (implied by Item.CONFIGURE) or CredentialsProvider.USE_ITEM get the list, looked up in the item's context with the authentication the item's builds run as, which excludes SYSTEM-scoped credentials;
      • everybody else only gets the currently selected value, so the form still round-trips.
      Build-time lookups must keep using getCredentialsById(Item, String).
      Parameters:
      item - the ancestor item, or null for the global configuration
      currentValue - the currently selected credentials id, may be null
      Returns:
      the model for the dropdown
    • getCredentialsById

      public static SauceCredentials getCredentialsById(Item context, String id)
    • getHMAC

      public String getHMAC(String jobId)
      Creates a HMAC token which is used as part of the Javascript inclusion that embeds the Sauce results
      Parameters:
      jobId - the Sauce job id
      Returns:
      the HMAC token