Class BitbucketAuthenticator
- java.lang.Object
-
- com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
-
- Direct Known Subclasses:
BitbucketAccessTokenAuthenticator
,BitbucketClientCertificateAuthenticator
,BitbucketOAuthAuthenticator
,BitbucketUsernamePasswordAuthenticator
public abstract class BitbucketAuthenticator extends Object
Support for various different methods of authenticating with Bitbucket
-
-
Field Summary
Fields Modifier and Type Field Description static String
BITBUCKET_INSTANCE_TYPE
The key for Bitbucket instance type as reported in anAuthenticationTokenContext
static String
BITBUCKET_INSTANCE_TYPE_CLOUD
Purpose value for bitbucket cloud (i.e.static String
BITBUCKET_INSTANCE_TYPE_SERVER
Purpose value for bitbucket serverstatic String
SCHEME
The key for URL scheme as reported in anAuthenticationTokenContext
static String
SERVER_URL
The key for bitbucket URL as reported in anAuthenticationTokenContext
-
Constructor Summary
Constructors Constructor Description BitbucketAuthenticator(com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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
.String
getId()
String
getUserUri()
Return the user to be used in the clone Uri.
-
-
-
Field Detail
-
SERVER_URL
public static final String SERVER_URL
The key for bitbucket URL as reported in anAuthenticationTokenContext
- See Also:
- Constant Field Values
-
SCHEME
public static final String SCHEME
The key for URL scheme as reported in anAuthenticationTokenContext
- See Also:
- Constant Field Values
-
BITBUCKET_INSTANCE_TYPE
public static final String BITBUCKET_INSTANCE_TYPE
The key for Bitbucket instance type as reported in anAuthenticationTokenContext
- See Also:
- Constant Field Values
-
BITBUCKET_INSTANCE_TYPE_CLOUD
public static final String BITBUCKET_INSTANCE_TYPE_CLOUD
Purpose value for bitbucket cloud (i.e. bitbucket.org)- See Also:
- Constant Field Values
-
BITBUCKET_INSTANCE_TYPE_SERVER
public static final String BITBUCKET_INSTANCE_TYPE_SERVER
Purpose value for bitbucket server- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public String 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.
-
getUserUri
public String getUserUri()
Return the user to be used in the clone Uri. Override this if your authentication method needs to set the user in the repository Uri- Returns:
- user name to use in the repository Uri
-
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
-
-