oauth

package
v0.0.0-...-3371691 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Refresh

func Refresh(log *util.Logger, token *oauth2.Token, ts oauth2.TokenSource, optMaxTokenLifetime ...time.Duration)

Refresh refreshes the token every 5m. If token refresh fails 5 times, it is aborted.

func RefreshTokenSource

func RefreshTokenSource(token *oauth2.Token, refresher TokenRefresher) oauth2.TokenSource

Types

type Token

type Token oauth2.Token

Token is an OAuth token that supports the expires_in attribute

func (*Token) UnmarshalJSON

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

type TokenRefresher

type TokenRefresher interface {
	RefreshToken(token *oauth2.Token) (*oauth2.Token, error)
}

type TokenSource

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

func (*TokenSource) Token

func (ts *TokenSource) Token() (*oauth2.Token, error)

Jump to

Keyboard shortcuts

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