testhelpers

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManualTestHandler

type ManualTestHandler struct {
	TestHandler
	Action irma.Action
}

ManualTestHandler embeds a TestHandler to inherit its methods. Below we overwrite the methods that require behaviour specific to manual settings.

func (*ManualTestHandler) RequestIssuancePermission

func (th *ManualTestHandler) RequestIssuancePermission(request *irma.IssuanceRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, issuerName *irma.RequestorInfo, ph irmaclient.PermissionHandler)

func (*ManualTestHandler) RequestSchemeManagerPermission

func (th *ManualTestHandler) RequestSchemeManagerPermission(manager *irma.SchemeManager, callback func(proceed bool))

RequestSchemeManagerPermission handler should not be called, fail test if it is called

func (*ManualTestHandler) RequestSignaturePermission

func (th *ManualTestHandler) RequestSignaturePermission(request *irma.SignatureRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, requesterName *irma.RequestorInfo, ph irmaclient.PermissionHandler)

func (*ManualTestHandler) RequestVerificationPermission

func (th *ManualTestHandler) RequestVerificationPermission(request *irma.DisclosureRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, verifierName *irma.RequestorInfo, ph irmaclient.PermissionHandler)

RequestVerificationPermission handler should not be called, fail test if it is called

func (*ManualTestHandler) StatusUpdate

func (th *ManualTestHandler) StatusUpdate(action irma.Action, status irma.ClientStatus)

func (*ManualTestHandler) Success

func (th *ManualTestHandler) Success(result string)

type SessionResult

type SessionResult struct {
	Err              error
	SignatureResult  *irma.SignedMessage
	DisclosureResult *irma.Disclosure
	Missing          [][]irmaclient.DisclosureCandidates
}

type TestClientHandler

type TestClientHandler struct {
	T           *testing.T
	C           chan error
	RevokedCred *irma.CredentialIdentifier
	Storage     string
}

func (*TestClientHandler) ChangePinBlocked

func (i *TestClientHandler) ChangePinBlocked(manager irma.SchemeManagerIdentifier, timeout int)

func (*TestClientHandler) ChangePinFailure

func (i *TestClientHandler) ChangePinFailure(manager irma.SchemeManagerIdentifier, err error)

func (*TestClientHandler) ChangePinIncorrect

func (i *TestClientHandler) ChangePinIncorrect(manager irma.SchemeManagerIdentifier, attempts int)

func (*TestClientHandler) ChangePinSuccess

func (i *TestClientHandler) ChangePinSuccess()

func (*TestClientHandler) EnrollmentFailure

func (i *TestClientHandler) EnrollmentFailure(manager irma.SchemeManagerIdentifier, err error)

func (*TestClientHandler) EnrollmentSuccess

func (i *TestClientHandler) EnrollmentSuccess(manager irma.SchemeManagerIdentifier)

func (*TestClientHandler) ReportError

func (i *TestClientHandler) ReportError(err error)

func (*TestClientHandler) Revoked

func (i *TestClientHandler) Revoked(cred *irma.CredentialIdentifier)

func (*TestClientHandler) UpdateAttributes

func (i *TestClientHandler) UpdateAttributes()

func (*TestClientHandler) UpdateConfiguration

func (i *TestClientHandler) UpdateConfiguration(new *irma.IrmaIdentifierSet)

type TestHandler

type TestHandler struct {
	T                  *testing.T
	C                  chan *SessionResult
	Client             *irmaclient.IrmaClient
	ExpectedServerName *irma.RequestorInfo
	Wait               time.Duration
	Result             string
	PairingCodeChan    chan string
	ClientTransport    *irma.HTTPTransport
	FrontendTransport  *irma.HTTPTransport
}

func (TestHandler) Cancelled

func (th TestHandler) Cancelled()

func (TestHandler) ClientReturnURLSet

func (th TestHandler) ClientReturnURLSet(clientReturnUrl string)

func (TestHandler) Failure

func (th TestHandler) Failure(err *irma.SessionError)

func (TestHandler) KeyshareBlocked

func (th TestHandler) KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int)

func (TestHandler) KeyshareEnrollmentMissing

func (th TestHandler) KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier)

func (TestHandler) PairingRequired

func (th TestHandler) PairingRequired(pairingCode string)

func (TestHandler) RequestIssuancePermission

func (th TestHandler) RequestIssuancePermission(request *irma.IssuanceRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, ServerName *irma.RequestorInfo, callback irmaclient.PermissionHandler)

func (TestHandler) RequestPin

func (th TestHandler) RequestPin(remainingAttempts int, callback irmaclient.PinHandler)

func (TestHandler) RequestSchemeManagerPermission

func (th TestHandler) RequestSchemeManagerPermission(manager *irma.SchemeManager, callback func(proceed bool))

func (TestHandler) RequestSignaturePermission

func (th TestHandler) RequestSignaturePermission(request *irma.SignatureRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, ServerName *irma.RequestorInfo, callback irmaclient.PermissionHandler)

func (TestHandler) RequestVerificationPermission

func (th TestHandler) RequestVerificationPermission(request *irma.DisclosureRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, ServerName *irma.RequestorInfo, callback irmaclient.PermissionHandler)

func (*TestHandler) SetClientTransport

func (th *TestHandler) SetClientTransport(transport *irma.HTTPTransport)

func (TestHandler) StatusUpdate

func (th TestHandler) StatusUpdate(action irma.Action, status irma.ClientStatus)

func (*TestHandler) Success

func (th *TestHandler) Success(result string)

type UnsatisfiableTestHandler

type UnsatisfiableTestHandler struct {
	TestHandler
	// contains filtered or unexported fields
}

UnsatisfiableTestHandler is a session handler that expects RequestVerificationPermission to be called for an unsatisfiable session. If called a second time, it checks that the session has beome satifsiable and finishes it.

func (*UnsatisfiableTestHandler) Cancelled

func (th *UnsatisfiableTestHandler) Cancelled()

Cancelled overrides TestHandler.Cancelled() so we can cancel future RequestVerificationPermission() invocations

func (*UnsatisfiableTestHandler) RequestVerificationPermission

func (th *UnsatisfiableTestHandler) RequestVerificationPermission(request *irma.DisclosureRequest, satisfiable bool, candidates [][]irmaclient.DisclosureCandidates, ServerName *irma.RequestorInfo, callback irmaclient.PermissionHandler)

func (*UnsatisfiableTestHandler) Success

func (th *UnsatisfiableTestHandler) Success(result string)

Jump to

Keyboard shortcuts

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