oauth2

package
v0.0.0-...-8f9f3ed Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoCredentials       = errors.New("no oauth2 credentials found")
	ErrMultipleCredentials = errors.New("unexpected multiple oauth2 credentials found")
)

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Tenant       string
	AccessToken  string
	RefreshToken string
	Expires      time.Time
	Created      time.Time
	Updated      time.Time
}

type CredentialsManager

type CredentialsManager interface {
	GenerateAuthorizationURL() string
	GenerateCredentials(data gjson.Result) (*Credentials, error)
	RefreshCredentials() (*Credentials, error)
	CredentialsExpiry() time.Time
}

type Service

type Service struct {
	Dao *daos.Dao
}

func (*Service) Load

func (s *Service) Load(tenant string) (*Credentials, error)

func (*Service) Save

func (s *Service) Save(credentials *Credentials) error

Jump to

Keyboard shortcuts

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