oauth

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthTimeout       = 90 * time.Second
	AuthListenAddr    = "127.0.0.1"
	AuthScheme        = "http://"
	DefaultPerms      = 0o600
	ReadTimeout       = 5 * time.Second
	WriteTimeout      = 5 * time.Second
	IdleTimeout       = 60 * time.Second
	ReadHeaderTimeout = 10 * time.Second
)

Variables

View Source
var (
	ErrOAuthUUID        = errors.New("unable to generate UUID")
	ErrOAuthFreePort    = errors.New("unable to get a free port")
	ErrOAuthHTTPServer  = errors.New("unable to start HTTP server")
	ErrOAuthBrowser     = errors.New("unable to open system browser")
	ErrOAuthTimeout     = errors.New("timeout while waiting for authentication to finish")
	ErrOAuthTokenFetch  = errors.New("unable to retrieve token from Google API")
	ErrOAuthTokenSave   = errors.New("unable to save token to file")
	ErrOAuthTokenEncode = errors.New("unable to encode OAuth token to JSON")
)

Functions

func GetClient

func GetClient(ctx context.Context, config *oauth2.Config, tokenPath string) (*http.Client, error)

GetClient returns an authenticated HTTP client, loading the token from tokenPath, refreshing it if expired, or running the interactive browser flow if needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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