Skip to content
GitLab
Menu
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
5d5ce148
Commit
5d5ce148
authored
Aug 30, 2018
by
Sietse Ringers
Browse files
Also add Action getter to SessionRequest
parent
00988615
Changes
1
Hide whitespace changes
Inline
Side-by-side
requests.go
View file @
5d5ce148
...
...
@@ -140,6 +140,7 @@ type SessionRequest interface {
SetDisclosureChoice
(
choice
*
DisclosureChoice
)
SetCandidates
(
candidates
[][]
*
AttributeIdentifier
)
Identifiers
()
*
IrmaIdentifierSet
Action
()
Action
}
// Timestamp is a time.Time that marshals to Unix timestamps.
...
...
@@ -291,6 +292,8 @@ func (ir *IssuanceRequest) GetNonce() *big.Int { return ir.Nonce }
// SetNonce sets the nonce of this session.
func
(
ir
*
IssuanceRequest
)
SetNonce
(
nonce
*
big
.
Int
)
{
ir
.
Nonce
=
nonce
}
func
(
ir
*
IssuanceRequest
)
Action
()
Action
{
return
ActionIssuing
}
func
(
ir
*
IssuanceRequest
)
Validate
()
error
{
if
ir
.
Type
!=
ActionIssuing
{
return
errors
.
New
(
"Not an issuance request"
)
...
...
@@ -335,6 +338,8 @@ func (dr *DisclosureRequest) GetNonce() *big.Int { return dr.Nonce }
// SetNonce sets the nonce of this session.
func
(
dr
*
DisclosureRequest
)
SetNonce
(
nonce
*
big
.
Int
)
{
dr
.
Nonce
=
nonce
}
func
(
dr
*
DisclosureRequest
)
Action
()
Action
{
return
ActionDisclosing
}
func
(
dr
*
DisclosureRequest
)
Validate
()
error
{
if
dr
.
Type
!=
ActionDisclosing
{
return
errors
.
New
(
"Not a disclosure request"
)
...
...
@@ -372,6 +377,8 @@ func (sr *SignatureRequest) SignatureFromMessage(message interface{}) (*SignedMe
},
nil
}
func
(
sr
*
SignatureRequest
)
Action
()
Action
{
return
ActionSigning
}
func
(
sr
*
SignatureRequest
)
Validate
()
error
{
if
sr
.
Type
!=
ActionSigning
{
return
errors
.
New
(
"Not a signature request"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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