Class BitbucketAuthenticator
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
- Direct Known Subclasses:
BitbucketAccessTokenAuthenticator
,BitbucketClientCertificateAuthenticator
,BitbucketOAuthAuthenticator
,BitbucketUsernamePasswordAuthenticator
Support for various different methods of authenticating with Bitbucket
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The key for Bitbucket instance type as reported in anAuthenticationTokenContext
static final String
Purpose value for bitbucket cloud (i.e.static final String
Purpose value for bitbucket serverstatic final String
The key for URL scheme as reported in anAuthenticationTokenContext
static final String
The key for bitbucket URL as reported in anAuthenticationTokenContext
-
Constructor Summary
ModifierConstructorDescriptionprotected
BitbucketAuthenticator
(com.cloudbees.plugins.credentials.common.StandardCredentials credentials) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.void
configureBuilder
(org.apache.http.impl.client.HttpClientBuilder builder) Configures anHttpClientBuilder
.void
configureContext
(org.apache.http.client.protocol.HttpClientContext context, org.apache.http.HttpHost host) Configures anHttpClientContext
.void
configureRequest
(org.apache.http.HttpRequest request) Configures anHttpRequest
.com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
Provides credentials that can be used for authenticated interactions with SCM.getId()
-
Field Details
-
SERVER_URL
The key for bitbucket URL as reported in anAuthenticationTokenContext
- See Also:
-
SCHEME
The key for URL scheme as reported in anAuthenticationTokenContext
- See Also:
-
BITBUCKET_INSTANCE_TYPE
The key for Bitbucket instance type as reported in anAuthenticationTokenContext
- See Also:
-
BITBUCKET_INSTANCE_TYPE_CLOUD
Purpose value for bitbucket cloud (i.e. bitbucket.org)- See Also:
-
BITBUCKET_INSTANCE_TYPE_SERVER
Purpose value for bitbucket server- See Also:
-
-
Constructor Details
-
BitbucketAuthenticator
protected BitbucketAuthenticator(com.cloudbees.plugins.credentials.common.StandardCredentials credentials) Constructor- Parameters:
credentials
- credentials instance this authenticator will use
-
-
Method Details
-
getId
- Returns:
- id of the credentials used.
-
configureBuilder
public void configureBuilder(org.apache.http.impl.client.HttpClientBuilder builder) Configures anHttpClientBuilder
. Override if you need to adjust connection setup.- Parameters:
builder
- The client builder.
-
configureContext
public void configureContext(org.apache.http.client.protocol.HttpClientContext context, org.apache.http.HttpHost host) Configures anHttpClientContext
. Override- Parameters:
context
- The connection contexthost
- host being connected to
-
configureRequest
public void configureRequest(org.apache.http.HttpRequest request) Configures anHttpRequest
. Override this if your authentication method needs to set headers on a per-request basis.- Parameters:
request
- the request.
-
getCredentialsForSCM
public 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)
-
authenticationContext
public 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
-