Documentation
¶
Index ¶
- func AuthTokenWriteable(authCfg gh.AuthConfig, hostname string) (string, bool)
- func GetCurrentLogin(httpClient httpClient, hostname, authToken string) (string, error)
- func GetScopes(httpClient httpClient, hostname, authToken string) (string, error)
- func HasMinimumScopes(httpClient httpClient, hostname, authToken string) error
- func HeaderHasMinimumScopes(scopesHeader string) error
- func Login(opts *LoginOptions) error
- type GitCredentialFlow
- type HelperConfig
- type LoginOptions
- type MissingScopesError
- type Prompt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthTokenWriteable ¶
func AuthTokenWriteable(authCfg gh.AuthConfig, hostname string) (string, bool)
func GetCurrentLogin ¶
GetCurrentLogin returns the username from a Bitbucket token (which is in username:app_password format).
func GetScopes ¶
GetScopes performs a GitHub API request and returns the value of the X-Oauth-Scopes header.
func HasMinimumScopes ¶
HasMinimumScopes performs a GitHub API request and returns an error if the token used in the request lacks the minimum required scopes for performing API operations with gh.
func HeaderHasMinimumScopes ¶
HeaderHasMinimumScopes parses the comma separated scopesHeader string and returns an error if it lacks the minimum required scopes for performing API operations with gh.
func Login ¶
func Login(opts *LoginOptions) error
Login performs the Bitbucket login flow using App Passwords. App Passwords are Bitbucket's equivalent of GitHub PATs.
Types ¶
type GitCredentialFlow ¶
type GitCredentialFlow struct {
Prompter Prompt
HelperConfig HelperConfig
Updater *gitcredentials.Updater
// contains filtered or unexported fields
}
func (*GitCredentialFlow) Prompt ¶
func (flow *GitCredentialFlow) Prompt(hostname string) error
func (*GitCredentialFlow) Scopes ¶
func (flow *GitCredentialFlow) Scopes() []string
func (*GitCredentialFlow) Setup ¶
func (flow *GitCredentialFlow) Setup(hostname, username, authToken string) error
func (*GitCredentialFlow) ShouldSetup ¶
func (flow *GitCredentialFlow) ShouldSetup() bool
type HelperConfig ¶
type LoginOptions ¶
type MissingScopesError ¶
type MissingScopesError struct {
MissingScopes []string
}
func (MissingScopesError) Error ¶
func (e MissingScopesError) Error() string