accesstoken

package
v0.129.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TokenFilePath

func TokenFilePath() string

TokenFilePath returns the path to the token file.

Types

type T

type T struct {
	TokenType    string    `yaml:"tokenType"`
	TokenExpiry  time.Time `yaml:"tokenExpiry"`
	AccessToken  string    `yaml:"accessToken"`
	RefreshToken string    `yaml:"refreshToken"`
}

T is the token.

func LoadToken

func LoadToken(ctx context.Context, c *configs.C) (*T, error)

LoadToken loads the token from a file.

type TokenExchanger

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

TokenExchanger exchanges a code for a token.

func NewTokenExchanger

func NewTokenExchanger(c *configs.C) (*TokenExchanger, error)

NewTokenExchanger creates a new token exchanger.

func (*TokenExchanger) LoginURL

func (e *TokenExchanger) LoginURL() (string, error)

LoginURL returns a URL to login.

func (*TokenExchanger) ObtainToken

func (e *TokenExchanger) ObtainToken(ctx context.Context, code string) error

ObtainToken obtains a token from the issuer.

Jump to

Keyboard shortcuts

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