Commit c39104ea authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Merge branch 'master' into timestamp

parents 4b7eda2a 1cb8de5d
......@@ -25,7 +25,7 @@ type keyshareSessionHandler interface {
KeyshareDone(message interface{})
KeyshareCancelled()
KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int)
KeyshareRegistrationIncomplete(manager irma.SchemeManagerIdentifier)
KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier)
// In errors the manager may be nil, as not all keyshare errors have a clearly associated scheme manager
KeyshareError(manager *irma.SchemeManagerIdentifier, err error)
KeysharePin()
......@@ -221,7 +221,7 @@ func (ks *keyshareSession) fail(manager irma.SchemeManagerIdentifier, err error)
if serr.ApiError != nil && len(serr.ApiError.ErrorName) > 0 {
switch serr.ApiError.ErrorName {
case "USER_NOT_REGISTERED":
ks.sessionHandler.KeyshareRegistrationIncomplete(manager)
ks.sessionHandler.KeyshareEnrollmentIncomplete(manager)
case "USER_BLOCKED":
duration, err := strconv.Atoi(serr.ApiError.Message)
if err != nil { // Not really clear what to do with duration, but should never happen anyway
......
......@@ -73,7 +73,7 @@ func (sh *ManualSessionHandler) RequestSignaturePermission(request irma.Signatur
func (sh *ManualSessionHandler) Cancelled(irmaAction irma.Action) {
sh.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("Session was cancelled")})
}
func (sh *ManualSessionHandler) MissingKeyshareEnrollment(manager irma.SchemeManagerIdentifier) {
func (sh *ManualSessionHandler) KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier) {
sh.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.Errorf("Missing keyshare server %s", manager.String())})
}
func (sh *ManualSessionHandler) RequestIssuancePermission(request irma.IssuanceRequest, issuerName string, ph PermissionHandler) {
......@@ -97,6 +97,6 @@ func (sh *ManualSessionHandler) Failure(irmaAction irma.Action, err *irma.Sessio
func (sh *ManualSessionHandler) KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int) {
sh.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareBlocked")})
}
func (sh *ManualSessionHandler) KeyshareRegistrationIncomplete(manager irma.SchemeManagerIdentifier) {
sh.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareRegistrationIncomplete")})
func (sh *ManualSessionHandler) KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier) {
sh.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareEnrollmentIncomplete")})
}
......@@ -33,9 +33,9 @@ type Handler interface {
Failure(action irma.Action, err *irma.SessionError)
UnsatisfiableRequest(action irma.Action, ServerName string, missing irma.AttributeDisjunctionList)
MissingKeyshareEnrollment(manager irma.SchemeManagerIdentifier)
KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int)
KeyshareRegistrationIncomplete(manager irma.SchemeManagerIdentifier)
KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier)
KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier)
RequestIssuancePermission(request irma.IssuanceRequest, ServerName string, callback PermissionHandler)
RequestVerificationPermission(request irma.DisclosureRequest, ServerName string, callback PermissionHandler)
......@@ -159,7 +159,7 @@ func (session *session) checkKeyshareEnrollment() bool {
distributed := manager.Distributed()
_, enrolled := session.client.keyshareServers[id]
if distributed && !enrolled {
session.Handler.MissingKeyshareEnrollment(id)
session.Handler.KeyshareEnrollmentMissing(id)
return false
}
}
......@@ -410,8 +410,8 @@ func (session *session) KeyshareCancelled() {
session.cancel()
}
func (session *session) KeyshareRegistrationIncomplete(manager irma.SchemeManagerIdentifier) {
session.Handler.KeyshareRegistrationIncomplete(manager)
func (session *session) KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier) {
session.Handler.KeyshareEnrollmentIncomplete(manager)
}
func (session *session) KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int) {
......
......@@ -21,15 +21,15 @@ type TestHandler struct {
client *Client
}
func (th TestHandler) KeyshareRegistrationIncomplete(manager irma.SchemeManagerIdentifier) {
th.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareRegistrationIncomplete")})
func (th TestHandler) KeyshareEnrollmentIncomplete(manager irma.SchemeManagerIdentifier) {
th.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareEnrollmentIncomplete")})
}
func (th TestHandler) KeyshareBlocked(manager irma.SchemeManagerIdentifier, duration int) {
th.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.New("KeyshareBlocked")})
}
func (th TestHandler) MissingKeyshareEnrollment(manager irma.SchemeManagerIdentifier) {
func (th TestHandler) KeyshareEnrollmentMissing(manager irma.SchemeManagerIdentifier) {
th.Failure(irma.ActionUnknown, &irma.SessionError{Err: errors.Errorf("Missing keyshare server %s", manager.String())})
}
......
Supports Markdown
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