tester

package
v0.0.0-...-c4f7e29 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIDTester string = "tester"
)
View Source
const ResultLifetime = duration.UserInteraction
View Source
const TokenLifetime = duration.Short

Variables

View Source
var DependencySet = wire.NewSet(
	wire.Struct(new(TesterStore), "*"),
)
View Source
var ErrResultNotFound = errors.New("tester result not found")
View Source
var ErrTokenNotFound = errors.New("tester token not found")

Functions

func NewTesterClient

func NewTesterClient(testerEndpoint string) *config.OAuthClientConfig

Types

type EndpointsProvider

type EndpointsProvider interface {
	TesterURL() *url.URL
}

type TesterResult

type TesterResult struct {
	ID        string                 `json:"id"`
	ReturnURI string                 `json:"return_uri"`
	UserInfo  map[string]interface{} `json:"user_info"`
}

func NewTesterResultFromToken

func NewTesterResultFromToken(token *TesterToken, userInfo map[string]interface{}) *TesterResult

type TesterStore

type TesterStore struct {
	Context context.Context
	Redis   *globalredis.Handle
}

func (*TesterStore) CreateResult

func (s *TesterStore) CreateResult(
	appID config.AppID,
	result *TesterResult,
) (*TesterResult, error)

func (*TesterStore) CreateToken

func (s *TesterStore) CreateToken(
	appID config.AppID,
	returnURI string,
) (*TesterToken, error)

func (*TesterStore) GetResult

func (s *TesterStore) GetResult(
	appID config.AppID,
	resultID string,
) (*TesterResult, error)

func (*TesterStore) GetToken

func (s *TesterStore) GetToken(
	appID config.AppID,
	tokenID string,
	consume bool,
) (*TesterToken, error)

type TesterToken

type TesterToken struct {
	TokenID      string         `json:"token_id"`
	ReturnURI    string         `json:"return_uri"`
	PKCEVerifier *pkce.Verifier `json:"pkce_verifier"`
}

func NewTesterToken

func NewTesterToken(returnURI string) *TesterToken

Jump to

Keyboard shortcuts

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