auth

package
v0.1.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

internal/cli/auth/device_flow.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceFlowAuth

func DeviceFlowAuth(a *cli.App) error

func ExtractAndValidateToken added in v0.1.15

func ExtractAndValidateToken(authHeader string) (string, bool)

ExtractAndValidateToken extracts and validates a token from an Authorization header

func IsValidGitHubToken added in v0.1.15

func IsValidGitHubToken(token string) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL