Documentation ¶
Index ¶
- func ExchangeCodeForAccessToken(tokenName, code, scope string, definition RunDefinition, ctx *model.Context) (accesstoken string, err error)
- func NewBufferedDaemonController() *daemonController
- func NewCollector(requirements []model.SpecConsentRequirements, doneFunc func()) *collector
- func NewDaemonController(resultChan chan results.TestCase) *daemonController
- func NewTokenCollector(consentIds TokenConsentIDs, doneFunc func()) *tokencollector
- type Collector
- type DaemonController
- type ExchangeParameters
- type Executor
- type RunDefinition
- type TestCaseExecutor
- type TestCaseRunner
- func NewConsentAcquisitionRunner(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
- func NewExchangeComponentRunner(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
- func NewTestCaseRunner(definition RunDefinition, daemonController DaemonController) *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 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 NewCollector ¶
func NewCollector(requirements []model.SpecConsentRequirements, doneFunc func()) *collector
NewCollector returns a thread safe token collector
func NewDaemonController ¶
NewDaemonController new instance to control a background routine
func NewTokenCollector ¶
func NewTokenCollector(consentIds TokenConsentIDs, doneFunc func()) *tokencollector
NewTokenCollector -
Types ¶
type Collector ¶
Collector collects tokens for a set or permissions requirements and calls a subscribed function when it has received all
func NewNullCollector ¶
func NewNullCollector(doneFunc func()) Collector
NewNullCollector implements a dummy collector that trigger done immediately and collects nothing for using when we don't want to collect or in tests
type DaemonController ¶
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, 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(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
NewConsentAcquisitionRunner -
func NewExchangeComponentRunner ¶
func NewExchangeComponentRunner(definition RunDefinition, daemonController DaemonController) *TestCaseRunner
NewExchangeComponentRunner -
func NewTestCaseRunner ¶
func NewTestCaseRunner(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
type TokenConsentIDItem ¶
type TokenConsentIDItem struct { TokenName string ConsentID string Permissions string AccessToken string ConsentURL string }
TokenConsentIDItem is a single consentId mapping to token name
type TokenConsentIDs ¶
type TokenConsentIDs []TokenConsentIDItem
TokenConsentIDs captures the token/consentIds awaiting authorisation
func InitiationConsentAcquisition ¶
func InitiationConsentAcquisition(consentRequirements []model.SpecConsentRequirements, definition RunDefinition, ctx *model.Context) (TokenConsentIDs, error)
InitiationConsentAcquisition - get required tokens