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

Remove status endpoint

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