Documentation ¶
Index ¶
- func AcquireHeadlessTokens(tests []model.TestCase, ctx *model.Context, definition RunDefinition) ([]manifest.RequiredTokens, error)
- func ExchangeCodeForAccessToken(tokenName, code, scope string, definition RunDefinition, ctx *model.Context) (accesstoken string, err error)
- func NewBufferedDaemonController() *daemonController
- func NewDaemonController(resultChan chan results.TestCase) *daemonController
- type Collector
- type DaemonController
- type DetailError
- type ExchangeParameters
- type Executor
- type RunDefinition
- type TestCaseExecutor
- type TestCaseRunner
- func NewConsentAcquisitionRunner(logger *logrus.Entry, definition RunDefinition, ...) *TestCaseRunner
- func NewExchangeComponentRunner(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
- func NewTestCaseRunner(logger *logrus.Entry, definition RunDefinition, ...) *TestCaseRunner
- func (r *TestCaseRunner) AppErr(msg string) error
- func (r *TestCaseRunner) AppMsg(msg string) string
- func (r *TestCaseRunner) RunConsentAcquisition(item TokenConsentIDItem, ctx *model.Context, consentType string, ...) error
- func (r *TestCaseRunner) RunTestCases(ctx *model.Context) error
- func (r *TestCaseRunner) String() string
- type Token
- type TokenCollector
- type TokenConsentIDItem
- type TokenConsentIDs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcquireHeadlessTokens ¶
func AcquireHeadlessTokens(tests []model.TestCase, ctx *model.Context, definition RunDefinition) ([]manifest.RequiredTokens, error)
AcquireHeadlessTokens from manifest generated test cases
func ExchangeCodeForAccessToken ¶
func ExchangeCodeForAccessToken(tokenName, code, scope string, definition RunDefinition, ctx *model.Context) (accesstoken string, err error)
ExchangeCodeForAccessToken - runs a testcase to perform this operation
func NewBufferedDaemonController ¶
func NewBufferedDaemonController() *daemonController
NewBufferedDaemonController new instance to control a background routine with 100 objects buffer in result and error channels
func NewDaemonController ¶
NewDaemonController new instance to control a background routine
Types ¶
type Collector ¶
Collector collects tokens for a set or permissions requirements and calls a subscribed function when it has received all
type DaemonController ¶
type DetailError ¶ added in v1.1.6
type DetailError struct { EndpointResponse string `json:"endpointResponse"` TestCaseMessage string `json:"testCaseMessage"` }
func (DetailError) Error ¶ added in v1.1.6
func (de DetailError) Error() string
type ExchangeParameters ¶
type ExchangeParameters struct { Code string BasicAuthentication string TokenEndpoint string RedirectURL string Scope string TokenName string }
ExchangeParameters - Captures the parameters require to exchange a code for an access token
type Executor ¶
type Executor struct { SigningCert authentication.Certificate TransportCert authentication.Certificate }
Executor - passes request to system under test across an matls connection
func (*Executor) ExecuteTestCase ¶
func (e *Executor) ExecuteTestCase(r *resty.Request, t *model.TestCase, ctx *model.Context) (*resty.Response, results.Metrics, error)
ExecuteTestCase - makes this a generic executor
func (*Executor) SetCertificates ¶
func (e *Executor) SetCertificates(certificateSigning, certificationTransport authentication.Certificate) error
SetCertificates receives transport and signing certificates
type RunDefinition ¶
type RunDefinition struct { DiscoModel *discovery.Model TestCaseRun generation.TestCasesRun SigningCert authentication.Certificate TransportCert authentication.Certificate }
RunDefinition captures all the information required to run the test cases
type TestCaseExecutor ¶
type TestCaseExecutor interface { ExecuteTestCase(r *resty.Request, t *model.TestCase, ctx *model.Context) (*resty.Response, results.Metrics, error) SetCertificates(certificateSigning, certificationTransport authentication.Certificate) error }
TestCaseExecutor defines an interface capable of executing a testcase
type TestCaseRunner ¶
type TestCaseRunner struct {
// contains filtered or unexported fields
}
func NewConsentAcquisitionRunner ¶
func NewConsentAcquisitionRunner(logger *logrus.Entry, definition RunDefinition, daemonController DaemonController) *TestCaseRunner
NewConsentAcquisitionRunner -
func NewExchangeComponentRunner ¶
func NewExchangeComponentRunner(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
NewExchangeComponentRunner -
func NewTestCaseRunner ¶
func NewTestCaseRunner(logger *logrus.Entry, definition RunDefinition, daemonController DaemonController) *TestCaseRunner
NewTestCaseRunner -
func (*TestCaseRunner) AppErr ¶
func (r *TestCaseRunner) AppErr(msg string) error
AppErr - application level trace error msg
func (*TestCaseRunner) AppMsg ¶
func (r *TestCaseRunner) AppMsg(msg string) string
AppMsg - application level trace
func (*TestCaseRunner) RunConsentAcquisition ¶
func (r *TestCaseRunner) RunConsentAcquisition(item TokenConsentIDItem, ctx *model.Context, consentType string, consentIDChannel chan<- TokenConsentIDItem) error
RunConsentAcquisition -
func (*TestCaseRunner) RunTestCases ¶
func (r *TestCaseRunner) RunTestCases(ctx *model.Context) error
RunTestCases runs the testCases
func (*TestCaseRunner) String ¶
func (r *TestCaseRunner) String() string
String - object represetation
type Token ¶
type Token struct { Code string NamedPermission model.NamedPermission }
Token represents a token acquisition for one of the permission set requirement
type TokenCollector ¶
type TokenCollector interface { Collect(tokenName, accesstoken string) error Tokens() TokenConsentIDs }
TokenCollector - collects tokens
func NewTokenCollector ¶
func NewTokenCollector(log *logrus.Entry, consentIds TokenConsentIDs, doneFunc func(), events events.Events) TokenCollector
NewTokenCollector -
type TokenConsentIDItem ¶
type TokenConsentIDItem struct { TokenName string ConsentID string Permissions string AccessToken string ConsentURL string Error string }
TokenConsentIDItem is a single consentId mapping to token name
type TokenConsentIDs ¶
type TokenConsentIDs []TokenConsentIDItem
TokenConsentIDs captures the token/consentIds awaiting authorisation
func GetPsuConsent ¶ added in v1.1.0
func GetPsuConsent(definition RunDefinition, ctx *model.Context, runTests *generation.TestCasesRun, permissions map[string][]manifest.RequiredTokens) (TokenConsentIDs, map[string]string, error)
GetPsuConsent -