Commit 5180c461 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Remove status endpoint

parent ff181fcb
......@@ -133,39 +133,39 @@ func HandleProtocolMessage(
status, output = responseJson(nil, session.fail(irmaserver.ErrorInvalidRequest, ""))
return
default:
if method == "POST" {
if verb == "commitments" && session.action == irma.ActionIssuing {
commitments := &gabi.IssueCommitmentMessage{}
if err := irma.UnmarshalValidate(message, commitments); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
status, output = responseJson(session.handlePostCommitments(commitments))
if method != "POST" {
status, output = responseJson(nil, session.fail(irmaserver.ErrorInvalidRequest, ""))
return
}
if verb == "commitments" && session.action == irma.ActionIssuing {
commitments := &gabi.IssueCommitmentMessage{}
if err := irma.UnmarshalValidate(message, commitments); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
if verb == "proofs" && session.action == irma.ActionDisclosing {
proofs := gabi.ProofList{}
if err := irma.UnmarshalValidate(message, &proofs); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
status, output = responseJson(session.handlePostProofs(proofs))
status, output = responseJson(session.handlePostCommitments(commitments))
return
}
if verb == "proofs" && session.action == irma.ActionDisclosing {
proofs := gabi.ProofList{}
if err := irma.UnmarshalValidate(message, &proofs); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
if verb == "proofs" && session.action == irma.ActionSigning {
signature := &irma.SignedMessage{}
if err := irma.UnmarshalValidate(message, signature); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
status, output = responseJson(session.handlePostSignature(signature))
status, output = responseJson(session.handlePostProofs(proofs))
return
}
if verb == "proofs" && session.action == irma.ActionSigning {
signature := &irma.SignedMessage{}
if err := irma.UnmarshalValidate(message, signature); err != nil {
status, output = responseJson(nil, session.fail(irmaserver.ErrorMalformedInput, ""))
return
}
}
if method == "GET" && verb == "status" {
status, output = responseJson(session.handleGetStatus(), nil)
status, output = responseJson(session.handlePostSignature(signature))
return
}
status, output = responseJson(nil, session.fail(irmaserver.ErrorInvalidRequest, ""))
return
}
......
......@@ -40,10 +40,6 @@ func (session *session) handleGetRequest(min, max *irma.ProtocolVersion) (irma.S
return session.request, nil
}
func (session *session) handleGetStatus() irmaserver.Status {
return session.status
}
func (session *session) handlePostSignature(signature *irma.SignedMessage) (*irma.ProofStatus, *irma.RemoteError) {
if session.status != irmaserver.StatusConnected {
return nil, getError(irmaserver.ErrorUnexpectedRequest, "Session not yet started or already finished")
......
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