oauth

package
v1.20.2-dexcom-api-g5m... Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2017 License: BSD-3-Clause Imports: 8 Imported by: 7

Documentation

Index

Constants

View Source
const ErrorAccessDenied = "access_denied"

Variables

This section is empty.

Functions

func IsAuthorizationError

func IsAuthorizationError(err error) bool

Types

type Provider

type Provider interface {
	provider.Provider

	Config() *oauth2.Config

	State(restrictedToken string) string // state = crypto of provider name, restrictedToken, secret
}

type Token

type Token struct {
	AccessToken    string    `json:"accessToken" bson:"accessToken"`
	TokenType      string    `json:"tokenType,omitempty" bson:"tokenType,omitempty"`
	RefreshToken   string    `json:"refreshToken,omitempty" bson:"refreshToken,omitempty"`
	ExpirationTime time.Time `json:"expirationTime,omitempty" bson:"expirationTime,omitempty"`
}

func NewToken

func NewToken() *Token

func NewTokenFromRawToken

func NewTokenFromRawToken(rawToken *oauth2.Token) (*Token, error)

func (*Token) MatchesRawToken

func (t *Token) MatchesRawToken(rawToken *oauth2.Token) bool

func (*Token) Normalize

func (t *Token) Normalize(normalizer structure.Normalizer)

func (*Token) Parse

func (t *Token) Parse(parser structure.ObjectParser)

func (*Token) RawToken

func (t *Token) RawToken() *oauth2.Token

func (*Token) Validate

func (t *Token) Validate(validator structure.Validator)

type TokenSource

type TokenSource interface {
	HTTPClient(ctx context.Context, prvdr Provider) (*http.Client, error)
	RefreshedToken() (*Token, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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