vag

package
v0.0.0-...-499f9e9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChallengeAndVerifier

func ChallengeAndVerifier(q url.Values) func(url.Values)

func MetaTokenSource

func MetaTokenSource(newT func() (*Token, error), newTS func(*Token) TokenSource) *metaTokenSource

MetaTokenSource creates a token source that is created using the `newTS` function or recreated once it fails to return tokens. The recreation uses a new bootstrap token provided by the `newT` function.

func RefreshTokenSource

func RefreshTokenSource(token *Token, refresher TokenRefresher) *tokenSource

Types

type Token

type Token struct {
	oauth2.Token
	IDToken string `json:"id_token,omitempty"`
	// contains filtered or unexported fields
}

Token is an OAuth2-compatible token that supports the expires_in attribute

func (*Token) Error

func (t *Token) Error() error

func (*Token) UnmarshalJSON

func (t *Token) UnmarshalJSON(data []byte) error

type TokenExchanger

type TokenExchanger interface {
	Exchange(q url.Values) (*Token, error)
	TokenSource(token *Token) TokenSource
}

TokenExchanger exchanges a VW identity response into a (refreshing) VAG token source

type TokenRefresher

type TokenRefresher func(*Token) (*Token, error)

TokenRefresher refreshes a token

type TokenSource

type TokenSource interface {
	// Token returns an OAuth2 compatible token (id_token omitted)
	Token() (*oauth2.Token, error)
	// TokenEx returns the extended VAG token (id_token included)
	TokenEx() (*Token, error)
}

TokenSource is a VAG token source compatible with oauth2.TokenSource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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