Interface BitbucketAuthenticator
- All Known Implementing Classes:
BitbucketAccessTokenAuthenticator,BitbucketClientCertificateAuthenticator,BitbucketOAuthAuthenticator,BitbucketUserAPITokenAuthenticator,BitbucketUsernamePasswordAuthenticator
public interface BitbucketAuthenticator
Support for various different methods of authenticating with Bitbucket
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key for Bitbucket instance type as reported in anAuthenticationTokenContextstatic final StringPurpose value for bitbucket cloud (i.e.static final StringPurpose value for bitbucket serverstatic final StringThe key for URL scheme as reported in anAuthenticationTokenContextstatic final StringThe key for bitbucket URL as reported in anAuthenticationTokenContext -
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.default voidconfigureBuilder(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder) Configures anHttpClientBuilder.default voidconfigureContext(org.apache.hc.client5.http.protocol.HttpClientContext context, org.apache.hc.core5.http.HttpHost host) Configures anHttpClientContext.default voidconfigureRequest(org.apache.hc.core5.http.HttpRequest request) Configures anHttpRequest.default com.cloudbees.plugins.credentials.common.StandardUsernameCredentialsProvides 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:
-
-
Method Details
-
getId
String getId()- Returns:
- id of the credentials used.
-
configureBuilder
default void configureBuilder(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder) Configures anHttpClientBuilder. Override if you need to adjust connection setup.- Parameters:
builder- The client builder.
-
configureContext
default void configureContext(org.apache.hc.client5.http.protocol.HttpClientContext context, org.apache.hc.core5.http.HttpHost host) Configures anHttpClientContext. Override- Parameters:
context- The connection contexthost- host being connected to
-
configureRequest
default void configureRequest(org.apache.hc.core5.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
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). IfnullforceGitSCMto obtain credentials in the standard way, from the credential provider, using the credential identifier provided bygetId().
-
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
AuthenticationTokenContextfor use with the AuthenticationTokens APIs
-