Interface BitbucketAuthenticator

All Known Implementing Classes:
BitbucketAccessTokenAuthenticator, BitbucketClientCertificateAuthenticator, BitbucketOAuthAuthenticator, BitbucketUsernamePasswordAuthenticator

public interface BitbucketAuthenticator
Support for various different methods of authenticating with Bitbucket
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The key for Bitbucket instance type as reported in an AuthenticationTokenContext
    static final String
    Purpose value for bitbucket cloud (i.e.
    static final String
    Purpose value for bitbucket server
    static final String
    The key for URL scheme as reported in an AuthenticationTokenContext
    static final String
    The key for bitbucket URL as reported in an AuthenticationTokenContext
  • Method Summary

    Modifier and Type
    Method
    Description
    static jenkins.authentication.tokens.api.AuthenticationTokenContext<BitbucketAuthenticator>
    Generates context that sub-classes can use to determine if they would be able to authenticate against the provided server.
    default void
    configureBuilder(org.apache.http.impl.client.HttpClientBuilder builder)
    Configures an HttpClientBuilder.
    default void
    configureContext(org.apache.http.client.protocol.HttpClientContext context, org.apache.http.HttpHost host)
    Configures an HttpClientContext.
    default void
    configureRequest(org.apache.http.HttpRequest request)
    Configures an HttpRequest.
    default com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
    Provides credentials that can be used for authenticated interactions with SCM.
     
  • Field Details

    • SERVER_URL

      static final String SERVER_URL
      The key for bitbucket URL as reported in an AuthenticationTokenContext
      See Also:
    • SCHEME

      static final String SCHEME
      The key for URL scheme as reported in an AuthenticationTokenContext
      See Also:
    • BITBUCKET_INSTANCE_TYPE

      static final String BITBUCKET_INSTANCE_TYPE
      The key for Bitbucket instance type as reported in an AuthenticationTokenContext
      See Also:
    • BITBUCKET_INSTANCE_TYPE_CLOUD

      static final String BITBUCKET_INSTANCE_TYPE_CLOUD
      Purpose value for bitbucket cloud (i.e. bitbucket.org)
      See Also:
    • BITBUCKET_INSTANCE_TYPE_SERVER

      static final String BITBUCKET_INSTANCE_TYPE_SERVER
      Purpose value for bitbucket server
      See Also:
  • Method Details

    • getId

      String getId()
      Returns:
      id of the credentials used.
    • configureBuilder

      default void configureBuilder(org.apache.http.impl.client.HttpClientBuilder builder)
      Configures an HttpClientBuilder. Override if you need to adjust connection setup.
      Parameters:
      builder - The client builder.
    • configureContext

      default void configureContext(org.apache.http.client.protocol.HttpClientContext context, org.apache.http.HttpHost host)
      Configures an HttpClientContext. Override
      Parameters:
      context - The connection context
      host - host being connected to
    • configureRequest

      default void configureRequest(org.apache.http.HttpRequest request)
      Configures an HttpRequest. Override this if your authentication method needs to set headers on a per-request basis.
      Parameters:
      request - the request.
    • getCredentialsForSCM

      default com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentialsForSCM()
      Provides credentials that can be used for authenticated interactions with SCM.
      Returns:
      credentials to be passed to GitClient.setCredentials(StandardUsernameCredentials). If null force GitSCM to obtain credentials in the standard way, from the credential provider, using the credential identifier provided by getId().
    • authenticationContext

      static jenkins.authentication.tokens.api.AuthenticationTokenContext<BitbucketAuthenticator> authenticationContext(String serverUrl)
      Generates context that sub-classes can use to determine if they would be able to authenticate against the provided server.
      Parameters:
      serverUrl - The URL being authenticated against
      Returns:
      an AuthenticationTokenContext for use with the AuthenticationTokens APIs