Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions auth/services/irma/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,11 @@ func (v Signer) StartSigningSession(contract contract.Contract, _ map[string]int
}

// Start an IRMA session
// The empty string for requestor parameter is used because the nuts-node acts as a single requestor
sessionPointer, token, _, err := v.sessionHandler.StartSession(signatureRequest, func(result *server.SessionResult) {
log.Logger().Debug("Session done")
log.Logger().Trace(server.ToJson(result))
})
}, "")
if err != nil {
return nil, fmt.Errorf("error while creating session: %w", err)
}
Expand Down Expand Up @@ -216,6 +217,7 @@ func printQrCode(qrcode string) {
// signingSessionHandler is an abstraction for the Irma Server, mainly for enabling better testing
type signingSessionHandler interface {
GetSessionResult(token irmago.RequestorToken) (*server.SessionResult, error)
StartSession(request interface{}, handler server.SessionHandler) (*irmago.Qr, irmago.RequestorToken, *irmago.FrontendSessionRequest, error)
// StartSession starts an IRMA session. The requestor parameter identifies the party requesting the session.
StartSession(request interface{}, handler server.SessionHandler, requestor string) (*irmago.Qr, irmago.RequestorToken, *irmago.FrontendSessionRequest, error)
HandlerFunc() http.HandlerFunc
}
2 changes: 1 addition & 1 deletion auth/services/irma/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (m *mockIrmaClient) GetSessionResult(token irma.RequestorToken) (*irmaserve
return m.sessionResult, nil
}

func (m *mockIrmaClient) StartSession(request interface{}, handler irmaservercore.SessionHandler) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error) {
func (m *mockIrmaClient) StartSession(request interface{}, handler irmaservercore.SessionHandler, requestor string) (*irma.Qr, irma.RequestorToken, *irma.FrontendSessionRequest, error) {
if m.err != nil {
return nil, "", nil, m.err
}
Expand Down