Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
6a28eb8f
Commit
6a28eb8f
authored
Apr 23, 2019
by
Sietse Ringers
Browse files
feat: include session request in UnsatisfiableRequest callback
parent
79a16c29
Changes
3
Hide whitespace changes
Inline
Side-by-side
internal/sessiontest/handlers_test.go
View file @
6a28eb8f
...
...
@@ -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"
),
})
...
...
irmaclient/handlers.go
View file @
6a28eb8f
...
...
@@ -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"
))
}
irmaclient/session.go
View file @
6a28eb8f
...
...
@@ -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
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment