oauthdevice

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	// contains filtered or unexported fields
}

func NewAuth

func NewAuth(clientID string, scopes []string) *Auth

func (*Auth) FetchCode

func (a *Auth) FetchCode(ctx context.Context, authEndpoint *oauth2.Endpoint) (*oauth2.DeviceAuthResponse, error)

func (*Auth) FetchToken

func (a *Auth) FetchToken(ctx context.Context, authRes *oauth2.DeviceAuthResponse) (*oauth2.Token, error)

type Authenticator

type Authenticator interface {
	FetchCode(context.Context, *oauth2.Endpoint) (*oauth2.DeviceAuthResponse, error)
	FetchToken(context.Context, *oauth2.DeviceAuthResponse) (*oauth2.Token, error)
}

Notes

Bugs

  • Clusters that are not oauth-aware will return HTML with a 2xx code, confusing the oauth library. Detect and alias those errors here.

Jump to

Keyboard shortcuts

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