From 4a4a4e17d159070ceb7ab7a580c8be6ad2c57e06 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Tue, 14 Dec 2021 22:56:15 +0100 Subject: instance: Add experimental checkpoint endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds an experimental endpoint that serves the log's to-sign tree head formatted as a signed checkpoint. See documentation at: https://github.com/transparency-dev/formats/tree/main/log#readme If we decide to adopt this endpoint we should consider in more detail what the origin string should be. Right now, it is assumed that the log's configured prefix is unique across the set of all sigsum logs. Example output: ``` $ echo "Public verification key: $vk" Public verification key: 8cf3ac85aadd42891c5ae9aef27244cb2a546a2312f80020aad3f2ae1af73314 $ $ echo "Formatted as a note key: $vkNote" Formatted as a note key: sigsum.org:testonly+8de2c54b+AYzzrIWq3UKJHFrprvJyRMsqVGojEvgAIKrT8q4a9zMU $ $ curl http://localhost:6965/testonly/sigsum/v0/get-checkpoint sigsum.org:testonly 23 HSt6W8ve4/36xAIf04qDOqaKLaKqSOUqKxLNrkK74+g= — sigsum.org:testonly jeLFS4WQDEeTavbiYArHzCQUPXbQ1Y/V8/dKJlBxqOAY4eLhSh3uWNJ8YXp1vs/zR4SDNHI+6UybLmHmFlg/VSf5OAs= ``` --- pkg/instance/instance.go | 1 + 1 file changed, 1 insertion(+) (limited to 'pkg/instance/instance.go') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index bda553d..4dff31a 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -55,6 +55,7 @@ func (i *Instance) Handlers() []Handler { Handler{Instance: i, Handler: getTreeHeadLatest, Endpoint: types.EndpointGetTreeHeadLatest, Method: http.MethodGet}, Handler{Instance: i, Handler: getTreeHeadToSign, Endpoint: types.EndpointGetTreeHeadToSign, Method: http.MethodGet}, 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}, -- cgit v1.2.3