Commit 81ca5240 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Add json marshal tags to irma.SessionResult for consistency with other messages

parent f41727ca
......@@ -43,7 +43,7 @@ func (session *session) onUpdate() {
func (session *session) fail(err server.Error, message string) *irma.RemoteError {
rerr := server.RemoteError(err, message)
session.setStatus(server.StatusCancelled)
session.result = &server.SessionResult{Err: rerr, Token: session.token, Status: server.StatusCancelled}
session.result = &server.SessionResult{Err: rerr, Token: session.token, Status: server.StatusCancelled, Type: session.action}
return rerr
}
......
......@@ -52,13 +52,13 @@ type Configuration struct {
// SessionResult contains session information such as the session status, type, possible errors,
// and disclosed attributes or attribute-based signature if appropriate to the session type.
type SessionResult struct {
Token string
Status Status
Type irma.Action
ProofStatus irma.ProofStatus
Disclosed []*irma.DisclosedAttribute
Signature *irma.SignedMessage
Err *irma.RemoteError
Token string `json:"token"`
Status Status `json:"status"`
Type irma.Action `json:"type"'`
ProofStatus irma.ProofStatus `json:"proofStatus,omitempty"`
Disclosed []*irma.DisclosedAttribute `json:"disclosed,omitempty"`
Signature *irma.SignedMessage `json:"signature,omitempty"`
Err *irma.RemoteError `json:"error,omitempty"`
}
// Status is the status of an IRMA session.
......
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