aboutsummaryrefslogtreecommitdiff
path: root/pkg/instance/instance.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2022-04-26 20:18:19 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2022-04-26 20:24:49 +0200
commit752bf9d8e1f78b54aaefdfb90f9f1f0391cd4b6d (patch)
treecfbcad5be0c0b5c436d79ffd57fb533678b7a878 /pkg/instance/instance.go
parentc2d43fdc19f23837ab071174e70a58d63e7d506d (diff)
use http get for get-* endpoints with input
https://git.sigsum.org/sigsum/tree/doc/proposals/2022-01-get-endpoints XXX: fix go.mod after merge in sigsum-go, now rgdd's local path
Diffstat (limited to 'pkg/instance/instance.go')
-rw-r--r--pkg/instance/instance.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go
index fe05b6a..77f2e5b 100644
--- a/pkg/instance/instance.go
+++ b/pkg/instance/instance.go
@@ -45,9 +45,9 @@ func (i *Instance) Handlers() []Handler {
Handler{Instance: i, Handler: getTreeHeadToCosign, Endpoint: types.EndpointGetTreeHeadToSign, Method: http.MethodGet}, // XXX: ToCosign
Handler{Instance: i, Handler: getTreeHeadCosigned, Endpoint: types.EndpointGetTreeHeadCosigned, Method: http.MethodGet},
Handler{Instance: i, Handler: getCheckpoint, Endpoint: types.Endpoint("get-checkpoint"), Method: http.MethodGet},
- Handler{Instance: i, Handler: getConsistencyProof, Endpoint: types.EndpointGetConsistencyProof, Method: http.MethodPost},
- Handler{Instance: i, Handler: getInclusionProof, Endpoint: types.EndpointGetInclusionProof, Method: http.MethodPost},
- Handler{Instance: i, Handler: getLeaves, Endpoint: types.EndpointGetLeaves, Method: http.MethodPost},
+ Handler{Instance: i, Handler: getConsistencyProof, Endpoint: types.EndpointGetConsistencyProof, Method: http.MethodGet},
+ Handler{Instance: i, Handler: getInclusionProof, Endpoint: types.EndpointGetInclusionProof, Method: http.MethodGet},
+ Handler{Instance: i, Handler: getLeaves, Endpoint: types.EndpointGetLeaves, Method: http.MethodGet},
}
}
@@ -94,7 +94,7 @@ func (i *Instance) cosignatureRequestFromHTTP(r *http.Request) (*requests.Cosign
func (i *Instance) consistencyProofRequestFromHTTP(r *http.Request) (*requests.ConsistencyProof, error) {
var req requests.ConsistencyProof
- if err := req.FromASCII(r.Body); err != nil {
+ if err := req.FromURL(r.URL.Path); err != nil {
return nil, fmt.Errorf("FromASCII: %v", err)
}
if req.OldSize < 1 {
@@ -108,7 +108,7 @@ func (i *Instance) consistencyProofRequestFromHTTP(r *http.Request) (*requests.C
func (i *Instance) inclusionProofRequestFromHTTP(r *http.Request) (*requests.InclusionProof, error) {
var req requests.InclusionProof
- if err := req.FromASCII(r.Body); err != nil {
+ if err := req.FromURL(r.URL.Path); err != nil {
return nil, fmt.Errorf("FromASCII: %v", err)
}
if req.TreeSize < 2 {
@@ -121,7 +121,7 @@ func (i *Instance) inclusionProofRequestFromHTTP(r *http.Request) (*requests.Inc
func (i *Instance) leavesRequestFromHTTP(r *http.Request) (*requests.Leaves, error) {
var req requests.Leaves
- if err := req.FromASCII(r.Body); err != nil {
+ if err := req.FromURL(r.URL.Path); err != nil {
return nil, fmt.Errorf("FromASCII: %v", err)
}