seeds

package
v0.0.0-...-ec252d0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package seeds provides a way to "seed" a token source; especially one that relies on caching. This allows using the "seed" to bootstrap authentication in the case the cache is empty (or new), but doesn't call it every time.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailed = errors.New("seed failed")

	ErrFailedToExchange     = errors.New("failed to exchange token")
	ErrFailedToGetDeviceURL = errors.New("failed to get device url")
)

Err* are sentinel errors

Functions

This section is empty.

Types

type Seed

type Seed func(context.Context) (*oauth2.Token, error)

Seed is a function that handles all of the initial authentication, so that we have a token (complete with refresh).

func DeviceAuth

func DeviceAuth(audience string, c *oauth2.Config) Seed

DeviceAuth returns a seed that creates the initial OAuth2 flow via the Device flow. See: https://oauth.net/2/device-flow/

Jump to

Keyboard shortcuts

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