Commit 6a28eb8f authored by Sietse Ringers's avatar Sietse Ringers
Browse files

feat: include session request in UnsatisfiableRequest callback

parent 79a16c29
......@@ -96,7 +96,7 @@ func (th TestHandler) Failure(err *irma.SessionError) {
th.t.Fatal(err)
}
}
func (th TestHandler) UnsatisfiableRequest(serverName irma.TranslatedString, missing map[int]map[int]irma.AttributeCon) {
func (th TestHandler) UnsatisfiableRequest(request irma.SessionRequest, serverName irma.TranslatedString, missing map[int]map[int]irma.AttributeCon) {
th.Failure(&irma.SessionError{
ErrorType: irma.ErrorType("UnsatisfiableRequest"),
})
......
......@@ -79,6 +79,6 @@ func (h *keyshareEnrollmentHandler) KeyshareEnrollmentDeleted(manager irma.Schem
func (h *keyshareEnrollmentHandler) KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier) {
h.fail(errors.New("Keyshare enrollment failed: unenrolled"))
}
func (h *keyshareEnrollmentHandler) UnsatisfiableRequest(ServerName irma.TranslatedString, missing map[int]map[int]irma.AttributeCon) {
func (h *keyshareEnrollmentHandler) UnsatisfiableRequest(request irma.SessionRequest, ServerName irma.TranslatedString, missing map[int]map[int]irma.AttributeCon) {
h.fail(errors.New("Keyshare enrollment failed: unsatisfiable"))
}
......@@ -31,17 +31,29 @@ type Handler interface {
Success(result string)
Cancelled()
Failure(err *irma.SessionError)
UnsatisfiableRequest(ServerName irma.TranslatedString, missing map[int]map[int]irma.AttributeCon)
UnsatisfiableRequest(request irma.SessionRequest,
ServerName irma.TranslatedString,
missing map[int]map[int]irma.AttributeCon)
KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int)
KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier)
KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier)
KeyshareEnrollmentDeleted(manager irma.SchemeManagerIdentifier)
RequestIssuancePermission(request *irma.IssuanceRequest, candidates [][][]*irma.AttributeIdentifier, ServerName irma.TranslatedString, callback PermissionHandler)
RequestVerificationPermission(request *irma.DisclosureRequest, candidates [][][]*irma.AttributeIdentifier, ServerName irma.TranslatedString, callback PermissionHandler)
RequestSignaturePermission(request *irma.SignatureRequest, candidates [][][]*irma.AttributeIdentifier, ServerName irma.TranslatedString, callback PermissionHandler)
RequestSchemeManagerPermission(manager *irma.SchemeManager, callback func(proceed bool))
RequestIssuancePermission(request *irma.IssuanceRequest,
candidates [][][]*irma.AttributeIdentifier,
ServerName irma.TranslatedString,
callback PermissionHandler)
RequestVerificationPermission(request *irma.DisclosureRequest,
candidates [][][]*irma.AttributeIdentifier,
ServerName irma.TranslatedString,
callback PermissionHandler)
RequestSignaturePermission(request *irma.SignatureRequest,
candidates [][][]*irma.AttributeIdentifier,
ServerName irma.TranslatedString,
callback PermissionHandler)
RequestSchemeManagerPermission(manager *irma.SchemeManager,
callback func(proceed bool))
RequestPin(remainingAttempts int, callback PinHandler)
}
......@@ -266,7 +278,7 @@ func (session *session) processSessionInfo() {
candidates, missing := session.client.CheckSatisfiability(session.request.Disclosure().Disclose)
if len(missing) > 0 {
session.Handler.UnsatisfiableRequest(session.ServerName, missing)
session.Handler.UnsatisfiableRequest(session.request, session.ServerName, missing)
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment