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 ¶ added in v2.14.0
func AuthTokenWriteable(authCfg gh.AuthConfig, hostname string) (string, bool)
func GetCurrentLogin ¶ added in v2.40.0
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 ¶ added in v2.22.0
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
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 ¶ added in v2.50.0
type LoginOptions ¶
type LoginOptions struct { IO *iostreams.IOStreams Config iconfig HTTPClient *http.Client Hostname string Interactive bool Web bool Scopes []string GitProtocol string Prompter Prompt Browser browser.Browser CredentialFlow *GitCredentialFlow SecureStorage bool SkipSSHKeyPrompt bool // contains filtered or unexported fields }
type MissingScopesError ¶
type MissingScopesError struct {
MissingScopes []string
}
func (MissingScopesError) Error ¶
func (e MissingScopesError) Error() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.