step

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFoundInContext = errors.New("key not found in context")

Functions

This section is empty.

Types

type Context

type Context interface {
	SetString(key, value string)
	GetString(key string) (string, error)
	SetInt(key string, value int)
	GetInt(key string) (int, error)
	SetResponse(key string, response *http.Response)
	GetResponse(key string) (*http.Response, error)
	SetOpenIdConfig(key string, config openid.Configuration)
	GetOpenIdConfig(key string) (openid.Configuration, error)
	SetClient(key string, client dcr.Client)
	GetClient(key string) (dcr.Client, error)
	SetGrantToken(key string, token auth.GrantToken)
	GetGrantToken(key string) (auth.GrantToken, error)
}

func NewContext

func NewContext() Context

type DebugMessage

type DebugMessage struct {
	Time    time.Time
	Message string
}

type DebugMessages

type DebugMessages struct {
	Item []DebugMessage
}

func NewDebug

func NewDebug() *DebugMessages

func (*DebugMessages) Log

func (d *DebugMessages) Log(msg string)

func (*DebugMessages) Logf

func (d *DebugMessages) Logf(format string, a ...interface{})

type Result

type Result struct {
	Name       string
	Pass       bool
	FailReason string
	Debug      DebugMessages
}

func NewFailResult

func NewFailResult(name, reason string) Result

func NewFailResultWithDebug

func NewFailResultWithDebug(name, reason string, log *DebugMessages) Result

func NewPassResult

func NewPassResult(name string) Result

func NewPassResultWithDebug

func NewPassResultWithDebug(name string, log *DebugMessages) Result

type Results

type Results []Result

func (Results) Fail

func (r Results) Fail() bool

type Step

type Step interface {
	Run(ctx Context) Result
}

func NewAssertContentType

func NewAssertContentType(responseContextVar string, contentType string) Step

func NewAssertStatus

func NewAssertStatus(code int, responseContextVar string) Step

func NewClaims

func NewClaims(jwtClaimsCtxKey string, authoriserBuilder auth.AuthoriserBuilder) Step

func NewClientCredentialsGrant

func NewClientCredentialsGrant(grantTokenCtxKey, clientCtxKey, tokenEndpoint string, httpClient *http.Client) Step

func NewClientDelete

func NewClientDelete(registrationEndpoint, clientCtxKey, grantTokenCtxKey string, httpClient *http.Client) Step

func NewClientRegisterResponse

func NewClientRegisterResponse(responseCtxKey, clientCtxKey string, authoriserBuilder auth.AuthoriserBuilder) Step

func NewClientRetrieve

func NewClientRetrieve(
	responseCtxKey, registrationEndpoint, clientCtxKey, grantTokenCtxKey string,
	httpClient *http.Client,
) Step

func NewClientRetrieveResponse

func NewClientRetrieveResponse(responseCtxKey, clientCtxKey, tokenEndpoint string) Step

func NewClientRetrieveSchema

func NewClientRetrieveSchema(responseCtxKey string, validator schema.Validator) Step

func NewClientUpdate

func NewClientUpdate(
	registrationEndpoint,
	jwtClaimsCtxKey,
	responseCtxKey,
	clientCtxKey,
	grantTokenCtxKey string,
	httpClient *http.Client,
) Step

func NewGetRequest

func NewGetRequest(url, responseContextVar string, httpClient *http.Client) Step

func NewPostClientRegister

func NewPostClientRegister(registrationEndpoint, jwtClaimsCtxKey, responseCtxKey string, httpClient *http.Client) Step

func NewSetInvalidGrantToken

func NewSetInvalidGrantToken(grantTokenCtxKey string) Step

func NewValidateRegistrationEndpoint

func NewValidateRegistrationEndpoint(registrationEndpoint *string) Step

Jump to

Keyboard shortcuts

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