Documentation
¶
Overview ¶
internal/cli/auth/device_flow.go
Index ¶
- func DeviceFlowAuth(a *cli.App) error
- func ExtractAndValidateToken(authHeader string) (string, bool)
- func IsValidGitHubToken(token string) bool
- type TokenCache
- func (tc *TokenCache) Get(key string) (bool, bool)
- func (tc *TokenCache) GetWithUser(key string) (string, *queries.GithubUserInfo, bool)
- func (tc *TokenCache) Set(key string, duration time.Duration)
- func (tc *TokenCache) SetWithUser(key string, token string, user *queries.GithubUserInfo, duration time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceFlowAuth ¶
func ExtractAndValidateToken ¶ added in v0.1.15
ExtractAndValidateToken extracts and validates a token from an Authorization header
func IsValidGitHubToken ¶ added in v0.1.15
IsValidToken validates a GitHub token
Types ¶
type TokenCache ¶ added in v0.1.15
type TokenCache struct {
// contains filtered or unexported fields
}
func GetTokenCache ¶ added in v0.1.15
func GetTokenCache() *TokenCache
GetTokenCache returns a singleton instance of TokenCache
func (*TokenCache) Get ¶ added in v0.1.15
func (tc *TokenCache) Get(key string) (bool, bool)
Get retrieves just the token validation status
func (*TokenCache) GetWithUser ¶ added in v0.1.15
func (tc *TokenCache) GetWithUser(key string) (string, *queries.GithubUserInfo, bool)
GetWithUser retrieves a token and GitHub user info from the cache
func (*TokenCache) Set ¶ added in v0.1.15
func (tc *TokenCache) Set(key string, duration time.Duration)
Set stores just the token validation status
func (*TokenCache) SetWithUser ¶ added in v0.1.15
func (tc *TokenCache) SetWithUser(key string, token string, user *queries.GithubUserInfo, duration time.Duration)
SetWithUser stores a token and GitHub user info in the cache
Click to show internal directories.
Click to hide internal directories.