Class BitbucketAccessTokenAuthenticator
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.credentials.BitbucketAccessTokenAuthenticator
- All Implemented Interfaces:
BitbucketAuthenticator
Authenticator that uses an access token.
-
Field Summary
Fields inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
BITBUCKET_INSTANCE_TYPE, BITBUCKET_INSTANCE_TYPE_CLOUD, BITBUCKET_INSTANCE_TYPE_SERVER, SCHEME, SERVER_URL
-
Constructor Summary
ConstructorDescriptionBitbucketAccessTokenAuthenticator
(org.jenkinsci.plugins.plaincredentials.StringCredentials credentials) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configureRequest
(org.apache.http.HttpRequest request) Provides the access token as header.com.cloudbees.plugins.credentials.common.StandardUsernameCredentials
Provides with the Git command line interface.getId()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator
configureBuilder, configureContext
-
Constructor Details
-
BitbucketAccessTokenAuthenticator
public BitbucketAccessTokenAuthenticator(org.jenkinsci.plugins.plaincredentials.StringCredentials credentials) Constructor.- Parameters:
credentials
- the access token that will be used
-
-
Method Details
-
configureRequest
public void configureRequest(org.apache.http.HttpRequest request) Provides the access token as header.- Specified by:
configureRequest
in interfaceBitbucketAuthenticator
- Parameters:
request
- to configure with the access token
-
getCredentialsForSCM
public com.cloudbees.plugins.credentials.common.StandardUsernameCredentials getCredentialsForSCM()Provides with the Git command line interface.As per documentation the username must be x-token-auth and the password is the token.
- Specified by:
getCredentialsForSCM
in interfaceBitbucketAuthenticator
- Returns:
- the UsernamePasswordCredentials credential to be used with Git command line interface
-
getId
- Specified by:
getId
in interfaceBitbucketAuthenticator
- Returns:
- id of the credentials used.
-