prefect_bitbucket.credentials
Module to enable authenticate interactions with BitBucket.
Classes
ClientType
The client type to use.
BitBucketCredentials
Store BitBucket credentials to interact with private BitBucket repositories.
Attributes:
token: An access token to authenticate with BitBucket. This is required for accessing private repositories.username: Identification name unique across entire BitBucket site.password: The password to authenticate to BitBucket.url: The base URL of your BitBucket instance.
format_git_credentials
- BitBucket Server: username:token format required
- BitBucket Cloud: x-token-auth:token prefix
- Self-hosted instances: If username is provided, username:token format is used regardless of hostname (supports instances without ‘bitbucketserver’ in URL)
url: Repository URL (e.g., “https://bitbucket.org/org/repo.git”)
- Complete URL with credentials embedded
ValueError: If credentials are not properly configured
get_client
client_type: Whether to use a local or cloud client.
- An authenticated Bitbucket client.