Documentation
¶
Overview ¶
Package authflow provides authentication flows for Bitbucket. Bitbucket supports two authentication methods: 1. API Tokens (new) - requires Atlassian account email + API token 2. App Passwords (legacy) - requires Bitbucket username + app password OAuth device flow is not supported.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentLogin ¶
GetCurrentLogin extracts the username from a Bitbucket token. Bitbucket tokens are stored as "username:app_password".
Types ¶
type AuthFlowResult ¶
type AuthFlowResult struct {
Username string
Token string // This is "email:api_token" or "username:app_password" for Bitbucket
}
AuthFlowResult contains the result of an authentication flow.
func APITokenAuth ¶
func APITokenAuth(hostname string, IO *iostreams.IOStreams, prompter Prompter) (*AuthFlowResult, error)
APITokenAuth performs authentication using a Bitbucket API Token. This is the recommended authentication method for Bitbucket Cloud. API tokens require Atlassian account email (not username) for Basic Auth.
func AppPasswordAuth ¶
func AppPasswordAuth(hostname string, IO *iostreams.IOStreams, prompter Prompter) (*AuthFlowResult, error)
AppPasswordAuth performs authentication using a Bitbucket App Password (legacy). Consider using APITokenAuth instead for new integrations.