Documentation
¶
Overview ¶
internal/auth/bitbucket.go
internal/auth/credentials.go
internal/auth/github.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoCredentials = errors.New("no credentials found")
Functions ¶
func DefaultStorePath ¶
func DefaultStorePath() string
Types ¶
type BitbucketOAuth ¶
type BitbucketOAuth struct {
ClientID string
ClientSecret string
TokenURL string // overridable for testing
}
func (*BitbucketOAuth) ExchangeCode ¶
func (b *BitbucketOAuth) ExchangeCode(ctx context.Context, code string) (Credentials, error)
func (*BitbucketOAuth) Login ¶
func (b *BitbucketOAuth) Login(ctx context.Context) (Credentials, error)
func (*BitbucketOAuth) RefreshToken ¶
func (b *BitbucketOAuth) RefreshToken(ctx context.Context, refreshToken string) (Credentials, error)
type Credentials ¶
type Credentials struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
}
func (Credentials) Expired ¶
func (c Credentials) Expired() bool
type FileStore ¶
type FileStore struct {
// contains filtered or unexported fields
}
func NewFileStore ¶
func (*FileStore) LoadWithEnv ¶
func (s *FileStore) LoadWithEnv(provider string) (Credentials, error)
type GitHubOAuth ¶
type GitHubOAuth struct {
ClientID string
DeviceURL string // overridable for testing
TokenURL string // overridable for testing
OpenBrowser bool
}
func (*GitHubOAuth) Login ¶
func (g *GitHubOAuth) Login(ctx context.Context) (Credentials, error)
Click to show internal directories.
Click to hide internal directories.