From 752bf9d8e1f78b54aaefdfb90f9f1f0391cd4b6d Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 26 Apr 2022 20:18:19 +0200 Subject: 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 --- pkg/instance/instance.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg/instance/instance.go') 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) } -- cgit v1.2.3