From 1d5458fa7c95fe84c1c2dcd27d3e4d097703a335 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 19:04:12 +0000 Subject: [PATCH] Update module github.com/containers/image/v5 to v5.26.0 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 28 +- go.sum | 58 +- .../mergo/.deepsource.toml | 2 +- .../imdario => dario.cat}/mergo/.gitignore | 0 .../imdario => dario.cat}/mergo/.travis.yml | 0 .../mergo/CODE_OF_CONDUCT.md | 0 .../mergo/CONTRIBUTING.md | 0 .../imdario => dario.cat}/mergo/LICENSE | 0 .../imdario => dario.cat}/mergo/README.md | 22 +- .../imdario => dario.cat}/mergo/SECURITY.md | 0 .../imdario => dario.cat}/mergo/doc.go | 43 +- .../imdario => dario.cat}/mergo/map.go | 0 .../imdario => dario.cat}/mergo/merge.go | 0 .../imdario => dario.cat}/mergo/mergo.go | 0 .../containers/image/v5/copy/multiple.go | 85 +- .../containers/image/v5/copy/single.go | 8 +- .../image/v5/docker/docker_client.go | 15 +- .../internal/manifest/docker_schema2_list.go | 74 +- .../image/v5/internal/manifest/list.go | 35 + .../image/v5/internal/manifest/oci_index.go | 132 +- .../image/v5/openshift/openshift-copies.go | 4 +- .../containers/image/v5/version/version.go | 6 +- vendor/github.com/go-openapi/swag/util.go | 16 +- vendor/github.com/google/trillian/.gitignore | 25 - .../github.com/google/trillian/.golangci.yaml | 20 - vendor/github.com/google/trillian/AUTHORS | 14 - .../github.com/google/trillian/CHANGELOG.md | 1166 ---------- vendor/github.com/google/trillian/CODEOWNERS | 21 - .../google/trillian/CONTRIBUTING.md | 58 - .../github.com/google/trillian/CONTRIBUTORS | 39 - vendor/github.com/google/trillian/LICENSE | 202 -- .../google/trillian/PULL_REQUEST_TEMPLATE.md | 15 - vendor/github.com/google/trillian/README.md | 317 --- .../google/trillian/cloudbuild.yaml | 186 -- .../google/trillian/cloudbuild_master.yaml | 165 -- .../google/trillian/cloudbuild_pr.yaml | 175 -- .../google/trillian/cloudbuild_tag.yaml | 51 - vendor/github.com/google/trillian/codecov.yml | 22 - vendor/github.com/google/trillian/gen.go | 22 - .../github.com/google/trillian/trillian.pb.go | 808 ------- .../github.com/google/trillian/trillian.proto | 241 -- .../google/trillian/trillian_admin_api.pb.go | 621 ----- .../google/trillian/trillian_admin_api.proto | 107 - .../trillian/trillian_admin_api_grpc.pb.go | 334 --- .../google/trillian/trillian_log_api.pb.go | 2069 ----------------- .../google/trillian/trillian_log_api.proto | 363 --- .../trillian/trillian_log_api_grpc.pb.go | 487 ---- .../google/trillian/types/internal/tls/tls.go | 713 ------ .../google/trillian/types/logroot.go | 102 - .../hashicorp/go-retryablehttp/CHANGELOG.md | 9 + .../hashicorp/go-retryablehttp/CODEOWNERS | 1 + .../hashicorp/go-retryablehttp/LICENSE | 2 + .../hashicorp/go-retryablehttp/client.go | 16 +- .../go-retryablehttp/roundtripper.go | 3 + .../sigstore/rekor/pkg/util/checkpoint.go | 7 +- .../sigstore/pkg/signature/payload/payload.go | 23 +- vendor/golang.org/x/net/http2/server.go | 9 +- vendor/golang.org/x/net/http2/transport.go | 21 +- vendor/golang.org/x/net/http2/writesched.go | 3 +- .../x/net/http2/writesched_roundrobin.go | 119 + vendor/golang.org/x/sync/errgroup/errgroup.go | 10 +- vendor/golang.org/x/sync/errgroup/go120.go | 14 + .../golang.org/x/sync/errgroup/pre_go120.go | 15 + .../types/known/fieldmaskpb/field_mask.pb.go | 588 ----- vendor/modules.txt | 42 +- 65 files changed, 604 insertions(+), 9149 deletions(-) rename vendor/{github.com/imdario => dario.cat}/mergo/.deepsource.toml (72%) rename vendor/{github.com/imdario => dario.cat}/mergo/.gitignore (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/.travis.yml (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/CODE_OF_CONDUCT.md (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/CONTRIBUTING.md (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/LICENSE (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/README.md (95%) rename vendor/{github.com/imdario => dario.cat}/mergo/SECURITY.md (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/doc.go (88%) rename vendor/{github.com/imdario => dario.cat}/mergo/map.go (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/merge.go (100%) rename vendor/{github.com/imdario => dario.cat}/mergo/mergo.go (100%) delete mode 100644 vendor/github.com/google/trillian/.gitignore delete mode 100644 vendor/github.com/google/trillian/.golangci.yaml delete mode 100644 vendor/github.com/google/trillian/AUTHORS delete mode 100644 vendor/github.com/google/trillian/CHANGELOG.md delete mode 100644 vendor/github.com/google/trillian/CODEOWNERS delete mode 100644 vendor/github.com/google/trillian/CONTRIBUTING.md delete mode 100644 vendor/github.com/google/trillian/CONTRIBUTORS delete mode 100644 vendor/github.com/google/trillian/LICENSE delete mode 100644 vendor/github.com/google/trillian/PULL_REQUEST_TEMPLATE.md delete mode 100644 vendor/github.com/google/trillian/README.md delete mode 100644 vendor/github.com/google/trillian/cloudbuild.yaml delete mode 100644 vendor/github.com/google/trillian/cloudbuild_master.yaml delete mode 100644 vendor/github.com/google/trillian/cloudbuild_pr.yaml delete mode 100644 vendor/github.com/google/trillian/cloudbuild_tag.yaml delete mode 100644 vendor/github.com/google/trillian/codecov.yml delete mode 100644 vendor/github.com/google/trillian/gen.go delete mode 100644 vendor/github.com/google/trillian/trillian.pb.go delete mode 100644 vendor/github.com/google/trillian/trillian.proto delete mode 100644 vendor/github.com/google/trillian/trillian_admin_api.pb.go delete mode 100644 vendor/github.com/google/trillian/trillian_admin_api.proto delete mode 100644 vendor/github.com/google/trillian/trillian_admin_api_grpc.pb.go delete mode 100644 vendor/github.com/google/trillian/trillian_log_api.pb.go delete mode 100644 vendor/github.com/google/trillian/trillian_log_api.proto delete mode 100644 vendor/github.com/google/trillian/trillian_log_api_grpc.pb.go delete mode 100644 vendor/github.com/google/trillian/types/internal/tls/tls.go delete mode 100644 vendor/github.com/google/trillian/types/logroot.go create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md create mode 100644 vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS create mode 100644 vendor/golang.org/x/net/http2/writesched_roundrobin.go create mode 100644 vendor/golang.org/x/sync/errgroup/go120.go create mode 100644 vendor/golang.org/x/sync/errgroup/pre_go120.go delete mode 100644 vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go diff --git a/go.mod b/go.mod index c30930708a..45349fbfc4 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/containers/common v0.53.0 - github.com/containers/image/v5 v5.25.1-0.20230530235238-e14c1c5f94d0 + github.com/containers/image/v5 v5.26.0 github.com/containers/ocicrypt v1.1.7 github.com/containers/storage v1.47.0 github.com/docker/distribution v2.8.2+incompatible @@ -22,6 +22,7 @@ require ( ) require ( + dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.3.2 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -33,7 +34,7 @@ require ( github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect github.com/coreos/go-oidc/v3 v3.6.0 // indirect - github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect + github.com/cyberphone/json-canonicalization v0.0.0-20230514072755-504adb8a8af1 // indirect github.com/cyphar/filepath-securejoin v0.2.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/docker/docker v24.0.2+incompatible // indirect @@ -52,21 +53,20 @@ require ( github.com/go-openapi/runtime v0.26.0 // indirect github.com/go-openapi/spec v0.20.9 // indirect github.com/go-openapi/strfmt v0.21.7 // indirect - github.com/go-openapi/swag v0.22.3 // indirect + github.com/go-openapi/swag v0.22.4 // indirect github.com/go-openapi/validate v0.22.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-containerregistry v0.15.2 // indirect github.com/google/go-intervals v0.0.2 // indirect - github.com/google/trillian v1.5.2 // indirect + github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c // indirect github.com/google/uuid v1.3.0 // indirect github.com/gorilla/mux v1.8.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.2 // indirect - github.com/imdario/mergo v0.3.16 // indirect + github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect @@ -95,11 +95,11 @@ require ( github.com/russross/blackfriday v2.0.0+incompatible // indirect github.com/segmentio/ksuid v1.0.4 // indirect github.com/sigstore/fulcio v1.3.1 // indirect - github.com/sigstore/rekor v1.2.2-0.20230529154427-55a5a338d149 // indirect - github.com/sigstore/sigstore v1.6.5 // indirect + github.com/sigstore/rekor v1.2.2-0.20230601122533-4c81ff246d12 // indirect + github.com/sigstore/sigstore v1.7.1 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 // indirect - github.com/sylabs/sif/v2 v2.11.4 // indirect + github.com/sylabs/sif/v2 v2.11.5 // indirect github.com/tchap/go-patricia/v2 v2.3.1 // indirect github.com/theupdateframework/go-tuf v0.5.2 // indirect github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect @@ -115,13 +115,13 @@ require ( go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/otel v1.15.0 // indirect go.opentelemetry.io/otel/trace v1.15.0 // indirect - golang.org/x/crypto v0.9.0 // indirect + golang.org/x/crypto v0.10.0 // indirect golang.org/x/mod v0.10.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect - golang.org/x/sync v0.2.0 // indirect + golang.org/x/net v0.11.0 // indirect + golang.org/x/oauth2 v0.9.0 // indirect + golang.org/x/sync v0.3.0 // indirect golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/text v0.10.0 // indirect golang.org/x/tools v0.8.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect diff --git a/go.sum b/go.sum index f7ddccee89..68dfaae417 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 h1:SCbEWT58NSt7d2mcFdvxC9uyrdcTfvBbPLThhkDmXzg= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= @@ -30,8 +32,8 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSk github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/containers/common v0.53.0 h1:Ax814cLeX5VXSnkKUdxz762g+27fJj1st4UvKoXmkKs= github.com/containers/common v0.53.0/go.mod h1:pABPxJwlTE8oYk9/2BW0e0mumkuhJHIPsABHTGRXN3w= -github.com/containers/image/v5 v5.25.1-0.20230530235238-e14c1c5f94d0 h1:8ixt9sbyRvFU37arzxRCQbQ9Z5CZkOvurgsXVT3+k/M= -github.com/containers/image/v5 v5.25.1-0.20230530235238-e14c1c5f94d0/go.mod h1:8YGnE7MmUBJq3i1UJ+NuMQ5mIqG9LTgh/cdQ8OE5bJ0= +github.com/containers/image/v5 v5.26.0 h1:P9H4+N/7fTTClnFthIWgJU+0LBkhGlW2tCWR+UNG0Vs= +github.com/containers/image/v5 v5.26.0/go.mod h1:QSW67adLL/B4eYsFPG6TjH5Ye4LiLazPAGWk5oQnUdQ= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.1.7 h1:thhNr4fu2ltyGz8aMx8u48Ae0Pnbip3ePP9/mzkZ/3U= @@ -42,8 +44,8 @@ github.com/coreos/go-oidc/v3 v3.6.0 h1:AKVxfYw1Gmkn/w96z0DbT/B/xFnzTd3MkZvWLjF4n github.com/coreos/go-oidc/v3 v3.6.0/go.mod h1:ZpHUsHBucTUj6WOkrP4E20UPynbLZzhTQ1XKCXkxyPc= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 h1:vU+EP9ZuFUCYE0NYLwTSob+3LNEJATzNfP/DC7SWGWI= -github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= +github.com/cyberphone/json-canonicalization v0.0.0-20230514072755-504adb8a8af1 h1:8Pq5UNTC+/UfvcOPKQGZoKCkeF+ZaKa4wJ9OS2gsQQM= +github.com/cyberphone/json-canonicalization v0.0.0-20230514072755-504adb8a8af1/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -107,11 +109,11 @@ github.com/go-openapi/strfmt v0.21.7/go.mod h1:adeGTkxE44sPyLk0JV235VQAO/ZXUr8KA github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= +github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/validate v0.22.1 h1:G+c2ub6q47kfX1sOBLwIQwzBVt8qmOAARyo/9Fqs9NU= github.com/go-openapi/validate v0.22.1/go.mod h1:rjnrwK57VJ7A8xqfpAOEKRH8yQSGUriMu5/zuPSQ1hg= -github.com/go-rod/rod v0.113.1 h1:+Qb4K/vkR7BOhW6FhfhtLzUD3l11+0XlF4do+27sOQk= +github.com/go-rod/rod v0.113.3 h1:oLiKZW721CCMwA5g7977cWfcAKQ+FuosP47Zf1QiDrA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= @@ -175,8 +177,7 @@ github.com/google/go-intervals v0.0.2 h1:FGrVEiUnTRKR8yE04qzXYaJMtnIYqobR5QbblK3 github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c h1:lvddKcYTQ545ADhBujtIJmqQrZBDsGo7XIMbAQe/sNY= -github.com/google/trillian v1.5.2 h1:roGP6G8aaAch7vP08+oitPkvmZzxjTfIkguozqJ04Ok= -github.com/google/trillian v1.5.2/go.mod h1:H8vOoa2dxd3xCdMzOOwt9kIz/3MSoJhcqLJGG8iRwbg= +github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -193,12 +194,10 @@ github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxC github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= -github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= +github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/honeycombio/beeline-go v1.10.0 h1:cUDe555oqvw8oD76BQJ8alk7FP0JZ/M/zXpNvOEDLDc= github.com/honeycombio/libhoney-go v1.16.0 h1:kPpqoz6vbOzgp7jC6SR7SkNj7rua7rgxvznI6M3KdHc= -github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= -github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= @@ -312,10 +311,10 @@ github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/sigstore/fulcio v1.3.1 h1:0ntW9VbQbt2JytoSs8BOGB84A65eeyvGSavWteYp29Y= github.com/sigstore/fulcio v1.3.1/go.mod h1:/XfqazOec45ulJZpyL9sq+OsVQ8g2UOVoNVi7abFgqU= -github.com/sigstore/rekor v1.2.2-0.20230529154427-55a5a338d149 h1:nq4M06IMfNREIBMkCGVyQQJMTZi5YNqeoaVV9yzIARU= -github.com/sigstore/rekor v1.2.2-0.20230529154427-55a5a338d149/go.mod h1:LiLDoAgQf+dFuuRg8y+iXBJekKkQueIrpcKzDYcUnvQ= -github.com/sigstore/sigstore v1.6.5 h1:/liHIo7YPJp6sN31DzBYDOuRPmN1xbzROMBE5DLllYM= -github.com/sigstore/sigstore v1.6.5/go.mod h1:h+EoQsf9+6UKgNYxKhBcPgo4PZeEVfzAJxKRRIYhyN4= +github.com/sigstore/rekor v1.2.2-0.20230601122533-4c81ff246d12 h1:x/WnxasgR40qGY67IHwioakXLuhDxJ10vF8/INuOTiI= +github.com/sigstore/rekor v1.2.2-0.20230601122533-4c81ff246d12/go.mod h1:8c+a8Yo7r8gKuYbIaz+c3oOdw9iMXx+tMdOg2+b+2jQ= +github.com/sigstore/sigstore v1.7.1 h1:fCATemikcBK0cG4+NcM940MfoIgmioY1vC6E66hXxks= +github.com/sigstore/sigstore v1.7.1/go.mod h1:0PmMzfJP2Y9+lugD0wer4e7TihR5tM7NcIs3bQNk5xg= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -346,8 +345,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/sylabs/sif/v2 v2.11.4 h1:4dRvsRFVkyS7e8oD8AEL0HrJocnet05+EFW+DhVb/Ic= -github.com/sylabs/sif/v2 v2.11.4/go.mod h1:83kqbKZFRFfFLe1ui5BH+rAxF2obICM/i3zto4ivM7s= +github.com/sylabs/sif/v2 v2.11.5 h1:7ssPH3epSonsTrzbS1YxeJ9KuqAN7ISlSM61a7j/mQM= +github.com/sylabs/sif/v2 v2.11.5/go.mod h1:GBoZs9LU3e4yJH1dcZ3Akf/jsqYgy5SeguJQC+zd75Y= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia/v2 v2.3.1 h1:6rQp39lgIYZ+MHmdEq4xzuk1t7OdC35z/xm0BGhTkes= @@ -415,8 +414,8 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= +golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 h1:k/i9J1pBpvlfR+9QsetwPyERsqu1GIbi967PQMq3Ivc= golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= @@ -440,11 +439,11 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU= +golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.9.0 h1:BPpt2kU7oMRq3kCHAA1tbSEshXRw1LpG2ztgDwrzuAs= +golang.org/x/oauth2 v0.9.0/go.mod h1:qYgFZaFiu6Wg24azG8bdV52QJXJGbZzIIsRCdVKzbLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -453,8 +452,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= -golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -484,8 +483,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.10.0 h1:UpjohKhiEgNc0CSauXmwYftY1+LlaC75SJwh0SgCX58= +golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -560,4 +559,3 @@ gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= diff --git a/vendor/github.com/imdario/mergo/.deepsource.toml b/vendor/dario.cat/mergo/.deepsource.toml similarity index 72% rename from vendor/github.com/imdario/mergo/.deepsource.toml rename to vendor/dario.cat/mergo/.deepsource.toml index 8a0681af85..a8bc979e02 100644 --- a/vendor/github.com/imdario/mergo/.deepsource.toml +++ b/vendor/dario.cat/mergo/.deepsource.toml @@ -9,4 +9,4 @@ name = "go" enabled = true [analyzers.meta] - import_path = "github.com/imdario/mergo" \ No newline at end of file + import_path = "dario.cat/mergo" \ No newline at end of file diff --git a/vendor/github.com/imdario/mergo/.gitignore b/vendor/dario.cat/mergo/.gitignore similarity index 100% rename from vendor/github.com/imdario/mergo/.gitignore rename to vendor/dario.cat/mergo/.gitignore diff --git a/vendor/github.com/imdario/mergo/.travis.yml b/vendor/dario.cat/mergo/.travis.yml similarity index 100% rename from vendor/github.com/imdario/mergo/.travis.yml rename to vendor/dario.cat/mergo/.travis.yml diff --git a/vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md b/vendor/dario.cat/mergo/CODE_OF_CONDUCT.md similarity index 100% rename from vendor/github.com/imdario/mergo/CODE_OF_CONDUCT.md rename to vendor/dario.cat/mergo/CODE_OF_CONDUCT.md diff --git a/vendor/github.com/imdario/mergo/CONTRIBUTING.md b/vendor/dario.cat/mergo/CONTRIBUTING.md similarity index 100% rename from vendor/github.com/imdario/mergo/CONTRIBUTING.md rename to vendor/dario.cat/mergo/CONTRIBUTING.md diff --git a/vendor/github.com/imdario/mergo/LICENSE b/vendor/dario.cat/mergo/LICENSE similarity index 100% rename from vendor/github.com/imdario/mergo/LICENSE rename to vendor/dario.cat/mergo/LICENSE diff --git a/vendor/github.com/imdario/mergo/README.md b/vendor/dario.cat/mergo/README.md similarity index 95% rename from vendor/github.com/imdario/mergo/README.md rename to vendor/dario.cat/mergo/README.md index ffbbb62c70..7d0cf9f32a 100644 --- a/vendor/github.com/imdario/mergo/README.md +++ b/vendor/dario.cat/mergo/README.md @@ -46,13 +46,19 @@ Also a lovely [comune](http://en.wikipedia.org/wiki/Mergo) (municipality) in the It is ready for production use. [It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, Microsoft, etc](https://github.com/imdario/mergo#mergo-in-the-wild). -### Important note +### Important notes + +#### 1.0.0 + +In [1.0.0](//github.com/imdario/mergo/releases/tag/1.0.0) Mergo moves to a vanity URL `dario.cat/mergo`. + +#### 0.3.9 Please keep in mind that a problematic PR broke [0.3.9](//github.com/imdario/mergo/releases/tag/0.3.9). I reverted it in [0.3.10](//github.com/imdario/mergo/releases/tag/0.3.10), and I consider it stable but not bug-free. Also, this version adds support for go modules. Keep in mind that in [0.3.2](//github.com/imdario/mergo/releases/tag/0.3.2), Mergo changed `Merge()`and `Map()` signatures to support [transformers](#transformers). I added an optional/variadic argument so that it won't break the existing code. -If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u github.com/imdario/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). +If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with ```go get -u dario.cat/mergo```. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). ### Donations @@ -110,11 +116,11 @@ If Mergo is useful to you, consider buying me a coffee, a beer, or making a mont ## Install - go get github.com/imdario/mergo + go get dario.cat/mergo // use in your .go code import ( - "github.com/imdario/mergo" + "dario.cat/mergo" ) ## Usage @@ -152,7 +158,7 @@ package main import ( "fmt" - "github.com/imdario/mergo" + "dario.cat/mergo" ) type Foo struct { @@ -188,9 +194,9 @@ package main import ( "fmt" - "github.com/imdario/mergo" - "reflect" - "time" + "dario.cat/mergo" + "reflect" + "time" ) type timeTransformer struct { diff --git a/vendor/github.com/imdario/mergo/SECURITY.md b/vendor/dario.cat/mergo/SECURITY.md similarity index 100% rename from vendor/github.com/imdario/mergo/SECURITY.md rename to vendor/dario.cat/mergo/SECURITY.md diff --git a/vendor/github.com/imdario/mergo/doc.go b/vendor/dario.cat/mergo/doc.go similarity index 88% rename from vendor/github.com/imdario/mergo/doc.go rename to vendor/dario.cat/mergo/doc.go index fcd985f995..7d96ec0546 100644 --- a/vendor/github.com/imdario/mergo/doc.go +++ b/vendor/dario.cat/mergo/doc.go @@ -8,30 +8,36 @@ A helper to merge structs and maps in Golang. Useful for configuration default v Mergo merges same-type structs and maps by setting default values in zero-value fields. Mergo won't merge unexported (private) fields. It will do recursively any exported one. It also won't merge structs inside maps (because they are not addressable using Go reflection). -Status +# Status It is ready for production use. It is used in several projects by Docker, Google, The Linux Foundation, VMWare, Shopify, etc. -Important note +# Important notes + +1.0.0 + +In 1.0.0 Mergo moves to a vanity URL `dario.cat/mergo`. + +0.3.9 Please keep in mind that a problematic PR broke 0.3.9. We reverted it in 0.3.10. We consider 0.3.10 as stable but not bug-free. . Also, this version adds suppot for go modules. Keep in mind that in 0.3.2, Mergo changed Merge() and Map() signatures to support transformers. We added an optional/variadic argument so that it won't break the existing code. -If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u github.com/imdario/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). +If you were using Mergo before April 6th, 2015, please check your project works as intended after updating your local copy with go get -u dario.cat/mergo. I apologize for any issue caused by its previous behavior and any future bug that Mergo could cause in existing projects after the change (release 0.2.0). -Install +# Install Do your usual installation procedure: - go get github.com/imdario/mergo + go get dario.cat/mergo - // use in your .go code - import ( - "github.com/imdario/mergo" - ) + // use in your .go code + import ( + "dario.cat/mergo" + ) -Usage +# Usage You can only merge same-type structs with exported fields initialized as zero value of their type and same-types maps. Mergo won't merge unexported (private) fields but will do recursively any exported one. It won't merge empty structs value as they are zero values too. Also, maps will be merged recursively except for structs inside maps (because they are not addressable using Go reflection). @@ -59,7 +65,7 @@ Here is a nice example: import ( "fmt" - "github.com/imdario/mergo" + "dario.cat/mergo" ) type Foo struct { @@ -81,7 +87,7 @@ Here is a nice example: // {two 2} } -Transformers +# Transformers Transformers allow to merge specific types differently than in the default behavior. In other words, now you can customize how some types are merged. For example, time.Time is a struct; it doesn't have zero value but IsZero can return true because it has fields with zero value. How can we merge a non-zero time.Time? @@ -89,9 +95,9 @@ Transformers allow to merge specific types differently than in the default behav import ( "fmt" - "github.com/imdario/mergo" - "reflect" - "time" + "dario.cat/mergo" + "reflect" + "time" ) type timeTransformer struct { @@ -127,17 +133,16 @@ Transformers allow to merge specific types differently than in the default behav // { 2018-01-12 01:15:00 +0000 UTC m=+0.000000001 } } -Contact me +# Contact me If I can help you, you have an idea or you are using Mergo in your projects, don't hesitate to drop me a line (or a pull request): https://twitter.com/im_dario -About +# About Written by Dario Castañé: https://da.rio.hn -License +# License BSD 3-Clause license, as Go language. - */ package mergo diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/dario.cat/mergo/map.go similarity index 100% rename from vendor/github.com/imdario/mergo/map.go rename to vendor/dario.cat/mergo/map.go diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/dario.cat/mergo/merge.go similarity index 100% rename from vendor/github.com/imdario/mergo/merge.go rename to vendor/dario.cat/mergo/merge.go diff --git a/vendor/github.com/imdario/mergo/mergo.go b/vendor/dario.cat/mergo/mergo.go similarity index 100% rename from vendor/github.com/imdario/mergo/mergo.go rename to vendor/dario.cat/mergo/mergo.go diff --git a/vendor/github.com/containers/image/v5/copy/multiple.go b/vendor/github.com/containers/image/v5/copy/multiple.go index 097a18855e..41ea1b11b0 100644 --- a/vendor/github.com/containers/image/v5/copy/multiple.go +++ b/vendor/github.com/containers/image/v5/copy/multiple.go @@ -12,11 +12,41 @@ import ( internalManifest "github.com/containers/image/v5/internal/manifest" "github.com/containers/image/v5/manifest" "github.com/containers/image/v5/signature" + digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" "golang.org/x/exp/slices" ) +type instanceCopyKind int + +const ( + instanceCopyCopy instanceCopyKind = iota + instanceCopyClone +) + +type instanceCopy struct { + op instanceCopyKind + sourceDigest digest.Digest +} + +// prepareInstanceCopies prepares a list of instances which needs to copied to the manifest list. +func prepareInstanceCopies(instanceDigests []digest.Digest, options *Options) []instanceCopy { + res := []instanceCopy{} + for i, instanceDigest := range instanceDigests { + if options.ImageListSelection == CopySpecificImages && + !slices.Contains(options.Instances, instanceDigest) { + logrus.Debugf("Skipping instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests)) + continue + } + res = append(res, instanceCopy{ + op: instanceCopyCopy, + sourceDigest: instanceDigest, + }) + } + return res +} + // copyMultipleImages copies some or all of an image list's instances, using // policyContext to validate source image admissibility. func (c *copier) copyMultipleImages(ctx context.Context, policyContext *signature.PolicyContext, options *Options, unparsedToplevel *image.UnparsedImage) (copiedManifest []byte, retErr error) { @@ -88,44 +118,35 @@ func (c *copier) copyMultipleImages(ctx context.Context, policyContext *signatur // Copy each image, or just the ones we want to copy, in turn. instanceDigests := updatedList.Instances() - imagesToCopy := len(instanceDigests) - if options.ImageListSelection == CopySpecificImages { - imagesToCopy = len(options.Instances) - } - c.Printf("Copying %d of %d images in list\n", imagesToCopy, len(instanceDigests)) - updates := make([]manifest.ListUpdate, len(instanceDigests)) - instancesCopied := 0 - for i, instanceDigest := range instanceDigests { - if options.ImageListSelection == CopySpecificImages && - !slices.Contains(options.Instances, instanceDigest) { - update, err := updatedList.Instance(instanceDigest) + instanceEdits := []internalManifest.ListEdit{} + instanceCopyList := prepareInstanceCopies(instanceDigests, options) + c.Printf("Copying %d of %d images in list\n", len(instanceCopyList), len(instanceDigests)) + for i, instance := range instanceCopyList { + // Update instances to be edited by their `ListOperation` and + // populate necessary fields. + switch instance.op { + case instanceCopyCopy: + logrus.Debugf("Copying instance %s (%d/%d)", instance.sourceDigest, i+1, len(instanceCopyList)) + c.Printf("Copying image %s (%d/%d)\n", instance.sourceDigest, i+1, len(instanceCopyList)) + unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceCopyList[i].sourceDigest) + updatedManifest, updatedManifestType, updatedManifestDigest, err := c.copySingleImage(ctx, policyContext, options, unparsedToplevel, unparsedInstance, &instanceCopyList[i].sourceDigest) if err != nil { - return nil, err + return nil, fmt.Errorf("copying image %d/%d from manifest list: %w", i+1, len(instanceCopyList), err) } - logrus.Debugf("Skipping instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests)) - // Record the digest/size/type of the manifest that we didn't copy. - updates[i] = update - continue - } - logrus.Debugf("Copying instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests)) - c.Printf("Copying image %s (%d/%d)\n", instanceDigest, instancesCopied+1, imagesToCopy) - unparsedInstance := image.UnparsedInstance(c.rawSource, &instanceDigest) - updatedManifest, updatedManifestType, updatedManifestDigest, err := c.copySingleImage(ctx, policyContext, options, unparsedToplevel, unparsedInstance, &instanceDigest) - if err != nil { - return nil, fmt.Errorf("copying image %d/%d from manifest list: %w", instancesCopied+1, imagesToCopy, err) - } - instancesCopied++ - // Record the result of a possible conversion here. - update := manifest.ListUpdate{ - Digest: updatedManifestDigest, - Size: int64(len(updatedManifest)), - MediaType: updatedManifestType, + // Record the result of a possible conversion here. + instanceEdits = append(instanceEdits, internalManifest.ListEdit{ + ListOperation: internalManifest.ListOpUpdate, + UpdateOldDigest: instance.sourceDigest, + UpdateDigest: updatedManifestDigest, + UpdateSize: int64(len(updatedManifest)), + UpdateMediaType: updatedManifestType}) + default: + return nil, fmt.Errorf("copying image: invalid copy operation %d", instance.op) } - updates[i] = update } // Now reset the digest/size/types of the manifests in the list to account for any conversions that we made. - if err = updatedList.UpdateInstances(updates); err != nil { + if err = updatedList.EditInstances(instanceEdits); err != nil { return nil, fmt.Errorf("updating manifest list: %w", err) } diff --git a/vendor/github.com/containers/image/v5/copy/single.go b/vendor/github.com/containers/image/v5/copy/single.go index 9afdea73dc..b8569a70c0 100644 --- a/vendor/github.com/containers/image/v5/copy/single.go +++ b/vendor/github.com/containers/image/v5/copy/single.go @@ -256,9 +256,11 @@ func (c *copier) copySingleImage(ctx context.Context, policyContext *signature.P } sigs = append(sigs, newSigs...) - c.Printf("Storing signatures\n") - if err := c.dest.PutSignaturesWithFormat(ctx, sigs, targetInstance); err != nil { - return nil, "", "", fmt.Errorf("writing signatures: %w", err) + if len(sigs) > 0 { + c.Printf("Storing signatures\n") + if err := c.dest.PutSignaturesWithFormat(ctx, sigs, targetInstance); err != nil { + return nil, "", "", fmt.Errorf("writing signatures: %w", err) + } } return manifestBytes, retManifestType, retManifestDigest, nil diff --git a/vendor/github.com/containers/image/v5/docker/docker_client.go b/vendor/github.com/containers/image/v5/docker/docker_client.go index 570cca4836..dd9127c5ac 100644 --- a/vendor/github.com/containers/image/v5/docker/docker_client.go +++ b/vendor/github.com/containers/image/v5/docker/docker_client.go @@ -161,17 +161,6 @@ func newBearerTokenFromJSONBlob(blob []byte) (*bearerToken, error) { return token, nil } -// this is cloned from docker/go-connections because upstream docker has changed -// it and make deps here fails otherwise. -// We'll drop this once we upgrade to docker 1.13.x deps. -func serverDefault() *tls.Config { - return &tls.Config{ - // Avoid fallback to SSL protocols < TLS1.0 - MinVersion: tls.VersionTLS10, - CipherSuites: tlsconfig.DefaultServerAcceptedCiphers, - } -} - // dockerCertDir returns a path to a directory to be consumed by tlsclientconfig.SetupCertificates() depending on ctx and hostPort. func dockerCertDir(sys *types.SystemContext, hostPort string) (string, error) { if sys != nil && sys.DockerCertPath != "" { @@ -254,7 +243,9 @@ func newDockerClient(sys *types.SystemContext, registry, reference string) (*doc if registry == dockerHostname { registry = dockerRegistry } - tlsClientConfig := serverDefault() + tlsClientConfig := &tls.Config{ + CipherSuites: tlsconfig.DefaultServerAcceptedCiphers, + } // It is undefined whether the host[:port] string for dockerHostname should be dockerHostname or dockerRegistry, // because docker/docker does not read the certs.d subdirectory at all in that case. We use the user-visible diff --git a/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go b/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go index e98c5c99ec..516ca7ac94 100644 --- a/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go +++ b/vendor/github.com/containers/image/v5/internal/manifest/docker_schema2_list.go @@ -69,27 +69,71 @@ func (list *Schema2ListPublic) Instance(instanceDigest digest.Digest) (ListUpdat // UpdateInstances updates the sizes, digests, and media types of the manifests // which the list catalogs. -func (list *Schema2ListPublic) UpdateInstances(updates []ListUpdate) error { - if len(updates) != len(list.Manifests) { - return fmt.Errorf("incorrect number of update entries passed to Schema2List.UpdateInstances: expected %d, got %d", len(list.Manifests), len(updates)) +func (index *Schema2ListPublic) UpdateInstances(updates []ListUpdate) error { + editInstances := []ListEdit{} + for i, instance := range updates { + editInstances = append(editInstances, ListEdit{ + UpdateOldDigest: index.Manifests[i].Digest, + UpdateDigest: instance.Digest, + UpdateSize: instance.Size, + UpdateMediaType: instance.MediaType, + ListOperation: ListOpUpdate}) } - for i := range updates { - if err := updates[i].Digest.Validate(); err != nil { - return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances contained an invalid digest: %w", i+1, len(updates), err) - } - list.Manifests[i].Digest = updates[i].Digest - if updates[i].Size < 0 { - return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had an invalid size (%d)", i+1, len(updates), updates[i].Size) - } - list.Manifests[i].Size = updates[i].Size - if updates[i].MediaType == "" { - return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had no media type (was %q)", i+1, len(updates), list.Manifests[i].MediaType) + return index.editInstances(editInstances) +} + +func (index *Schema2ListPublic) editInstances(editInstances []ListEdit) error { + addedEntries := []Schema2ManifestDescriptor{} + for i, editInstance := range editInstances { + switch editInstance.ListOperation { + case ListOpUpdate: + if err := editInstance.UpdateOldDigest.Validate(); err != nil { + return fmt.Errorf("Schema2List.EditInstances: Attempting to update %s which is an invalid digest: %w", editInstance.UpdateOldDigest, err) + } + if err := editInstance.UpdateDigest.Validate(); err != nil { + return fmt.Errorf("Schema2List.EditInstances: Modified digest %s is an invalid digest: %w", editInstance.UpdateDigest, err) + } + targetIndex := slices.IndexFunc(index.Manifests, func(m Schema2ManifestDescriptor) bool { + return m.Digest == editInstance.UpdateOldDigest + }) + if targetIndex == -1 { + return fmt.Errorf("Schema2List.EditInstances: digest %s not found", editInstance.UpdateOldDigest) + } + index.Manifests[targetIndex].Digest = editInstance.UpdateDigest + if editInstance.UpdateSize < 0 { + return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had an invalid size (%d)", i+1, len(editInstances), editInstance.UpdateSize) + } + index.Manifests[targetIndex].Size = editInstance.UpdateSize + if editInstance.UpdateMediaType == "" { + return fmt.Errorf("update %d of %d passed to Schema2List.UpdateInstances had no media type (was %q)", i+1, len(editInstances), index.Manifests[i].MediaType) + } + index.Manifests[targetIndex].MediaType = editInstance.UpdateMediaType + case ListOpAdd: + addInstance := Schema2ManifestDescriptor{ + Schema2Descriptor{Digest: editInstance.AddDigest, Size: editInstance.AddSize, MediaType: editInstance.AddMediaType}, + Schema2PlatformSpec{ + OS: editInstance.AddPlatform.OS, + Architecture: editInstance.AddPlatform.Architecture, + OSVersion: editInstance.AddPlatform.OSVersion, + OSFeatures: editInstance.AddPlatform.OSFeatures, + Variant: editInstance.AddPlatform.Variant, + }, + } + addedEntries = append(addedEntries, addInstance) + default: + return fmt.Errorf("internal error: invalid operation: %d", editInstance.ListOperation) } - list.Manifests[i].MediaType = updates[i].MediaType + } + if len(addedEntries) != 0 { + index.Manifests = append(index.Manifests, addedEntries...) } return nil } +func (index *Schema2List) EditInstances(editInstances []ListEdit) error { + return index.editInstances(editInstances) +} + func (list *Schema2ListPublic) ChooseInstanceByCompression(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) { // ChooseInstanceByCompression is same as ChooseInstance for schema2 manifest list. return list.ChooseInstance(ctx) diff --git a/vendor/github.com/containers/image/v5/internal/manifest/list.go b/vendor/github.com/containers/image/v5/internal/manifest/list.go index 07c7d85f4c..8786324ea4 100644 --- a/vendor/github.com/containers/image/v5/internal/manifest/list.go +++ b/vendor/github.com/containers/image/v5/internal/manifest/list.go @@ -3,6 +3,7 @@ package manifest import ( "fmt" + compression "github.com/containers/image/v5/pkg/compression/types" "github.com/containers/image/v5/types" digest "github.com/opencontainers/go-digest" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" @@ -55,6 +56,10 @@ type List interface { // SystemContext ( or for the current platform if the SystemContext doesn't specify any detail ) and preferGzip for compression which // when configured to OptionalBoolTrue and chooses best available compression when it is OptionalBoolFalse or left OptionalBoolUndefined. ChooseInstanceByCompression(ctx *types.SystemContext, preferGzip types.OptionalBool) (digest.Digest, error) + // Edit information about the list's instances. Contains Slice of ListEdit where each element + // is responsible for either Modifying or Adding a new instance to the Manifest. Operation is + // selected on the basis of configured ListOperation field. + EditInstances([]ListEdit) error } // ListUpdate includes the fields which a List's UpdateInstances() method will modify. @@ -65,6 +70,36 @@ type ListUpdate struct { MediaType string } +type ListOp int + +const ( + listOpInvalid ListOp = iota + ListOpAdd + ListOpUpdate +) + +// ListEdit includes the fields which a List's EditInstances() method will modify. +type ListEdit struct { + ListOperation ListOp + + // if Op == ListEditUpdate (basically the previous UpdateInstances). All fields must be set. + UpdateOldDigest digest.Digest + UpdateDigest digest.Digest + UpdateSize int64 + UpdateMediaType string + UpdateAffectAnnotations bool + UpdateAnnotations map[string]string + UpdateCompressionAlgorithms []compression.Algorithm + + // If Op = ListEditAdd. All fields must be set. + AddDigest digest.Digest + AddSize int64 + AddMediaType string + AddPlatform *imgspecv1.Platform + AddAnnotations map[string]string + AddCompressionAlgorithms []compression.Algorithm +} + // ListPublicFromBlob parses a list of manifests. // This is publicly visible as c/image/manifest.ListFromBlob. func ListPublicFromBlob(manifest []byte, manifestMIMEType string) (ListPublic, error) { diff --git a/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go b/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go index 8e911678e8..fd251d9512 100644 --- a/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go +++ b/vendor/github.com/containers/image/v5/internal/manifest/oci_index.go @@ -7,6 +7,7 @@ import ( "runtime" platform "github.com/containers/image/v5/internal/pkg/platform" + compression "github.com/containers/image/v5/pkg/compression/types" "github.com/containers/image/v5/types" "github.com/opencontainers/go-digest" imgspec "github.com/opencontainers/image-spec/specs-go" @@ -22,7 +23,8 @@ const ( // That also suggests that this instance benefits from // Zstd compression, so it can be preferred by compatible consumers over instances that // use gzip, depending on their local policy. - OCI1InstanceAnnotationCompressionZSTD = "io.github.containers.compression.zstd" + OCI1InstanceAnnotationCompressionZSTD = "io.github.containers.compression.zstd" + OCI1InstanceAnnotationCompressionZSTDValue = "true" ) // OCI1IndexPublic is just an alias for the OCI index type, but one which we can @@ -64,26 +66,102 @@ func (index *OCI1IndexPublic) Instance(instanceDigest digest.Digest) (ListUpdate // UpdateInstances updates the sizes, digests, and media types of the manifests // which the list catalogs. func (index *OCI1IndexPublic) UpdateInstances(updates []ListUpdate) error { - if len(updates) != len(index.Manifests) { - return fmt.Errorf("incorrect number of update entries passed to OCI1Index.UpdateInstances: expected %d, got %d", len(index.Manifests), len(updates)) + editInstances := []ListEdit{} + for i, instance := range updates { + editInstances = append(editInstances, ListEdit{ + UpdateOldDigest: index.Manifests[i].Digest, + UpdateDigest: instance.Digest, + UpdateSize: instance.Size, + UpdateMediaType: instance.MediaType, + ListOperation: ListOpUpdate}) } - for i := range updates { - if err := updates[i].Digest.Validate(); err != nil { - return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances contained an invalid digest: %w", i+1, len(updates), err) - } - index.Manifests[i].Digest = updates[i].Digest - if updates[i].Size < 0 { - return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had an invalid size (%d)", i+1, len(updates), updates[i].Size) + return index.editInstances(editInstances) +} + +func addCompressionAnnotations(compressionAlgorithms []compression.Algorithm, annotationsMap map[string]string) { + // TODO: This should also delete the algorithm if map already contains an algorithm and compressionAlgorithm + // list has a different algorithm. To do that, we would need to modify the callers to always provide a reliable + // and full compressionAlghorithms list. + for _, algo := range compressionAlgorithms { + switch algo.Name() { + case compression.ZstdAlgorithmName: + annotationsMap[OCI1InstanceAnnotationCompressionZSTD] = OCI1InstanceAnnotationCompressionZSTDValue + default: + continue } - index.Manifests[i].Size = updates[i].Size - if updates[i].MediaType == "" { - return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had no media type (was %q)", i+1, len(updates), index.Manifests[i].MediaType) + } +} + +func (index *OCI1IndexPublic) editInstances(editInstances []ListEdit) error { + addedEntries := []imgspecv1.Descriptor{} + updatedAnnotations := false + for i, editInstance := range editInstances { + switch editInstance.ListOperation { + case ListOpUpdate: + if err := editInstance.UpdateOldDigest.Validate(); err != nil { + return fmt.Errorf("OCI1Index.EditInstances: Attempting to update %s which is an invalid digest: %w", editInstance.UpdateOldDigest, err) + } + if err := editInstance.UpdateDigest.Validate(); err != nil { + return fmt.Errorf("OCI1Index.EditInstances: Modified digest %s is an invalid digest: %w", editInstance.UpdateDigest, err) + } + targetIndex := slices.IndexFunc(index.Manifests, func(m imgspecv1.Descriptor) bool { + return m.Digest == editInstance.UpdateOldDigest + }) + if targetIndex == -1 { + return fmt.Errorf("OCI1Index.EditInstances: digest %s not found", editInstance.UpdateOldDigest) + } + index.Manifests[targetIndex].Digest = editInstance.UpdateDigest + if editInstance.UpdateSize < 0 { + return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had an invalid size (%d)", i+1, len(editInstances), editInstance.UpdateSize) + } + index.Manifests[targetIndex].Size = editInstance.UpdateSize + if editInstance.UpdateMediaType == "" { + return fmt.Errorf("update %d of %d passed to OCI1Index.UpdateInstances had no media type (was %q)", i+1, len(editInstances), index.Manifests[i].MediaType) + } + index.Manifests[targetIndex].MediaType = editInstance.UpdateMediaType + if editInstance.UpdateAnnotations != nil { + updatedAnnotations = true + if editInstance.UpdateAffectAnnotations { + index.Manifests[targetIndex].Annotations = maps.Clone(editInstance.UpdateAnnotations) + } else { + if index.Manifests[targetIndex].Annotations == nil { + index.Manifests[targetIndex].Annotations = map[string]string{} + } + maps.Copy(index.Manifests[targetIndex].Annotations, editInstance.UpdateAnnotations) + } + } + addCompressionAnnotations(editInstance.UpdateCompressionAlgorithms, index.Manifests[targetIndex].Annotations) + case ListOpAdd: + annotations := map[string]string{} + if editInstance.AddAnnotations != nil { + annotations = maps.Clone(editInstance.AddAnnotations) + } + addCompressionAnnotations(editInstance.AddCompressionAlgorithms, annotations) + addedEntries = append(addedEntries, imgspecv1.Descriptor{ + MediaType: editInstance.AddMediaType, + Size: editInstance.AddSize, + Digest: editInstance.AddDigest, + Platform: editInstance.AddPlatform, + Annotations: annotations}) + default: + return fmt.Errorf("internal error: invalid operation: %d", editInstance.ListOperation) } - index.Manifests[i].MediaType = updates[i].MediaType + } + if len(addedEntries) != 0 { + index.Manifests = append(index.Manifests, addedEntries...) + } + if len(addedEntries) != 0 || updatedAnnotations { + slices.SortStableFunc(index.Manifests, func(a, b imgspecv1.Descriptor) bool { + return !instanceIsZstd(a) && instanceIsZstd(b) + }) } return nil } +func (index *OCI1Index) EditInstances(editInstances []ListEdit) error { + return index.editInstances(editInstances) +} + // instanceIsZstd returns true if instance is a zstd instance otherwise false. func instanceIsZstd(manifest imgspecv1.Descriptor) bool { if value, ok := manifest.Annotations[OCI1InstanceAnnotationCompressionZSTD]; ok && value == "true" { @@ -131,24 +209,20 @@ func (index *OCI1IndexPublic) chooseInstance(ctx *types.SystemContext, preferGzi for manifestIndex, d := range index.Manifests { candidate := instanceCandidate{platformIndex: math.MaxInt, manifestPosition: manifestIndex, isZstd: instanceIsZstd(d), digest: d.Digest} if d.Platform != nil { - foundPlatform := false - for platformIndex, wantedPlatform := range wantedPlatforms { - imagePlatform := imgspecv1.Platform{ - Architecture: d.Platform.Architecture, - OS: d.Platform.OS, - OSVersion: d.Platform.OSVersion, - OSFeatures: slices.Clone(d.Platform.OSFeatures), - Variant: d.Platform.Variant, - } - if platform.MatchesPlatform(imagePlatform, wantedPlatform) { - foundPlatform = true - candidate.platformIndex = platformIndex - break - } + imagePlatform := imgspecv1.Platform{ + Architecture: d.Platform.Architecture, + OS: d.Platform.OS, + OSVersion: d.Platform.OSVersion, + OSFeatures: slices.Clone(d.Platform.OSFeatures), + Variant: d.Platform.Variant, } - if !foundPlatform { + platformIndex := slices.IndexFunc(wantedPlatforms, func(wantedPlatform imgspecv1.Platform) bool { + return platform.MatchesPlatform(imagePlatform, wantedPlatform) + }) + if platformIndex == -1 { continue } + candidate.platformIndex = platformIndex } if bestMatch == nil || candidate.isPreferredOver(bestMatch, didPreferGzip) { bestMatch = &candidate diff --git a/vendor/github.com/containers/image/v5/openshift/openshift-copies.go b/vendor/github.com/containers/image/v5/openshift/openshift-copies.go index 0b737f0204..c6498f6ca5 100644 --- a/vendor/github.com/containers/image/v5/openshift/openshift-copies.go +++ b/vendor/github.com/containers/image/v5/openshift/openshift-copies.go @@ -17,8 +17,8 @@ import ( "strings" "time" + "dario.cat/mergo" "github.com/containers/storage/pkg/homedir" - "github.com/imdario/mergo" "github.com/sirupsen/logrus" "golang.org/x/exp/slices" "gopkg.in/yaml.v3" @@ -957,8 +957,6 @@ func tlsConfigFor(c *restConfig) (*tls.Config, error) { } tlsConfig := &tls.Config{ - // Change default from SSLv3 to TLSv1.0 (because of POODLE vulnerability) - MinVersion: tls.VersionTLS10, InsecureSkipVerify: c.Insecure, } diff --git a/vendor/github.com/containers/image/v5/version/version.go b/vendor/github.com/containers/image/v5/version/version.go index 38df865b43..afb35157b1 100644 --- a/vendor/github.com/containers/image/v5/version/version.go +++ b/vendor/github.com/containers/image/v5/version/version.go @@ -6,12 +6,12 @@ const ( // VersionMajor is for an API incompatible changes VersionMajor = 5 // VersionMinor is for functionality in a backwards-compatible manner - VersionMinor = 25 + VersionMinor = 26 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 1 + VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-dev" + VersionDev = "" ) // Version is the specification version that the package types support. diff --git a/vendor/github.com/go-openapi/swag/util.go b/vendor/github.com/go-openapi/swag/util.go index f78ab684a0..d971fbe34b 100644 --- a/vendor/github.com/go-openapi/swag/util.go +++ b/vendor/github.com/go-openapi/swag/util.go @@ -341,12 +341,21 @@ type zeroable interface { // IsZero returns true when the value passed into the function is a zero value. // This allows for safer checking of interface values. func IsZero(data interface{}) bool { + v := reflect.ValueOf(data) + // check for nil data + switch v.Kind() { + case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + if v.IsNil() { + return true + } + } + // check for things that have an IsZero method instead if vv, ok := data.(zeroable); ok { return vv.IsZero() } + // continue with slightly more complex reflection - v := reflect.ValueOf(data) switch v.Kind() { case reflect.String: return v.Len() == 0 @@ -358,14 +367,13 @@ func IsZero(data interface{}) bool { return v.Uint() == 0 case reflect.Float32, reflect.Float64: return v.Float() == 0 - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: - return v.IsNil() case reflect.Struct, reflect.Array: return reflect.DeepEqual(data, reflect.Zero(v.Type()).Interface()) case reflect.Invalid: return true + default: + return false } - return false } // AddInitialisms add additional initialisms diff --git a/vendor/github.com/google/trillian/.gitignore b/vendor/github.com/google/trillian/.gitignore deleted file mode 100644 index f7e55498c0..0000000000 --- a/vendor/github.com/google/trillian/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -*.iml -*.swo -*.swp -*.tfstate -*.tfstate.backup -*~ -/.idea -/bazel-* -/commit_log -/coverage.txt -/createtree -/ct_hammer -/ct_server -/dump_tree -/licenses -/loglb -/maphammer -/mapreplay -/mdmtest -/protoc -/trillian_log_server -/trillian_log_signer -/trillian_map_server -default.etcd -cockroach-data/ diff --git a/vendor/github.com/google/trillian/.golangci.yaml b/vendor/github.com/google/trillian/.golangci.yaml deleted file mode 100644 index 0c50dcbda2..0000000000 --- a/vendor/github.com/google/trillian/.golangci.yaml +++ /dev/null @@ -1,20 +0,0 @@ -run: - # timeout for analysis, e.g. 30s, 5m, default is 1m - deadline: 90s - skip-files: - - types/internal/tls/tls.go - -linters-settings: - gocyclo: - # minimal code complexity to report, 30 by default (but we recommend 10-20) - # TODO(mhutchinson): lower this again after reworking interceptor - min-complexity: 26 - depguard: - list-type: blacklist - packages: - - golang.org/x/net/context - - github.com/gogo/protobuf/proto - -issues: - # Don't turn off any checks by default. We can do this explicitly if needed. - exclude-use-default: false diff --git a/vendor/github.com/google/trillian/AUTHORS b/vendor/github.com/google/trillian/AUTHORS deleted file mode 100644 index f45549fade..0000000000 --- a/vendor/github.com/google/trillian/AUTHORS +++ /dev/null @@ -1,14 +0,0 @@ -# This is the official list of benchmark authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. -# -# Names should be added to this file as: -# Name or Organization -# The email address is not required for organizations. -# -# Please keep the list sorted. - -Antonio Marcedone -Google LLC -Internet Security Research Group -Vishal Kuo diff --git a/vendor/github.com/google/trillian/CHANGELOG.md b/vendor/github.com/google/trillian/CHANGELOG.md deleted file mode 100644 index b7f2393d1a..0000000000 --- a/vendor/github.com/google/trillian/CHANGELOG.md +++ /dev/null @@ -1,1166 +0,0 @@ -# TRILLIAN Changelog - -## HEAD - -## v.1.5.2 - -* Recommended go version for development: 1.19 - * This is the version used by the cloudbuild presubmits. Using a - different version can lead to presubmits failing due to unexpected - diffs. - -### Storage - -#### CloudSpanner - -* Removed use of the `--cloudspanner_write_sessions` flag. - This was related to preparing some fraction of CloudSpanner sessionpool entries with - Read/Write transactions, however this functionality is no longer supported by the client - library. - -### Repo config -* Enable all lint checks in trillian repo by @mhutchinson in https://github.com/google/trillian/pull/2979 - -### Dependency updates - -* Bump contrib.go.opencensus.io/exporter/stackdriver from 0.13.12 to 0.13.14 by @samuelattwood in https://github.com/google/trillian/pull/2950 -* Bump Go version from 1.17 to 1.19. -* Updated golangci-lint to v1.51.1 (developers should update to this version) -* Update transparency-dev/merkle to v0.0.2 - -## v1.5.1 - -### Storage - -* A new storage driver for CockroachDB has been added. It's currently in alpha stage - with support provided by Equinix Metal. - -### Misc - -* Fix log server not exiting properly on SIGINT - -### Dependency updates - -* Switch from glog to klog by @jdolitsky in https://github.com/google/trillian/pull/2787 -* Bump google.golang.org/api from 0.92.0 to 0.93.0 by @dependabot in https://github.com/google/trillian/pull/2800 -* Bump cloud.google.com/go/spanner from 1.36.0 to 1.37.0 by @dependabot in https://github.com/google/trillian/pull/2803 -* Bump google.golang.org/grpc from 1.48.0 to 1.49.0 by @dependabot in https://github.com/google/trillian/pull/2804 -* Bump google.golang.org/api from 0.93.0 to 0.94.0 by @dependabot in https://github.com/google/trillian/pull/2802 -* Bump cloud.google.com/go/spanner from 1.37.0 to 1.38.0 by @dependabot in https://github.com/google/trillian/pull/2806 -* Bump k8s.io/klog/v2 from 2.70.1 to 2.80.0 by @dependabot in https://github.com/google/trillian/pull/2807 -* Bump k8s.io/klog/v2 from 2.80.0 to 2.80.1 by @dependabot in https://github.com/google/trillian/pull/2808 -* Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 by @dependabot in https://github.com/google/trillian/pull/2809 -* Bump google.golang.org/api from 0.94.0 to 0.95.0 by @dependabot in https://github.com/google/trillian/pull/2810 -* Bump go.etcd.io/etcd/etcdctl/v3 from 3.5.4 to 3.5.5 by @dependabot in https://github.com/google/trillian/pull/2812 -* Bump go.etcd.io/etcd/v3 from 3.5.4 to 3.5.5 by @dependabot in https://github.com/google/trillian/pull/2816 -* Bump google.golang.org/api from 0.95.0 to 0.96.0 by @dependabot in https://github.com/google/trillian/pull/2813 -* Bump google.golang.org/api from 0.96.0 to 0.97.0 by @dependabot in https://github.com/google/trillian/pull/2819 -* Bump cloud.google.com/go/spanner from 1.38.0 to 1.39.0 by @dependabot in https://github.com/google/trillian/pull/2818 -* Bump google.golang.org/api from 0.97.0 to 0.98.0 by @dependabot in https://github.com/google/trillian/pull/2820 -* Bump google.golang.org/grpc from 1.49.0 to 1.50.0 by @dependabot in https://github.com/google/trillian/pull/2821 -* Bump google.golang.org/grpc from 1.50.0 to 1.50.1 by @dependabot in https://github.com/google/trillian/pull/2823 -* Bump google.golang.org/api from 0.98.0 to 0.99.0 by @dependabot in https://github.com/google/trillian/pull/2822 -* Bump google.golang.org/api from 0.99.0 to 0.100.0 by @dependabot in https://github.com/google/trillian/pull/2824 -* Bump github.com/prometheus/client_model from 0.2.0 to 0.3.0 by @dependabot in https://github.com/google/trillian/pull/2825 -* Bump golang.org/x/tools from 0.1.12 to 0.2.0 by @dependabot in https://github.com/google/trillian/pull/2826 -* Bump google.golang.org/api from 0.100.0 to 0.101.0 by @dependabot in https://github.com/google/trillian/pull/2827 -* Bump github.com/prometheus/client_golang from 1.13.0 to 1.13.1 by @dependabot in https://github.com/google/trillian/pull/2828 -* Bump golang.org/x/sys from 0.1.0 to 0.2.0 by @dependabot in https://github.com/google/trillian/pull/2829 -* Bump google.golang.org/api from 0.101.0 to 0.102.0 by @dependabot in https://github.com/google/trillian/pull/2830 -* Bump go.opencensus.io from 0.23.0 to 0.24.0 by @dependabot in https://github.com/google/trillian/pull/2832 -* Bump cloud.google.com/go/spanner from 1.39.0 to 1.40.0 by @dependabot in https://github.com/google/trillian/pull/2831 -* Bump github.com/prometheus/client_golang from 1.13.1 to 1.14.0 by @dependabot in https://github.com/google/trillian/pull/2838 -* Bump google.golang.org/api from 0.102.0 to 0.103.0 by @dependabot in https://github.com/google/trillian/pull/2839 -* Bump golang.org/x/crypto from 0.1.0 to 0.2.0 by @dependabot in https://github.com/google/trillian/pull/2841 -* Bump golang.org/x/tools from 0.2.0 to 0.3.0 by @dependabot in https://github.com/google/trillian/pull/2840 -* Dependabot: Also keep GitHub actions up-to-date by @JAORMX in https://github.com/google/trillian/pull/2842 -* Bump actions/upload-artifact from 3.1.0 to 3.1.1 by @dependabot in https://github.com/google/trillian/pull/2843 -* Bump golang.org/x/crypto from 0.2.0 to 0.3.0 by @dependabot in https://github.com/google/trillian/pull/2847 -* Bump google.golang.org/grpc from 1.50.1 to 1.51.0 by @dependabot in https://github.com/google/trillian/pull/2845 -* Bump github.com/cockroachdb/cockroach-go/v2 from 2.2.16 to 2.2.18 by @dependabot in https://github.com/google/trillian/pull/2846 -* Bump go.etcd.io/etcd/v3 from 3.5.5 to 3.5.6 by @dependabot in https://github.com/google/trillian/pull/2849 -* Bump github.com/cockroachdb/cockroach-go/v2 from 2.2.18 to 2.2.19 by @dependabot in https://github.com/google/trillian/pull/2856 -* Bump golang.org/x/sys from 0.2.0 to 0.3.0 by @dependabot in https://github.com/google/trillian/pull/2858 -* Bump cloud.google.com/go/spanner from 1.40.0 to 1.41.0 by @dependabot in https://github.com/google/trillian/pull/2857 -* Bump actions/setup-go from 3.3.1 to 3.4.0 by @dependabot in https://github.com/google/trillian/pull/2862 -* Bump github/codeql-action from 2.1.34 to 2.1.35 by @dependabot in https://github.com/google/trillian/pull/2861 -* Bump golangci/golangci-lint-action from 3.3.0 to 3.3.1 by @dependabot in https://github.com/google/trillian/pull/2860 -* Bump github.com/go-sql-driver/mysql from 1.6.0 to 1.7.0 by @dependabot in https://github.com/google/trillian/pull/2859 -* Bump qs, body-parser and express in /scripts/gcb2slack by @dependabot in https://github.com/google/trillian/pull/2867 -* Bump minimist from 1.2.0 to 1.2.7 in /scripts/gcb2slack by @dependabot in https://github.com/google/trillian/pull/2864 -* Bump axios and @slack/webhook in /scripts/gcb2slack by @dependabot in https://github.com/google/trillian/pull/2868 -* Bump json-bigint and google-auth-library in /scripts/gcb2slack by @dependabot in https://github.com/google/trillian/pull/2869 -* Bump node-fetch from 2.6.0 to 2.6.7 in /scripts/gcb2slack by @dependabot in https://github.com/google/trillian/pull/2866 -* Bump golang.org/x/tools from 0.3.0 to 0.4.0 by @dependabot in https://github.com/google/trillian/pull/2870 -* Bump github/codeql-action from 2.1.35 to 2.1.36 by @dependabot in https://github.com/google/trillian/pull/2874 -* Bump actions/checkout from 3.1.0 to 3.2.0 by @dependabot in https://github.com/google/trillian/pull/2873 -* Bump golang.org/x/crypto from 0.3.0 to 0.4.0 by @dependabot in https://github.com/google/trillian/pull/2872 -* Bump google.golang.org/api from 0.103.0 to 0.104.0 by @dependabot in https://github.com/google/trillian/pull/2871 -* Bump cloud.google.com/go/spanner from 1.41.0 to 1.42.0 by @dependabot in https://github.com/google/trillian/pull/2877 - - -## v.1.5.0 - -### Storage - -* Ephemeral nodes are no-longer written for any tree by default (and have not been read since the v1.4.0 release), the corresponding `--tree_ids_with_no_ephemeral_nodes` flag is now deprecated (and will be removed in a future release). - -### Cleanup -* Format code according to go1.19rc2 by @mhutchinson in https://github.com/google/trillian/pull/2785 -* Delete merkle package, use [github.com/transparency-dev/merkle](https://pkg.go.dev/github.com/transparency-dev/merkle) instead. - -### Misc -* Fix order-dependent test by @hickford in https://github.com/google/trillian/pull/2792 - -### Dependency updates -* Updated golangci-lint to v1.47.3 (developers should update to this version) by @mhutchinson in https://github.com/google/trillian/pull/2791 -* Bump google.golang.org/api from 0.87.0 to 0.88.0 by @dependabot in https://github.com/google/trillian/pull/2783 -* Bump cloud.google.com/go/spanner from 1.35.0 to 1.36.0 by @dependabot in https://github.com/google/trillian/pull/2784 -* Bump google.golang.org/api from 0.88.0 to 0.90.0 by @dependabot in https://github.com/google/trillian/pull/2789 -* Bump golang.org/x/tools from 0.1.11 to 0.1.12 by @dependabot in https://github.com/google/trillian/pull/2790 -* Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 by @dependabot in https://github.com/google/trillian/pull/2788 -* Bump google.golang.org/api from 0.90.0 to 0.91.0 by @dependabot in https://github.com/google/trillian/pull/2796 -* Bump github.com/prometheus/client_golang from 1.12.2 to 1.13.0 by @dependabot in https://github.com/google/trillian/pull/2795 -* Bump github.com/fullstorydev/grpcurl from 1.8.6 to 1.8.7 by @dependabot in https://github.com/google/trillian/pull/2794 -* Bump google.golang.org/api from 0.91.0 to 0.92.0 by @dependabot in https://github.com/google/trillian/pull/2798 - -## v1.4.2 - -* #2568: Allow disabling the writes of ephemeral nodes to storage via the - `--tree_ids_with_no_ephemeral_nodes` flag to the sequencer. -* #2748: `--cloudspanner_max_burst_sessions` deprecated (it hasn't had any - effect for a while, now it's more explicit) -* #2768: update go.mod to use 1.17 compatibility from 1.13. - -### Dependency updates - -* Updated golangci-lint to v1.46.1 (developers should update to this version) -* Removed dependency on certificate-transparency-go - -### Developer updates - -* #2765 copies the required protos from `googleapis` into `third_party` in this - repository. This simplifies the preconditions in order to compile the proto - definitions, and removes a big dependency on `$GOPATH/src` which was archaic; - `$GOPATH/src/github.com/googleapis/googleapis` is no longer required. - -## v1.4.1 - -* `countFromInformationSchema` function to add support for MySQL 8. - -### Removals - - * #2710: Unused `storage/tools/dumplib` was removed. The useful storage format - regression test moved to `integration/format`. - * #2711: Unused `storage/tools/hasher` removed. - * #2715: Packages under `merkle` are deprecated and to be removed. Use - https://github.com/transparency-dev/merkle instead. - -### Misc improvements - - * #2712: Fix MySQL world-writable config warning. - * #2726: Check the tile height invariant stricter. No changes required. - -### Dependency updates - * #2731: Update `protoc` from `v3.12.4` to `v3.20.1` - -## v1.4.0 - -* Recommended go version for development: 1.17 - * This is the version used by the cloudbuild presubmits. Using a - different version can lead to presubmits failing due to unexpected - diffs. -* GCP terraform script updated. GKE 1.19 and updated CPU type to E2 - -### Dependency updates -Many dep updates, including: - * Upgraded to etcd v3 in order to allow grpc to be upgraded (#2195) - * etcd was `v0.5.0-alpha.5`, now `v3.5.0` - * grpc upgraded from `v1.29.1` to `v1.40.0` - * certificate-transparency-go from `v1.0.21` to - `v1.1.2-0.20210512142713-bed466244fa6` - * protobuf upgraded from `v1` to `v2` - * MySQL driver from `1.5.0` to `1.6.0` - -### Cleanup - * **Removed signatures from LogRoot and EntryTimestamps returned by RPCs** (reflecting that - there should not be a trust boundary between Trillian and the personality.) - * Removed the deprecated crypto.NewSHA256Signer function. - * Finish removing the `LogMetadata.GetUnsequencedCounts()` method. - * Removed the following APIs: - - `TrillianLog.GetLeavesByHash` - - `TrillianLog.GetLeavesByIndex` - - `TrillianLog.QueueLeaves` - * Removed the incomplete Postgres storage backend (#1298). - * Deprecated `LogRootV1.Revision` field. - * Moved `rfc6962` hasher one directory up to eliminate empty leftover package. - * Removed unused `log_client` tool. - * Various tidyups and improvements to merke & proof generation code. - * Remove some remnants of experimental map. - -### Storage refactoring - * `NodeReader.GetMerkleNodes` does not accept revisions anymore. The - implementations must use the transaction's `ReadRevision` instead. - * `TreeStorage` migrated to using `compact.NodeID` type suitable for logs. - * Removed the tree storage `ReadRevision` and `WriteRevision` methods. - Revisions are now an implementation detail of the current storages. The - change allows log implementations which don't need revisions. - * Removed `Rollback` methods from storage interfaces, as `Close` is enough to - cover the use-case. - * Removed the unused `IsOpen` and `IsClosed` methods from transaction - interfaces. - * Removed the `ReadOnlyLogTX` interface, and put its only used - `GetActiveLogIDs` method to `LogStorage`. - * Inlined the `LogMetadata` interface to `ReadOnlyLogStorage`. - * Inlined the `TreeStorage` interfaces to `LogStorage`. - * Removed the need for the storage layer to return ephemeral node hashes. The - application layer always requests for complete subtree nodes comprising the - compact ranges corresponding to the requests. - * Removed the single-tile callback from `SubtreeCache`, it uses only - `GetSubtreesFunc` now. - * Removed `SetSubtreesFunc` callback from `SubtreeCache`. The tiles should be - written by the caller now, i.e. the caller must invoke the callback. - -## v1.3.13 -[Published 2021-02-16](https://github.com/google/trillian/releases/tag/v1.3.13) - -### Cleanup - * Removed the experimental map API. - -## v1.3.12 -[Published 2021-02-16](https://github.com/google/trillian/releases/tag/v1.3.12) - -### Misc improvements - - * Removed unused `PeekTokens` method from the `quota.Manager` interface. - * Ensure goroutines never block in the subtree cache (#2272). - * Breaking unnecessary dependencies for Trillian clients: - * Moved verifiers from `merkle` into `merkle/{log,map}verifier`sub-pacakges, - reducing the amount of extra baggage inadvertently pulled in by clients. - * Concrete hashers have been moved into subpackages, separating them from their - registration code, allowing clients to directly pull just the hasher they're - interested in and avoid the Trillian/hasher registry+protobuf deps. - * Moved some packages intended for internal-only use into `internal` packages: - * InMemoryMerkleTree (indended to only be used by Trillian tests) - * Removed wrapper for etcd client (#2288). - * Moved `--quota_system` and `--storage_system` flags to `main.go` so that they - are initialised properly. It might break depending builds relying on these - flags. Suggested fix: add the flags to `main.go`. - * Made signer tolerate mastership election failures [#1150]. - * `testdb` no longer accepts the `--test_mysql_uri` flag, and instead honours the - `TEST_MYSQL_URI` ENV var. This makes it easier to blanket configure tests to use a - specific test DB instance. - * Removed experimental Skylog folder (#2297). - * Fixed a race condition in the operation manager that should only affect tests - (#2302). - * Run gofumpt formatter on the whole repository (#2315). - * Refactor signer operation loop (#2294). - -### Upgrades - * Dockerfiles are now based on Go 1.13 image. - * The etcd is now pinned to v3.4.12. - * The golangci-lint suite is now at v1.36.0. - * CI/CD has migrated from Travis to Google Cloud Build. - * prometheus from 1.7.1 to 1.9.0 (#2239, #2270). - * go-cmp from 0.5.2 to 0.5.4 (#2262). - * apache/beam from 2.26.0+incompatible to 2.27.0+incompatible (#2273). - * lib/pq from 1.8.0 to 1.9.0 (#2264). - * go-redis from 6.15.8+incompatible to 6.15.9+incompatible (#2215). - - -### Process - * Recognise that we do not follow strict semantic versioning practices. - -## v1.3.11 -[Published 2020-10-06](https://github.com/google/trillian/releases/tag/v1.3.11) - -### Documentation - -Added docs which describe the Claimant Model of transparency, a useful -framework for reasoning about the design and architecture of transparent -systems. - -### Misc improvements - - * Fixed int to string conversion warnings for golang 1.15 - * Metric improvements for fetched leaf counts - * Move tools.go into its own directory to help with dependencies - -### Dependency updates - * go-grpc-middleware from 1.2.0 to 1.2.2 (#2219, #2229) - * stackdriver from 0.13.2 to 0.13.4 (#2220, #2223) - * Google api from 0.28.0 to 0.29.0 (#2193) - - -## v1.3.10 -[Published 2020-07-02](https://github.com/google/trillian/releases/tag/v1.3.10) - -### Storage - -The StorageProvider type and helpers have been moved from the server package to -storage. Aliases for the old types/functions are created for backward -compatibility, but the new code should not use them as we will remove them with -the next major version bump. The individual storage providers have been moved to -the corresponding packages, and are now required to be imported explicitly by -the main file in order to be registered. We are including only MySQL and -cloudspanner providers by default, since these are the ones that we support. - -The cloudspanner storage is supported for logs only, while the Map storage API -is being polished and decoupled from the log storage API. We may return the -support when the new API is tested. - -Support for storage of Ed25519 signatures has been added to the mysql and -postgres storage drivers (only applicable in new installations) and bugs -preventing correct usage of that algorithm have been fixed. - -#### Storage TX Interfaces -- `QueueLeaves` has been removed from the `LogTreeTX` interface because - `QueueLeaves` is not transactional. All callers use the - `QueueLeaves` function in the `LogStorage` interface. -- `AddSequencedLeaves` has been removed from the `LogTreeTX`. - - -### Log Changes - -#### Monitoring & Metrics - -The `queued_leaves` metric is removed, and replaced by `added_leaves` which -covers both `QueueLeaves` and `AddSequencedLeaves`, and is labeled by log ID. - -#### MySQL Dequeueing Change #2159 -mysql will now remove leaves from the queue inside of `UpdateLeaves` rather -than directly inside of `Dequeue`. -This change brings the behavior of the mysql storage implementation into line -with the spanner implementation and makes consistent testing possible. - - -### Map Changes - -**The verifiable map is still experimental.** -APIs, such as SetLeaves, have been deprecated and will be deleted in the near -future. The semantics of WriteLeaves have become stricter: now it always -requires the caller to specify the write revision. These changes will not -affect the Trillian module semantic version due to the experimental status of -the Map. - -Map API has been extended with Layout, GetTiles and SetTiles calls which allow -for more direct processing of sparse Merkle tree tiles in the application layer. -Map storage implementations are simpler, and no longer use the SubtreeCache. - -The map client has been updated so that GetAndVerifyMapLeaves and -GetAndVerifyMapLeavesByRevision return the MapRoot for the revision at which the -leaves were fetched. Without this callers of GetAndVerifyMapLeaves in particular -were unable to reason about which map revision they were seeing. The -SetAndVerifyMapLeaves method was deleted. - - - -## v1.3.9 -[Published 2020-06-22](https://github.com/google/trillian/releases/tag/v1.3.9) - -### Selected Dependency Updates -* etcd from v3.3.18 to 3.4.7 (#2090) -* etcd-operator from v0.9.1 to v0.9.4 -* upgraded protoc version to latest (#2088) -* github.com/golang/protobuf to v1.4.1 (#2111) -* google.golang.org/grpc from v1.26 to 1.29.1 (#2108) - - -## v1.3.8 -[Published 2020-05-12](https://github.com/google/trillian/releases/tag/v1.3.8) - -### HTTP APIs - -The HTTP/JSON APIs have been removed in favor of a pure gRPC intereface. -[grpcurl](https://github.com/fullstorydev/grpcurl) is the recommended way -of interacting with the gRPC API from the commandline. - - -## v1.3.7 -[Published 2020-05-12](https://github.com/google/trillian/releases/tag/v1.3.7) - -### Server Binaries - -The `trillian_log_server`, `trillian_log_signer` and `trillian_map_server` -binaries have moved from `github.com/google/trillian/server/` to -`github.com/google/trillian/cmd`. A subset of the `server` package has also -moved and has been split into `cmd/internal/serverutil`, `quota/etcd` and -`quota/mysqlqm` packages. - - -## v1.3.6 -[Published 2020-05-12](https://github.com/google/trillian/releases/tag/v1.3.6) - -### Deployments - -The Kubernetes configs will now provision 5 nodes for Trillian's Etcd cluster, -instead of 3 nodes. -[This makes the Etcd cluster more resilient](https://etcd.io/docs/v3.2.17/faq/#what-is-failure-tolerance) -to nodes becoming temporarily unavailable, such as during updates (it can now -tolerate 2 nodes being unavailable, instead of just 1). - -### Monitoring & Metrics - -A count of the total number of individual leaves the logserver attempts to -fetch via the GetEntries.* API methods has been added. - - -## v1.3.5 -[Published 2020-05-12](https://github.com/google/trillian/releases/tag/v1.3.5) - -### Log Changes - -#### Potential sequencer hang fixed -A potential deadlock condition in the log sequencer when the process is -attempting to exit has been addressed. - -### Quota - -#### New Features - -An experimental Redis-based `quota.Manager` implementation has been added. - -#### Behaviour Changes - -Quota used to be refunded for all failed requests. For uses of quota that were -to protect against abuse or fair utilization, this could allow infinite QPS in -situations that really should have the requests throttled. Refunds are now only -performed for tokens in `Global` buckets, which prevents tokens being leaked if -duplicate leaves are queued. - -### Tools - -The `licenses` tool has been moved from "scripts/licenses" to [a dedicated -repository](https://github.com/google/go-licenses). - -### Bazel Changes - -Python support is disabled unless we hear that the community cares about this -being re-enabled. This was broken by a downstream change and without a signal -from the Trillian community to say this is needed, the pragmatic action is to -not spend time investigating this issue. - - -## v1.3.4 - Invalid release, do not use. -[Published 2020-05-12](https://github.com/google/trillian/releases/tag/v1.3.4) - - -## v1.3.3 - Module fixes - -Published 2019-10-31 17:30:00 +0000 UTC - -Patch release to address Go Module issue. Removes `replace` directives in our -go.mod file now that our dependencies have fixed their invalid pseudo-version -issues. - -## v1.3.2 - Module fixes - -Published 2019-09-05 17:30:00 +0000 UTC - -Patch release to address Go Module issue. Some dependencies use invalid pseudo- -versions in their go.mod files that Go 1.13 rejects. We've added `replace` -directives to our go.mod file to fix these invalid pseudo-versions. - -## v1.3.1 - Module and Bazel fixes - -Published 2019-08-16 15:00:00 +0000 UTC - -Patch release primarily to address Go Module issue. v1.3.0 declared a dependency -on github.com/russross/blackfriday/v2 v2.0.1+incompatible which made downstream -dependencies suffer. - -## v1.3.0 - -Published 2019-07-17 15:00:00 +0000 UTC - -### Storage APIs GetSignedLogRoot / SetSignedLogRoot now take pointers - -This at the storage layer and does not affect the log server API. -This is part of work to fix proto buffer usages where they are passed -by value or compared by generic code like `reflect.DeepEquals()`. Passing -them by value creates shallow copies that can share internal state. As the -generated structs contain additional exported `XXX_` fields generic -comparisons using all fields can produce incorrect results. - -### Storage Commit takes context.Context - -To support passing a context down to `NodeStorage.SetLeaves`, and remove various `context.TODO()`s, -the following functions have been modified to accept a `context.Context` parameter: - -- `storage/cache.NodeStorage.SetLeaves` -- `storage/cache.SetSubtreesFunc` -- `storage/cache.SubtreeCache.Flush` -- `storage.ReadonlyLogTX.Commit` - -### Go Module Support - -Go Module support has been enabled. Please use GO111MODULE=on to build Trillian. -Updating dependencies no longer requires updating the vendor directory. - -### TrillianMapWrite API -New API service for writing to the Trillian Map. This allows APIs such as -GetLeavesByRevisionNoProof to be removed from the read API, and these methods to -be tuned & provisioned differently for read vs write performance. - -### GetLeavesByRevisionNoProof API -Allow map clients to forgo fetching inclusion proofs. -This dramatically speeds things up for clients that don't need verifiability. -This situation occurs in some situation where a Trillian personality is -interacting directly with the Trillian Map. - -### GetMapLeafByRevision API -New GetMapLeafByRevision API for fetching a single map leaf. This allows there -to be a separate API end point for fetching a single leaf vs. the batch -GetMapLeavesByRevision API which is much slower when many leaves are requested. -This supports separate monitoring and alerting for different traffic patterns. - -### Add Profiling Flags to Binaries - -The `trillian_log_server`, `trillian_log_signer` and `trillian_map_server` -binaries now have CPU and heap profiling flags. Profiling is off by default. -For more details see the -[Go Blog](https://blog.golang.org/profiling-go-programs). -### Map performance tweaks - -The map mode has had some performance tweaks added: -* A workaround for locking issues which affect the map when it's used in - single-transaction mode. - -### Introduce BatchInclusionProof function - -Added a batch version of the Merkle Tree InclusionProof function. - -Updated the map RPC for getLeaves to use the new batch function to improve -efficiency. - -### Google Cloud Spanner support - -Google Cloud Spanner is now a supported storage backend for maps. - -The admin API calls to list trees backed by Cloud Spanner trees are fixed. - -### RPC Server Transaction Leaks Fixed - -There were some cases where the Log RPC server could leak storage transactions -in error situations. These have now been fixed. If you have a custom storage -implementation review the fixes made to the MySQL Log storage to see if they -need to be applied to your code (`storage/mysql/log_storage.go`). The Map -server had similar issues but these were fixed without requiring changes to -storage code. - -### GetLatestSignedLogRoot With Consistency Proof - -`GetLatestSignedLogRoot` in the LogServer will return a consistency proof if -`first_tree_size` > 0. This reduces the number of RPC calls from logClient from -2 to 1 in `client.getAndVerifyLatestRoot`. - -### Testing - -Support has been added for testing against a locally running mysql docker image, -in addition to a locally running mysql instance. - -### Deprecated Fields Removed From SignedLogRoot Proto - -*Important Note*: For use in Certificate Transparency this version of the -logserver binary won't work properly with an older CTFE. Make sure to update the -CTFE servers to a current version (built from a git checkout after March 20th -2019) before deploying logservers that include this change or deploy them -together with this release. Failure to do this can result in 5XX errors being -returned to clients when the old handler code tries to access fields in -responses that no longer exist. - -All the fields marked as deprecated in this proto have been removed. All the -same fields are available via the TLS marshalled log root in the proto. Updating -affected code is straightforward. - -Normally, clients will want to verify that the signed root is correctly signed. -This is the preferred way to interact with the root data. - -There is a utility function provided that will verify the signature and unpack -the TLS data. It works well in conjunction with a `LogVerifier`. The public key -of the server is required. - -```go -verifier := client.NewLogVerifier(rfc6962.DefaultHasher, pk, crypto.SHA256) -root, err := crypto.VerifySignedLogRoot(verifier.PubKey, verifier.SigHash, resp.SignedLogRoot) -if err != nil { - // Signature verified and unmarshalled correctly. The struct may now - // be used. - if root.TreeSize > 0 { - // Non empty tree. - } -} -``` - -### MySQL changes - -#### Configurable number of connections for MySQL - -Two new flags have been added that limit connections to MySQL database servers: - -- `--mysql_max_conns` - limits the total number of database connections -- `--mysql_max_idle_conns` - limits the number of idle database connections - -By default, there is no maximum number of database connections. However, the -database server will likely impose limits on the number of connections. The -default limit on idle connections is controlled by -[Go's `sql` package](https://golang.org/pkg/database/sql/#DB.SetMaxIdleConns). - -#### Enfored no concurrent use of MySQL tx - -Concurrently using a single MySQL transaction can cause the driver to error -out, so we now attempt to prevent this from happening. - -### Removal of length limits for a tree's `display_name` and `description` - -Previously, these were restricted to 20 bytes and 200 bytes respectively. These -limits have been removed. However, the underlying storage implementation may -still impose its own limitations. - -### Server validation of leaf hashes - -The log server now checks that leaf hashes are the correct length and returns -an InvalidArgument error if they are not. Previously, GetLeavesByHash would -simply not return any matching leaves for invalid hashes, and -GetInclusionProofByHash would return a NotFound error. - -### Map client - -A [MapClient](client/map_client.go) has been added to simplify interacting with -the map server. - -### Database Schema - -This version includes a change to the MySQL and Postgres database schemas to add -an index on the `SequencedLeafData` table. This improves performance for -inclusion proof queries. - -### Deployments - -The Trillian Docker images now accept GOFLAGS and GO111MODULE arguments -and set them as environment variables inside the Docker container. - -The [db\_server Docker image](examples/deployment/docker/db_server/Dockerfile) -is now based on -[the MySQL 5.7 image from the Google Cloud Marketplace](https://console.cloud.google.com/marketplace/details/google/mysql5), -rather than the [official MySQL 5.7 image](https://hub.docker.com/_/mysql). -This Dockerfile supercedes Dockerfile.db, which has been removed. - -There is now a [mysql.cnf file](examples/deployment/docker/db_server/mysql.cnf) -alongside the Dockerfile that makes it easy to build the image with a custom -configuration, e.g. to allow MySQL to use more memory. - -The `trillian-log-service` and `trillian-log-signer` Kubernetes services will -now have load balancers configured for them that expose those services outside -of the Kubernetes cluster. This makes it easier to access their APIs. When -deployed on Google Cloud, these will be -[Internal Load Balancers](https://cloud.google.com/kubernetes-engine/docs/how-to/internal-load-balancing). -Note that this change **cannot be applied to an existing deployment**; delete -the existing Kubernetes services and redeploy them, otherwise you'll see an -error similar to `The Service "trillian-log-service" is invalid: spec.clusterIP: -Invalid value: "": field is immutable`. - -A working [Docker Compose](https://docs.docker.com/compose/) configuration is -now available and can be used to bring up a local Trillian deployment for -testing and experimental purposes: - -```shell -docker-compose -f examples/deployment/docker-compose.yml up -``` - -Docker Compose v3.1 or higher is required. - -The Terraform, Kubernetes and Docker configuration files, as well as various -scripts, all now use the same, consistently-named environment variables for -MySQL-related data (e.g. `MYSQL_DATABASE`). The variable names are based on -those for the -[MySQL Docker image](https://hub.docker.com/_/mysql#environment-variables). - -Docker images have been upgraded from Go 1.9 to 1.11. They now use ["Distroless" -base images](https://github.com/GoogleContainerTools/distroless). - -### Dropped metrics - -Quota metrics with specs of the form `users//read` and -`users//write` are no longer exported by the Trillian binaries (as they -lead to excessive storage requirements for Trillian metrics). - -### Resilience improvements in `log_signer` - -#### Add timeout to sequencing loop - -Added a timeout to the context in the sequencing loop, with a default of 60s. - -#### Fix Operation Loop Hang - -Resolved a bug that would hide errors and cause the `OperationLoop` to hang -until process exit if any error occurred. - -### Linting toolchain migration - -gometalinter has been replaced with golangci-lint for improved performance and -Go module support. - -### Compact Merkle tree data structures - -`CompactMerkleTree` has been removed from `github.com/google/trillian/merkle`, -and a new package `github.com/google/trillian/merkle/compact` was introduced. A -new powerful data structure named "compact range" has been added to that -package, and is now used throughout the repository instead of the compact tree. -It is a generalization of the previous structure, as it allows manipulating -arbitrary sub-ranges of leaves rather than only prefixes. - -### Storage API changes - -The internal storage API is modified so that the ReadOnlyTreeTX.ReadRevision and -TreeWriter.WriteRevision entrypoints take a context.Context parameter and return -an optional error. - -The `SubtreeCache.GetNodeHash()` method is no longer exported. - -The memory storage provider has been refactored to make it more consistent with -the other storage providers. - -The `LogMetadata.GetUnsequencedCounts()` method has been removed. - -`NodeReader.GetMerkleNodes` now must return `Node` objects in the same order as -node IDs requested. Storage implementations known to us already adhere to this -requirement. - -### Maphammer improvements - -The maphammer test tool for the experimental Trillian Map has been enhanced. - -### Default values changed for some signer flags - -The following flags for the signer have new default values: - -- `--sequencer_interval`: changed from 10 seconds to 100 milliseconds -- `--batch_size`: changed from 50 to 1000 - -These changes improve the signer's throughput and latency under typical -conditions. - -### Master election refactoring - -The `--resign_odds` flag in `logsigner` is removed, in favor of a more generic -`--master_hold_jitter` flag. Operators using this flag are advised to set the -jitter to `master_check_interval * resign_odds * 2` to achieve similar behavior. - -The `--master_check_interval` flag is removed from `logsigner`. - -`logsigner` switched to using a new master election interface contained in -`util/election2` package. The interfaces in `util/election` are removed. - -### `CONIKS_SHA256` hash strategy added - -Support has been added for a CONIKS sparse tree hasher with SHA256 as the hash -algorithm. Set a tree's `hash_strategy` to `CONIKS_SHA256` to use it. - -### Performance - -The performance of `SetLeaves` requests on the Map has been slightly improved. -The performance of `GetConsistencyProof` requests has been improved when using -MySQL. - -### Logging - -Some warning-level logging has been removed from the sequencer in favour of -returning the same information via the returned error. The caller may still -choose to log this information. This allows storage implementations that retry -transactions to suppress warnings when a transaction initially fails but a retry -succeeds. - -Some incorrectly-formatted log messages have been fixed. - -### Documentation - -[API documentation in Markdown format](docs/api.md) is now available. - -### Other - -The `TimeSource` type (and other time utils) moved to a separate `util/clock` -package, extended with a new `Timer` interface that allows mocking `time.Timer`. - -The `Sequencer.SignRoot()` method has been removed. - -## v1.2.1 - Map race fixed. TLS client support. LogClient improvements - -Published 2018-08-20 10:31:00 +0000 UTC - -### Servers - -A race condition was fixed that affected sparse Merkle trees as served by the -map server. - -### Utilities / Binaries - -The `maphammer` uses a consistent empty check, fixing spurious failures in some -tests. - -The `createtree` etc. set of utilities now support TLS via the `-tls-cert-file` -flag. This support is also available as a client module. - -### Log Client - -`GetAndVerifyInclusionAtIndex` no longer updates the clients root on every -access as this was an unexpected side effect. Clients now have explicit control -of when the root is updated by calling `UpdateRoot`. - -A root parameter is now required when log clients are constructed. - -The client will now only retry requests that fail with the following errors: - -- Aborted -- DeadlineExceeded -- ResourceExhausted -- Unavailable - -There is one exception - it will also retry InitLog/InitMap requests that fail -due to a FailedPrecondition error. - -### Other - -The Travis build script has been updated for newer versions of MySQL (5.7 -through MySQL 8) and will no longer work with 5.6. - -Commit -[f3eaa887163bb4d2ea4b4458cb4e7c5c2f346bc6](https://api.github.com/repos/google/trillian/commits/f3eaa887163bb4d2ea4b4458cb4e7c5c2f346bc6) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.2.1) - -## v1.2.0 - Signer / Quota fixes. Error mapping fix. K8 improvements - -Published 2018-06-25 10:42:52 +0000 UTC - -The Log Signer now tries to avoid creating roots older than ones that already -exist. This issue has been seen occurring on a test system. Important note: If -running this code in production allowing clocks to drift out of sync between -nodes can cause other problems including for clustering and database -replication. - -The Log Signer now publishes metrics for the logs that it is actively signing. -In a clustered environment responsibility can be expected to move around between -signer instances over time. - -The Log API now allows personalities to explicitly list a vector of identifiers -which should be charged for `User` quota. This allows a more nuanced application -of request rate limiting across multiple dimensions. Some fixes have also been -made to quota handling e.g. batch requests were not reserving the appropriate -quota. Consult the corresponding PRs for more details. - -For the log RPC server APIs `GetLeavesByIndex` and `GetLeavesByRange` MySQL -storage has been modified to return status codes that match CloudSpanner. -Previously some requests with out of range parameters were receiving 5xx error -status rather than 4xx when errors were mapped to the HTTP space by CTFE. - -The Kubernetes deployment scripts continue to evolve and improve. - -Commit -[aef10347dba1bd86a0fcb152b47989d0b51ba1fa](https://api.github.com/repos/google/trillian/commits/aef10347dba1bd86a0fcb152b47989d0b51ba1fa) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.2.0) - -## v1.1.1 - CloudSpanner / Tracing / Health Checks - -Published 2018-05-08 12:55:34 +0000 UTC - -More improvements have been made to the CloudSpanner storage code. CloudSpanner -storage has now been tested up to ~3.1 billion log entries. - -Explicit health checks have been added to the gRPC Log and Map servers (and the -log signer). The HTTP endpoint must be enabled and the checks will serve on -`/healthz` where a non 200 response means the server is unhealthy. The example -Kubernetes deployment configuration has been updated to include them. Other -improvements have been made to the Kubernetes deployment scripts and docs. - -The gRPC Log and Map servers have been instrumented for tracing with -[OpenCensus](https://opencensus.io/). For GCP it just requires the `--tracing` -flag to be added and results will be available in the GCP console under -StackDriver -> Trace. - -Commit -[3a68a845f0febdd36937c15f1d97a3a0f9509440](https://api.github.com/repos/google/trillian/commits/3a68a845f0febdd36937c15f1d97a3a0f9509440) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.1.1) - -## v1.1.0 - CloudSpanner Improvements & Log Root structure changes etc. - -Published 2018-04-17 08:02:50 +0000 UTC - -Changes are in progress (e.g. see #1037) to rework the internal signed root -format used by the log RPC server to be more useful / interoperable. Currently -they are mostly internal API changes to the log and map servers. However, the -`signature` and `log_id` fields in SignedLogRoot have been deleted and users -must unpack the serialized structure to access these now. This change is not -backwards compatible. - -Changes have been made to log server APIs and CT frontends for when a request -hits a server that has an earlier version of the tree than is needed to satisfy -the request. In these cases the log server used to return an error but now -returns an empty proof along with the current STH it has available. This allows -clients to detect these cases and handle them appropriately. - -The CloudSpanner schema has changed. If you have a database instance you'll need -to recreate it with the new schema. Performance has been noticeably improved -since the previous release and we have tested it to approx one billion log -entries. Note: This code is still being developed and further changes are -possible. - -Support for `sqlite` in unit tests has been removed because of ongoing issues -with flaky tests. These were caused by concurrent accesses to the same database, -which it doesn't support. The use of `sqlite` in production has never been -supported and it should not be used for this. - -Commit -[9a5dc6223bab0e1061b66b49757c2418c47b9f29](https://api.github.com/repos/google/trillian/commits/9a5dc6223bab0e1061b66b49757c2418c47b9f29) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.1.0) - -## v1.0.8 - Docker Updates / Freezing Logs / CloudSpanner Options - -Published 2018-03-08 13:42:11 +0000 UTC - -The Docker image files have been updated and the database has been changed to -`MariaDB 10.1`. - -A `ReadOnlyStaleness` option has been added to the experimental CloudSpanner -storage. This allows for tuning that might increase performance in some -scenarios by issuing read transactions with the `exact_staleness` option set -rather than `strong_read`. For more details see the -[CloudSpanner TransactionOptions](https://cloud.google.com/spanner/docs/reference/rest/v1/TransactionOptions) -documentation. - -The `LogVerifier` interface has been removed from the log client, though the -functionality is still available. It is unlikely that there were implementations -by third-parties. - -A new `TreeState DRAINING` has been added for trees with `TreeType LOG`. This is -to support logs being cleanly frozen. A log tree in this state will not accept -new entries via `QueueLeaves` but will continue to integrate any that were -previously queued. When the queue of pending entries has been emptied the tree -can be set to the `FROZEN` state safely. For MySQL storage this requires a -schema update to add `'DRAINING'` to the enum of valid states. - -A command line utility `updatetree` has been added to allow tree states to be -changed. This is also to support cleanly freezing logs. - -A 'howto' document has been added that explains how to freeze a log tree using -the features added in this release. - -Commit -[0e6d950b872d19e42320f4714820f0fe793b9913](https://api.github.com/repos/google/trillian/commits/0e6d950b872d19e42320f4714820f0fe793b9913) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.8) - -## v1.0.7 - Storage API Changes, Schema Tweaks - -Published 2018-03-01 11:16:32 +0000 UTC - -Note: A large number of storage related API changes have been made in this -release. These will probably only affect developers writing their own storage -implementations. - -A new tree type `ORDERED_LOG` has been added for upcoming mirror support. This -requires a schema change before it can be used. This change can be made when -convenient and can be deferred until the functionality is available and needed. -The definition of the `TreeType` column enum should be changed to `ENUM('LOG', -'MAP', 'PREORDERED_LOG') NOT NULL` - -Some storage interfaces were removed in #977 as they only had one -implementation. We think this won't cause any impact on third parties and are -willing to reconsider this change if it does. - -The gRPC Log and Map server APIs have new methods `InitLog` and `InitMap` which -prepare newly created trees for use. Attempting to use trees that have not been -initialized will return the `FAILED_PRECONDITION` error -`storage.ErrTreeNeedsInit`. - -The gRPC Log server API has new methods `AddSequencedLeaf` and -`AddSequencedLeaves`. These are intended to support mirroring applications and -are not yet implemented. - -Storage APIs have been added such as `ReadWriteTransaction` which allows the -underlying storage to manage the transaction and optionally retry until success -or timeout. This is a more natural fit for some types of storage API such as -[CloudSpanner](https://cloud.google.com/spanner/docs/transactions) and possibly -other environments with managed transactions. - -The older `BeginXXX` methods were removed from the APIs. It should be fairly -easy to convert a custom storage implementation to the new API format as can be -seen from the changes made to the MySQL storage. - -The `GetOpts` options are no longer used by storage. This fixed the strange -situation of storage code having to pass manufactured dummy instances to -`GetTree`, which was being called in all the layers involved in request -processing. Various internal APIs were modified to take a `*trillian.Tree` -instead of an `int64`. - -A new storage implementation has been added for CloudSpanner. This is currently -experimental and does not yet support Map trees. We have also added Docker -examples for running Trillian in Google Cloud with CloudSpanner. - -The maximum size of a `VARBINARY` column in MySQL is too small to properly -support Map storage. The type has been changed in the schema to `MEDIUMBLOB`. -This can be done in place with an `ALTER TABLE` command but this could very be -slow for large databases as it is a change to the physical row layout. Note: -There is no need to make this change to the database if you are only using it -for Log storage e.g. for Certificate Transparency servers. - -The obsolete programs `queue_leaves` and `fetch_leaves` have been deleted. - -Commit -[7d73671537ca2a4745dc94da3dc93d32d7ce91f1](https://api.github.com/repos/google/trillian/commits/7d73671537ca2a4745dc94da3dc93d32d7ce91f1) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.7) - -## v1.0.6 - GetLeavesByRange. 403 Permission Errors. Signer Metrics. - -Published 2018-02-05 16:00:26 +0000 UTC - -A new log server RPC API has been added to get leaves in a range. This is a more -natural fit for CT type applications as it more closely follows the CT HTTP API. - -The server now returns 403 for permission denied where it used to return 500 -errors. This follows the behaviour of the C++ implementation. - -The log signer binary now reports metrics for the number it has signed and the -number of errors that have occurred. This is intended to give more insight into -the state of the queue and integration processing. - -Commit -[b20b3109af7b68227c83c5d930271eaa4f0be771](https://api.github.com/repos/google/trillian/commits/b20b3109af7b68227c83c5d930271eaa4f0be771) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.6) - -## v1.0.5 - TLS, Merge Delay Metrics, Easier Admin Tests - -Published 2018-02-07 09:41:08 +0000 UTC - -The API protos have been rebuilt with gRPC 1.3. - -Timestamps have been added to the log leaves in the MySQL database. Before -upgrading to this version you **must** make the following schema changes: - -* Add the following column to the `LeafData` table. If you have existing data - in the queue you might have to remove the NOT NULL clause: - `QueueTimestampNanos BIGINT NOT NULL` - -* Add the following column to the `SequencedLeafData` table: - `IntegrateTimestampNanos BIGINT NOT NULL` - -The above timestamps are used to export metrics via monitoring that give the -merge delay for each tree that is in use. This is a good metric to use for -alerting on. - -The Log and Map RPC servers now support TLS. - -AdminServer tests have been improved. - -Commit -[dec673baf984c3d22d7b314011d809258ec36821](https://api.github.com/repos/google/trillian/commits/dec673baf984c3d22d7b314011d809258ec36821) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.5) - -## v1.0.4 - Fix election issue. Large vendor updates. - -Published 2018-02-05 15:42:25 +0000 UTC - -An issue has been fixed where the master for a log could resign from the -election while it was in the process of integrating a batch of leaves. We do not -believe this could cause any issues with data integrity because of the versioned -tree storage. - -This release includes a large number of vendor commits merged to catch up with -etcd 3.2.10 and gRPC v1.3. - -Commit -[1713865ecca0dc8f7b4a8ed830a48ae250fd943b](https://api.github.com/repos/google/trillian/commits/1713865ecca0dc8f7b4a8ed830a48ae250fd943b) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.4) - -## v1.0.3 - Auth API. Interceptor fixes. Request validation + More - -Published 2018-02-05 15:33:08 +0000 UTC - -An authorization API has been added to the interceptors. This is intended for -future development and integration. - -Issues where the interceptor would not time out on `PutTokens` have been fixed. -This should make the quota system more robust. - -A bug has been fixed where the interceptor did not pass the context deadline -through to other requests it made. This would cause some failing requests to do -so after longer than the deadline with a misleading reason in the log. It did -not cause request failures if they would otherwise succeed. - -Metalinter has been added and the code has been cleaned up where appropriate. - -Docker and Kubernetes scripts have been available and images are now built with -Go 1.9. - -Sqlite has been introduced for unit tests where possible. Note that it is not -multi threaded and cannot support all our testing scenarios. We still require -MySQL for integration tests. Please note that Sqlite **must not** be used for -production deployments as RPC servers are multi threaded database clients. - -The Log RPC server now applies tighter validation to request parameters than -before. It's possible that some requests will be rejected. This should not -affect valid requests. - -The admin server will only create trees for the log type it is hosted in. For -example the admin server running in the Log server will not create Map trees. -This may be reviewed in future as applications can legitimately use both tree -types. - -Commit -[9d08b330ab4270a8e984072076c0b3e84eb4601b](https://api.github.com/repos/google/trillian/commits/9d08b330ab4270a8e984072076c0b3e84eb4601b) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.3) - -## v1.0.2 - TreeGC, Go 1.9, Update Private Keys. - -Published 2018-02-05 15:18:40 +0000 UTC - -Go 1.9 is required. - -It is now possible to update private keys via the admin API and this was added -to the available field masks. The key storage format has not changed so we -believe this change is transparent. - -Deleted trees are now garbage collected after an interval. This hard deletes -them and they cannot be recovered. Be aware of this before upgrading if you have -any that are in a soft deleted state. - -The Admin RPC API has been extended to allow trees to be undeleted - up to the -point where they are hard deleted as set out above. - -Commit -[442511ad82108654033c9daa4e72f8a79691dd32](https://api.github.com/repos/google/trillian/commits/442511ad82108654033c9daa4e72f8a79691dd32) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.2) - -## v1.0.1 - Batched Queue Option Added - -Published 2018-02-05 14:49:33 +0000 UTC - -Apart from fixes this release includes the option for a batched queue. This has -been reported to allow faster sequencing but is not enabled by default. - -If you want to switch to this you must build the code with the `--tags -batched_queue` option. You must then also apply a schema change if you are -running with a previous version of the database. Add the following column to the -`Unsequenced` table: - -`QueueID VARBINARY(32) DEFAULT NULL` - -If you don't plan to switch to the `batched_queue` mode then you don't need to -make the above change. - -Commit -[afd178f85c963f56ad2ae7d4721d139b1d6050b4](https://api.github.com/repos/google/trillian/commits/afd178f85c963f56ad2ae7d4721d139b1d6050b4) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0.1) - -## v1.0 - First Log version we believe was ready for use. To support CT. - -Published 2018-02-05 13:51:55 +0000 UTC - -Quota metrics published. Quota admin api + server implemented. Improvements to -local / AWS deployment. Map fixes and further development. ECDSA key handling -improvements. Key factory improvements. Code coverage added. Quota integration -test added. Etcd quota support in log and map connected up. Incompatibility with -C++ code fixed where consistency proof requests for first == second == 0 were -rejected. - -Commit -[a6546d092307f6e0d396068066033b434203824d](https://api.github.com/repos/google/trillian/commits/a6546d092307f6e0d396068066033b434203824d) -Download [zip](https://api.github.com/repos/google/trillian/zipball/v1.0) diff --git a/vendor/github.com/google/trillian/CODEOWNERS b/vendor/github.com/google/trillian/CODEOWNERS deleted file mode 100644 index 48985d872a..0000000000 --- a/vendor/github.com/google/trillian/CODEOWNERS +++ /dev/null @@ -1,21 +0,0 @@ -# See https://help.github.com/articles/about-codeowners/ -# for more info about CODEOWNERS file - -# It uses the same pattern rule for gitignore file -# https://git-scm.com/docs/gitignore#_pattern_format -# -# These owners will be the default owners for everything in -# the repo. Unless a later match takes precedence, -# @google/trillian-team will be requested for -# review when someone opens a pull request. -* @google/trillian-team - -/*.proto @mhutchinson @AlCutter @pphaneuf -/storage/storagepb/storage.proto @mhutchinson @AlCutter @pphaneuf - -# Mitigation for https://github.com/google/trillian/issues/1297 -# Folks to watch out for hanges to DB schemas and ensure that -# there's a note added in a sensible location about how to -# upgrade schema instances. -/storage/mysql/schema/* @mhutchinson @AlCutter @pphaneuf -/storage/cloudspanner/spanner.sdl @mhutchinson @AlCutter @pphaneuf diff --git a/vendor/github.com/google/trillian/CONTRIBUTING.md b/vendor/github.com/google/trillian/CONTRIBUTING.md deleted file mode 100644 index 43de4c9d47..0000000000 --- a/vendor/github.com/google/trillian/CONTRIBUTING.md +++ /dev/null @@ -1,58 +0,0 @@ -# How to contribute # - -We'd love to accept your patches and contributions to this project. There are -a just a few small guidelines you need to follow. - - -## Contributor License Agreement ## - -Contributions to any Google project must be accompanied by a Contributor -License Agreement. This is not a copyright **assignment**, it simply gives -Google permission to use and redistribute your contributions as part of the -project. - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual - CLA][]. - - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA][]. - -You generally only need to submit a CLA once, so if you've already submitted -one (even if it was for a different project), you probably don't need to do it -again. - -[individual CLA]: https://developers.google.com/open-source/cla/individual -[corporate CLA]: https://developers.google.com/open-source/cla/corporate - -Once your CLA is submitted (or if you already submitted one for -another Google project), make a commit adding yourself to the -[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part -of your first [pull request][]. - -[AUTHORS]: AUTHORS -[CONTRIBUTORS]: CONTRIBUTORS - - -## Submitting a patch ## - - 1. It's generally best to start by opening a new issue describing the bug or - feature you're intending to fix. Even if you think it's relatively minor, - it's helpful to know what people are working on. Mention in the initial - issue that you are planning to work on that bug or feature so that it can - be assigned to you. - - 1. Follow the normal process of [forking][] the project, and setup a new - branch to work in. It's important that each group of changes be done in - separate branches in order to ensure that a pull request only includes the - commits related to that bug or feature. - - 1. Do your best to have [well-formed commit messages][] for each change. - This provides consistency throughout the project, and ensures that commit - messages are able to be formatted properly by various git tools. - - 1. Finally, push the commits to your fork and submit a [pull request][]. - -[forking]: https://help.github.com/articles/fork-a-repo -[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[pull request]: https://help.github.com/articles/creating-a-pull-request diff --git a/vendor/github.com/google/trillian/CONTRIBUTORS b/vendor/github.com/google/trillian/CONTRIBUTORS deleted file mode 100644 index 680a58b981..0000000000 --- a/vendor/github.com/google/trillian/CONTRIBUTORS +++ /dev/null @@ -1,39 +0,0 @@ -# People who have agreed to one of the CLAs and can contribute patches. -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees are listed here -# but not in AUTHORS, because Google holds the copyright. -# -# Names should be added to this file only after verifying that -# the individual or the individual's organization has agreed to -# the appropriate Contributor License Agreement, found here: -# -# https://developers.google.com/open-source/cla/individual -# https://developers.google.com/open-source/cla/corporate -# -# The agreement for individuals can be filled out on the web. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file, depending on whether the -# individual or corporate CLA was used. -# -# Names should be added to this file as: -# Name -# -# Please keep the list sorted. - -Al Cutter -Alan Parra -Antonio Marcedone -Ben Laurie -David Drysdale -Gary Belvin -Roland Shoemaker -Martin Smith -Martin Hutchinson -Paul Hadfield -Pavel Kalinnikov -Pierre Phaneuf -Rob Percival -Roger Ng -Vishal Kuo diff --git a/vendor/github.com/google/trillian/LICENSE b/vendor/github.com/google/trillian/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/google/trillian/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/google/trillian/PULL_REQUEST_TEMPLATE.md b/vendor/github.com/google/trillian/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index f72f59ff8c..0000000000 --- a/vendor/github.com/google/trillian/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,15 +0,0 @@ - - -### Checklist - - - -- [ ] I have updated the [CHANGELOG](CHANGELOG.md). -- [ ] I have updated [documentation](docs/) accordingly (including the [feature implementation matrix](docs/Feature_Implementation_Matrix.md)). diff --git a/vendor/github.com/google/trillian/README.md b/vendor/github.com/google/trillian/README.md deleted file mode 100644 index 76f51fe951..0000000000 --- a/vendor/github.com/google/trillian/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# Trillian: General Transparency - -[![Go Report Card](https://goreportcard.com/badge/github.com/google/trillian)](https://goreportcard.com/report/github.com/google/trillian) -[![codecov](https://codecov.io/gh/google/trillian/branch/master/graph/badge.svg?token=QwofUwmvAs)](https://codecov.io/gh/google/trillian) -[![GoDoc](https://godoc.org/github.com/google/trillian?status.svg)](https://godoc.org/github.com/google/trillian) -[![Slack Status](https://img.shields.io/badge/Slack-Chat-blue.svg)](https://gtrillian.slack.com/) - - - [Overview](#overview) - - [Support](#support) - - [Using the Code](#using-the-code) - - [MySQL Setup](#mysql-setup) - - [Integration Tests](#integration-tests) - - [Working on the Code](#working-on-the-code) - - [Rebuilding Generated Code](#rebuilding-generated-code) - - [Updating Dependencies](#updating-dependencies) - - [Running Codebase Checks](#running-codebase-checks) - - [Design](#design) - - [Design Overview](#design-overview) - - [Personalities](#personalities) - - [Log Mode](#log-mode) - - [Use Cases](#use-cases) - - [Certificate Transparency Log](#certificate-transparency-log) - - -## Overview - -Trillian is an implementation of the concepts described in the -[Verifiable Data Structures](docs/papers/VerifiableDataStructures.pdf) white paper, -which in turn is an extension and generalisation of the ideas which underpin -[Certificate Transparency](https://certificate-transparency.org). - -Trillian implements a [Merkle tree](https://en.wikipedia.org/wiki/Merkle_tree) -whose contents are served from a data storage layer, to allow scalability to -extremely large trees. On top of this Merkle tree, Trillian provides the -following: - - - An append-only **Log** mode, analogous to the original - [Certificate Transparency](https://certificate-transparency.org) logs. In - this mode, the Merkle tree is effectively filled up from the left, giving a - *dense* Merkle tree. - -Note that Trillian requires particular applications to provide their own -[personalities](#personalities) on top of the core transparent data store -functionality. - -[Certificate Transparency (CT)](https://tools.ietf.org/html/rfc6962) -is the most well-known and widely deployed transparency application, and an implementation of CT as a Trillian personality is available in the -[certificate-transparency-go repo](https://github.com/google/certificate-transparency-go/blob/master/trillian). - -Other examples of Trillian personalities are available in the -[trillian-examples](https://github.com/google/trillian-examples) repo. - - -## Support - -- Mailing list: https://groups.google.com/forum/#!forum/trillian-transparency -- Slack: https://gtrillian.slack.com/ ([invitation](https://join.slack.com/t/gtrillian/shared_invite/enQtNDM3NTE3NjA4NDcwLTMwYzVlMDUxMDQ2MGU5MjcyZGIxMmVmZGNlNzdhMzRlOGFjMWJkNzc0MGY1Y2QyNWQyMWM4NzJlOGMxNTZkZGU)) - - -## Using the Code - -The Trillian codebase is stable and is used in production by multiple -organizations, including many large-scale -[Certificate Transparency](https://certificate.transparency.dev) log -operators. - -Given this, we do not plan to add any new features to this version of Trillian, -and will try to avoid any further incompatible code and schema changes but -cannot guarantee that they will never be necessary. - -The current state of feature implementation is recorded in the -[Feature implementation matrix](docs/Feature_Implementation_Matrix.md). - -To build and test Trillian you need: - - - Go 1.19 or later (go 1.19 matches cloudbuild, and is preferred for developers - that will be submitting PRs to this project). - -To run many of the tests (and production deployment) you need: - - - [MySQL](https://www.mysql.com/) or [MariaDB](https://mariadb.org/) to provide - the data storage layer; see the [MySQL Setup](#mysql-setup) section. - -Note that this repository uses Go modules to manage dependencies; Go will fetch -and install them automatically upon build/test. - -To fetch the code, dependencies, and build Trillian, run the following: - -```bash -git clone https://github.com/google/trillian.git -cd trillian - -go build ./... -``` - -To build and run tests, use: - -```bash -go test ./... -``` - - -The repository also includes multi-process integration tests, described in the -[Integration Tests](#integration-tests) section below. - - -### MySQL Setup - -To run Trillian's integration tests you need to have an instance of MySQL -running and configured to: - - - listen on the standard MySQL port 3306 (so `mysql --host=127.0.0.1 - --port=3306` connects OK) - - not require a password for the `root` user - -You can then set up the [expected tables](storage/mysql/schema/storage.sql) in a -`test` database like so: - -```bash -./scripts/resetdb.sh -Warning: about to destroy and reset database 'test' -Are you sure? y -> Resetting DB... -> Reset Complete -``` - -### Integration Tests - -Trillian includes an integration test suite to confirm basic end-to-end -functionality, which can be run with: - -```bash -./integration/integration_test.sh -``` - -This runs a multi-process test: - - - A [test](integration/log_integration_test.go) that starts a Trillian server - in Log mode, together with a signer, logs many leaves, and checks they are - integrated correctly. - -### Deployment - -You can find instructions on how to deploy Trillian in [deployment](/deployment) -and [examples/deployment](/examples/deployment) directories. - -## Working on the Code - -Developers who want to make changes to the Trillian codebase need some -additional dependencies and tools, described in the following sections. The -[Cloud Build configuration](cloudbuild.yaml) and the scripts it depends on are -also a useful reference for the required tools and scripts, as it may be more -up-to-date than this document. - -### Rebuilding Generated Code - -Some of the Trillian Go code is autogenerated from other files: - - - [gRPC](http://www.grpc.io/) message structures are originally provided as - [protocol buffer](https://developers.google.com/protocol-buffers/) message - definitions. See also, https://grpc.io/docs/protoc-installation/. - - Some unit tests use mock implementations of interfaces; these are created - from the real implementations by [GoMock](https://github.com/golang/mock). - - Some enums have string-conversion methods (satisfying the `fmt.Stringer` - interface) created using the - [stringer](https://godoc.org/golang.org/x/tools/cmd/stringer) tool (`go get - golang.org/x/tools/cmd/stringer`). - -Re-generating mock or protobuffer files is only needed if you're changing -the original files; if you do, you'll need to install the prerequisites: - - - a series of tools, using `go install` to ensure that the versions are - compatible and tested: - - ``` - cd $(go list -f '{{ .Dir }}' github.com/google/trillian); \ - go install github.com/golang/mock/mockgen; \ - go install google.golang.org/protobuf/proto; \ - go install google.golang.org/protobuf/cmd/protoc-gen-go; \ - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc; \ - go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc; \ - go install golang.org/x/tools/cmd/stringer - ``` - -and run the following: - -```bash -go generate -x ./... # hunts for //go:generate comments and runs them -``` - -### Updating Dependencies - -The Trillian codebase uses go.mod to declare fixed versions of its dependencies. -With Go modules, updating a dependency simply involves running `go get`: -``` -go get package/path # Fetch the latest published version -go get package/path@X.Y.Z # Fetch a specific published version -go get package/path@HEAD # Fetch the latest commit -``` - -To update ALL dependencies to the latest version run `go get -u`. -Be warned however, that this may undo any selected versions that resolve issues in other non-module repos. - -While running `go build` and `go test`, go will add any ambiguous transitive dependencies to `go.mod` -To clean these up run: -``` -go mod tidy -``` - -### Running Codebase Checks - -The [`scripts/presubmit.sh`](scripts/presubmit.sh) script runs various tools -and tests over the codebase. - -#### Install [golangci-lint](https://github.com/golangci/golangci-lint#local-installation). -```bash -go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.1 -``` - -#### Run code generation, build, test and linters -```bash -./scripts/presubmit.sh -``` - -#### Or just run the linters alone -```bash -golangci-lint run -``` - - -## Design - -### Design Overview - -Trillian is primarily implemented as a -[gRPC service](http://www.grpc.io/docs/guides/concepts.html#service-definition); -this service receives get/set requests over gRPC and retrieves the corresponding -Merkle tree data from a separate storage layer (currently using MySQL), ensuring -that the cryptographic properties of the tree are preserved along the way. - -The Trillian service is multi-tenanted – a single Trillian installation can -support multiple Merkle trees in parallel, distinguished by their `TreeId` – and -each tree operates in one of two modes: - - - **Log** mode: an append-only collection of items; this has two sub-modes: - - normal Log mode, where the Trillian service assigns sequence numbers to - new tree entries as they arrive - - 'preordered' Log mode, where the unique sequence number for entries in - the Merkle tree is externally specified - -In either case, Trillian's key transparency property is that cryptographic -proofs of inclusion/consistency are available for data items added to the -service. - - -### Personalities - -To build a complete transparent application, the Trillian core service needs -to be paired with additional code, known as a *personality*, that provides -functionality that is specific to the particular application. - -In particular, the personality is responsible for: - - * **Admission Criteria** – ensuring that submissions comply with the - overall purpose of the application. - * **Canonicalization** – ensuring that equivalent versions of the same - data get the same canonical identifier, so they can be de-duplicated by - the Trillian core service. - * **External Interface** – providing an API for external users, - including any practical constraints (ACLs, load-balancing, DoS protection, - etc.) - -This is -[described in more detail in a separate document](docs/Personalities.md). -General -[design considerations for transparent Log applications](docs/TransparentLogging.md) -are also discussed separately. - -### Log Mode - -When running in Log mode, Trillian provides a gRPC API whose operations are -similar to those available for Certificate Transparency logs -(cf. [RFC 6962](https://tools.ietf.org/html/6962)). These include: - - - `GetLatestSignedLogRoot` returns information about the current root of the - Merkle tree for the log, including the tree size, hash value, timestamp and - signature. - - `GetLeavesByRange` returns leaf information for particular leaves, - specified by their index in the log. - - `QueueLeaf` requests inclusion of the specified item into the log. - - For a pre-ordered log, `AddSequencedLeaves` requests the inclusion of - specified items into the log at specified places in the tree. - - `GetInclusionProof`, `GetInclusionProofByHash` and `GetConsistencyProof` - return inclusion and consistency proof data. - -In Log mode (whether normal or pre-ordered), Trillian includes an additional -Signer component; this component periodically processes pending items and -adds them to the Merkle tree, creating a new signed tree head as a result. - -![Log components](docs/images/LogDesign.png) - -(Note that each of the components in this diagram can be -[distributed](https://github.com/google/certificate-transparency-go/blob/master/trillian/docs/ManualDeployment.md#distribution), -for scalability and resilience.) - - -Use Cases ---------- - -### Certificate Transparency Log - -The most obvious application for Trillian in Log mode is to provide a -Certificate Transparency (RFC 6962) Log. To do this, the CT Log personality -needs to include all of the certificate-specific processing – in particular, -checking that an item that has been suggested for inclusion is indeed a valid -certificate that chains to an accepted root. - diff --git a/vendor/github.com/google/trillian/cloudbuild.yaml b/vendor/github.com/google/trillian/cloudbuild.yaml deleted file mode 100644 index 3e38dbed2a..0000000000 --- a/vendor/github.com/google/trillian/cloudbuild.yaml +++ /dev/null @@ -1,186 +0,0 @@ -# This file contains Google Cloud Build configuration for presubmit checks, unit -# and integration tests, triggered by pull requests and commits to branches. - -timeout: 1800s -substitutions: - _CODECOV_TOKEN: "" # The auth token for uploading coverage to Codecov. -options: - machineType: E2_HIGHCPU_32 - volumes: - # A shared volume for caching Go modules between steps. - - name: go-modules - path: /go - env: - - GOPATH=/go - - GOLANG_PROTOBUF_REGISTRATION_CONFLICT=ignore # Temporary work-around v1.proto already registered error. - - DOCKER_CLIENT_TIMEOUT=120 - - COMPOSE_HTTP_TIMEOUT=120 - -# Cache the testbase image in Container Regisrty, to be reused by subsequent -# builds. The technique is described here: -# https://cloud.google.com/cloud-build/docs/speeding-up-builds#using_a_cached_docker_image -# -# TODO(pavelkalinnikov): Consider pushing this image only on commits to master. -images: ['gcr.io/$PROJECT_ID/trillian_testbase:latest'] - -# Cloud Build logs sent to GCS bucket -logsBucket: 'gs://trillian-cloudbuild-logs' - -steps: - -# Try to pull the testbase image from Container Registry. -- name: 'gcr.io/cloud-builders/docker' - entrypoint: 'bash' - args: ['-c', 'docker pull gcr.io/$PROJECT_ID/trillian_testbase:latest || exit 0'] -# Build the testbase image reusing as much of the cached image as possible. -- name: 'gcr.io/cloud-builders/docker' - args: [ - 'build', - '-t', 'gcr.io/$PROJECT_ID/trillian_testbase:latest', - '--cache-from', 'gcr.io/$PROJECT_ID/trillian_testbase:latest', - '-f', './integration/cloudbuild/testbase/Dockerfile', - '.' - ] - -# Set up tools and any other common steps which should not be part of Docker image. -- id: prepare - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/prepare.sh - -# Run lint and porcelain checks, make sure the diff is empty and no files need -# to be updated. This includes gofmt, golangci-linter, go mod tidy, go mod -# generate and a few more. -- id: lint - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./scripts/presubmit.sh - args: - - --no-build - - --fix - - --no-mod-tidy - - --empty-diff - waitFor: - - prepare - -# Presubmit -- id: presubmit - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_presubmit.sh - args: - - --no-linters - - --no-generate - env: - - GOFLAGS=-race - - GO_TEST_TIMEOUT=20m - waitFor: - - lint - -# Codecov -- id: codecov - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_presubmit.sh - args: - - --coverage - - --no-linters - - --no-generate - env: - - GOFLAGS=-race - - GO_TEST_TIMEOUT=20m - - CODECOV_TOKEN=${_CODECOV_TOKEN} - waitFor: - - lint - -# Presubmit (Batched queue) -- id: presubmit_batched - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_presubmit.sh - args: - - --no-linters - - --no-generate - env: - - GOFLAGS=-race --tags=batched_queue - - GO_TEST_TIMEOUT=20m - waitFor: - - lint - -# Presubmit (PKCS11) -- id: presubmit_pkcs11 - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_presubmit.sh - args: - - --no-linters - - --no-generate - env: - - GOFLAGS=-race --tags=pkcs11 - - GO_TEST_TIMEOUT=20m - waitFor: - - lint - -# Try to spread the load a bit, we'll wait for all the presubmit.* steps -# to finish before starting the integration.* ones. -# Having too many "big" things running concurrently leads to problems -# with timeouts and mysql issues. -- id: presubmits_done - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: /bin/true - waitFor: - - codecov - - presubmit - - presubmit_batched - - presubmit_pkcs11 - -# Integration -- id: integration - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_integration.sh - env: - - GO_TEST_TIMEOUT=20m - waitFor: - - presubmits_done - -# Integration (Docker) -- id: integration_docker - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/docker_compose_integration_test.sh - waitFor: - - presubmits_done - -# Integration (etcd) -- id: integration_etcd - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_integration.sh - env: - - ETCD_DIR=/go/bin - - GOFLAGS=-race - - GO_TEST_TIMEOUT=20m - waitFor: - - presubmits_done - -# Integration (Batched queue) -- id: integration_batched - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_integration.sh - env: - - GOFLAGS=-race -tags=batched_queue - - GO_TEST_TIMEOUT=20m - waitFor: - - presubmits_done - -# Integration (PKCS11) -- id: integration_pkcs11 - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_integration.sh - env: - - GOFLAGS=-race -tags=pkcs11 - - GO_TEST_TIMEOUT=20m - waitFor: - - presubmits_done - -# Integration (MariaDB) -- id: integration_mariadb - name: 'gcr.io/${PROJECT_ID}/trillian_testbase' - entrypoint: ./integration/cloudbuild/run_integration.sh - env: - - GO_TEST_TIMEOUT=20m - - MYSQLD_IMAGE=mariadb:10.3 - waitFor: - - presubmits_done diff --git a/vendor/github.com/google/trillian/cloudbuild_master.yaml b/vendor/github.com/google/trillian/cloudbuild_master.yaml deleted file mode 100644 index 751478890a..0000000000 --- a/vendor/github.com/google/trillian/cloudbuild_master.yaml +++ /dev/null @@ -1,165 +0,0 @@ -timeout: 1800s -substitutions: - _CLUSTER_NAME: trillian-opensource-ci - _MASTER_ZONE: us-central1-a - _MYSQL_TAG: "5.7" - _MYSQL_ROOT_PASSWORD: "" - _MYSQL_PASSWORD: "" -options: - machineType: E2_HIGHCPU_32 -steps: -- id: pull_mysql - name : gcr.io/cloud-builders/docker - args: - - pull - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} -- id: tag_mysql - name: gcr.io/cloud-builders/docker - args: - - tag - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - pull_mysql -- id: push_mysql - name: gcr.io/cloud-builders/docker - args: - - push - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - tag_mysql -- id: build_db_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/db_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/db_server:${COMMIT_SHA} - - --destination=gcr.io/${PROJECT_ID}/db_server:latest - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: - - push_mysql -- id: build_log_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_server:${COMMIT_SHA} - - --destination=gcr.io/${PROJECT_ID}/log_server:latest - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ["-"] -- id: build_log_signer - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_signer/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_signer:${COMMIT_SHA} - - --destination=gcr.io/${PROJECT_ID}/log_signer:latest - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ["-"] -- id: build_envsubst - name: gcr.io/cloud-builders/docker - args: - - build - - examples/deployment/docker/envsubst - - -t - - envsubst - waitFor: ["-"] -# etcd-operator requires that a ClusterRole has been created for it already. -# Do this manually using examples/deployment/kubernetes/etcd-role*.yaml. -- id: apply_k8s_cfgs_for_clusterwide_etcd_operator - name: gcr.io/cloud-builders/kubectl - args: - - apply - - -f=examples/deployment/kubernetes/etcd-deployment.yaml - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: ["-"] -- id: copy_k8s_cfgs_for_spanner - name: busybox - entrypoint: cp - args: - - -r - - examples/deployment/kubernetes/ - - envsubst-spanner/ - waitFor: ['-'] -- id: envsubst_k8s_cfgs_for_spanner - name: envsubst - args: - - envsubst-spanner/etcd-cluster.yaml - - envsubst-spanner/trillian-ci-spanner.yaml - - envsubst-spanner/trillian-log-deployment.yaml - - envsubst-spanner/trillian-log-service.yaml - - envsubst-spanner/trillian-log-signer-deployment.yaml - - envsubst-spanner/trillian-log-signer-service.yaml - env: - - PROJECT_ID=${PROJECT_ID} - - IMAGE_TAG=${COMMIT_SHA} - waitFor: - - build_envsubst - - copy_k8s_cfgs_for_spanner -- id: apply_k8s_cfgs_for_spanner - name: gcr.io/cloud-builders/kubectl - args: - - apply - - -f=envsubst-spanner/etcd-cluster.yaml - - -f=envsubst-spanner/trillian-ci-spanner.yaml - - -f=envsubst-spanner/trillian-log-deployment.yaml - - -f=envsubst-spanner/trillian-log-service.yaml - - -f=envsubst-spanner/trillian-log-signer-deployment.yaml - - -f=envsubst-spanner/trillian-log-signer-service.yaml - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: - - envsubst_k8s_cfgs_for_spanner - - build_log_server - - build_log_signer -- id: copy_k8s_cfgs_for_mysql - name: busybox - entrypoint: cp - args: - - -r - - examples/deployment/kubernetes/ - - envsubst-mysql/ - waitFor: ['-'] -- id: envsubst_k8s_cfgs_for_mysql - name: envsubst - args: - - envsubst-mysql/etcd-cluster.yaml - - envsubst-mysql/trillian-ci-mysql.yaml - - envsubst-mysql/trillian-mysql.yaml - - envsubst-mysql/trillian-log-deployment.yaml - - envsubst-mysql/trillian-log-service.yaml - - envsubst-mysql/trillian-log-signer-deployment.yaml - - envsubst-mysql/trillian-log-signer-service.yaml - env: - - PROJECT_ID=${PROJECT_ID} - - IMAGE_TAG=${COMMIT_SHA} - - MYSQL_ROOT_PASSWORD=${_MYSQL_ROOT_PASSWORD} - - MYSQL_USER=trillian - - MYSQL_PASSWORD=${_MYSQL_PASSWORD} - - MYSQL_DATABASE=trillian - waitFor: - - build_envsubst - - copy_k8s_cfgs_for_mysql -- id: apply_k8s_cfgs_for_mysql - name: gcr.io/cloud-builders/kubectl - args: - - apply - - --namespace=mysql - - -f=envsubst-mysql/etcd-cluster.yaml - - -f=envsubst-mysql/trillian-ci-mysql.yaml - - -f=envsubst-mysql/trillian-mysql.yaml - - -f=envsubst-mysql/trillian-log-deployment.yaml - - -f=envsubst-mysql/trillian-log-service.yaml - - -f=envsubst-mysql/trillian-log-signer-deployment.yaml - - -f=envsubst-mysql/trillian-log-signer-service.yaml - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: - - envsubst_k8s_cfgs_for_mysql - - build_db_server - - build_log_server - - build_log_signer diff --git a/vendor/github.com/google/trillian/cloudbuild_pr.yaml b/vendor/github.com/google/trillian/cloudbuild_pr.yaml deleted file mode 100644 index 2309e5615f..0000000000 --- a/vendor/github.com/google/trillian/cloudbuild_pr.yaml +++ /dev/null @@ -1,175 +0,0 @@ -# This file contains configuration for Cloud Builds triggered by pull requests -# to this repository. - -timeout: 1800s -substitutions: - _CLUSTER_NAME: trillian-opensource-ci - _MASTER_ZONE: us-central1-a - _MYSQL_TAG: "5.7" - _MYSQL_ROOT_PASSWORD: "" - _MYSQL_PASSWORD: "" -options: - machineType: E2_HIGHCPU_32 - -steps: - -- id: pull_mysql - name : gcr.io/cloud-builders/docker - args: - - pull - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} -- id: tag_mysql - name: gcr.io/cloud-builders/docker - args: - - tag - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - pull_mysql -- id: push_mysql - name: gcr.io/cloud-builders/docker - args: - - push - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - tag_mysql - -- id: build_db_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/db_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/db_server:${COMMIT_SHA} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry. - waitFor: - - push_mysql - -- id: build_log_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_server:${COMMIT_SHA} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ['-'] -- id: build_log_signer - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_signer/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_signer:${COMMIT_SHA} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ['-'] - -- id: build_envsubst - name: gcr.io/cloud-builders/docker - args: - - build - - examples/deployment/docker/envsubst - - -t - - envsubst - waitFor: ["-"] -- id: apply_k8s_cfgs_for_clusterwide_etcd_operator_dryrun - name: gcr.io/cloud-builders/kubectl - args: - - apply - - --dry-run=server - - -f=examples/deployment/kubernetes/etcd-deployment.yaml - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: ['-'] -- id: copy_k8s_cfgs_for_spanner - name: busybox - entrypoint: cp - args: - - -r - - examples/deployment/kubernetes/ - - envsubst-spanner/ - waitFor: ['-'] -- id: envsubst_k8s_cfgs_for_spanner - name: envsubst - args: - - envsubst-spanner/etcd-cluster.yaml - - envsubst-spanner/trillian-ci-spanner.yaml - - envsubst-spanner/trillian-log-deployment.yaml - - envsubst-spanner/trillian-log-service.yaml - - envsubst-spanner/trillian-log-signer-deployment.yaml - - envsubst-spanner/trillian-log-signer-service.yaml - env: - - PROJECT_ID=${PROJECT_ID} - - IMAGE_TAG=${COMMIT_SHA} - waitFor: - - build_envsubst - - copy_k8s_cfgs_for_spanner -- id: apply_k8s_cfgs_for_spanner_dryrun - name: gcr.io/cloud-builders/kubectl - args: - - apply - - --dry-run=server - - -f=envsubst-spanner/etcd-cluster.yaml - - -f=envsubst-spanner/trillian-ci-spanner.yaml - - -f=envsubst-spanner/trillian-log-deployment.yaml - - -f=envsubst-spanner/trillian-log-service.yaml - - -f=envsubst-spanner/trillian-log-signer-deployment.yaml - - -f=envsubst-spanner/trillian-log-signer-service.yaml - - --prune - - --all - - --prune-whitelist=core/v1/ConfigMap - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: - - envsubst_k8s_cfgs_for_spanner - - build_log_server - - build_log_signer -- id: copy_k8s_cfgs_for_mysql - name: busybox - entrypoint: cp - args: - - -r - - examples/deployment/kubernetes/ - - envsubst-mysql/ - waitFor: ['-'] -- id: envsubst_k8s_cfgs_for_mysql - name: envsubst - args: - - envsubst-mysql/etcd-cluster.yaml - - envsubst-mysql/trillian-ci-mysql.yaml - - envsubst-mysql/trillian-mysql.yaml - - envsubst-mysql/trillian-log-deployment.yaml - - envsubst-mysql/trillian-log-service.yaml - - envsubst-mysql/trillian-log-signer-deployment.yaml - - envsubst-mysql/trillian-log-signer-service.yaml - env: - - PROJECT_ID=${PROJECT_ID} - - IMAGE_TAG=${COMMIT_SHA} - - MYSQL_ROOT_PASSWORD=${_MYSQL_ROOT_PASSWORD} - - MYSQL_PASSWORD=${_MYSQL_PASSWORD} - waitFor: - - build_envsubst - - copy_k8s_cfgs_for_mysql -- id: apply_k8s_cfgs_for_mysql_dryrun - name: gcr.io/cloud-builders/kubectl - args: - - apply - - --dry-run=server - - --namespace=mysql - - -f=envsubst-mysql/etcd-cluster.yaml - - -f=envsubst-mysql/trillian-ci-mysql.yaml - - -f=envsubst-mysql/trillian-mysql.yaml - - -f=envsubst-mysql/trillian-log-deployment.yaml - - -f=envsubst-mysql/trillian-log-service.yaml - - -f=envsubst-mysql/trillian-log-signer-deployment.yaml - - -f=envsubst-mysql/trillian-log-signer-service.yaml - - --prune - - --all - - --prune-whitelist=core/v1/ConfigMap - env: - - CLOUDSDK_COMPUTE_ZONE=${_MASTER_ZONE} - - CLOUDSDK_CONTAINER_CLUSTER=${_CLUSTER_NAME} - waitFor: - - envsubst_k8s_cfgs_for_mysql - - build_db_server - - build_log_server - - build_log_signer diff --git a/vendor/github.com/google/trillian/cloudbuild_tag.yaml b/vendor/github.com/google/trillian/cloudbuild_tag.yaml deleted file mode 100644 index 3455a9e4ab..0000000000 --- a/vendor/github.com/google/trillian/cloudbuild_tag.yaml +++ /dev/null @@ -1,51 +0,0 @@ -timeout: 1800s -substitutions: - _MYSQL_TAG: "5.7" -options: - machineType: E2_HIGHCPU_32 -steps: -- id: pull_mysql - name : gcr.io/cloud-builders/docker - args: - - pull - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} -- id: tag_mysql - name: gcr.io/cloud-builders/docker - args: - - tag - - marketplace.gcr.io/google/mysql5:${_MYSQL_TAG} - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - pull_mysql -- id: push_mysql - name: gcr.io/cloud-builders/docker - args: - - push - - gcr.io/${PROJECT_ID}/mysql5:${_MYSQL_TAG} - waitFor: - - tag_mysql -- id: build_db_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/db_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/db_server:${TAG_NAME} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: - - push_mysql -- id: build_log_server - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_server/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_server:${TAG_NAME} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ["-"] -- id: build_log_signer - name: gcr.io/kaniko-project/executor:v1.6.0 - args: - - --dockerfile=examples/deployment/docker/log_signer/Dockerfile - - --destination=gcr.io/${PROJECT_ID}/log_signer:${TAG_NAME} - - --cache=true - - --cache-dir= # Cache is in Google Container Registry - waitFor: ["-"] diff --git a/vendor/github.com/google/trillian/codecov.yml b/vendor/github.com/google/trillian/codecov.yml deleted file mode 100644 index cae92b04e5..0000000000 --- a/vendor/github.com/google/trillian/codecov.yml +++ /dev/null @@ -1,22 +0,0 @@ -# Customizations to codecov for Trillian repo. This will be merged into -# the team / default codecov yaml file. -# -# Validate changes with: -# curl --data-binary @codecov.yml https://codecov.io/validate - -# Exclude code that's for testing, demos or utilities that aren't really -# part of production releases. -ignore: - - "**/mock_*.go" - - "**/testonly" - - "docs" - - "examples" - - "integration" - - "testonly" - -coverage: - status: - project: - default: - # Allow 1% coverage drop without complaining, to avoid being too noisy. - threshold: 1% diff --git a/vendor/github.com/google/trillian/gen.go b/vendor/github.com/google/trillian/gen.go deleted file mode 100644 index 09fff99fae..0000000000 --- a/vendor/github.com/google/trillian/gen.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package trillian contains the generated protobuf code for the Trillian API. -package trillian - -//go:generate protoc -I=. -I=third_party/googleapis --go_out=paths=source_relative:. --go-grpc_out=paths=source_relative:. --go-grpc_opt=require_unimplemented_servers=false trillian_log_api.proto trillian_admin_api.proto trillian.proto --doc_out=markdown,api.md:./docs/ -//go:generate protoc -I=. --go_out=paths=source_relative:. crypto/keyspb/keyspb.proto - -//go:generate mockgen -package tmock -destination testonly/tmock/mock_log_server.go github.com/google/trillian TrillianLogServer -//go:generate mockgen -package tmock -destination testonly/tmock/mock_admin_server.go github.com/google/trillian TrillianAdminServer diff --git a/vendor/github.com/google/trillian/trillian.pb.go b/vendor/github.com/google/trillian/trillian.pb.go deleted file mode 100644 index 74d84d97e7..0000000000 --- a/vendor/github.com/google/trillian/trillian.pb.go +++ /dev/null @@ -1,808 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.20.1 -// source: trillian.proto - -package trillian - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - anypb "google.golang.org/protobuf/types/known/anypb" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// LogRootFormat specifies the fields that are covered by the -// SignedLogRoot signature, as well as their ordering and formats. -type LogRootFormat int32 - -const ( - LogRootFormat_LOG_ROOT_FORMAT_UNKNOWN LogRootFormat = 0 - LogRootFormat_LOG_ROOT_FORMAT_V1 LogRootFormat = 1 -) - -// Enum value maps for LogRootFormat. -var ( - LogRootFormat_name = map[int32]string{ - 0: "LOG_ROOT_FORMAT_UNKNOWN", - 1: "LOG_ROOT_FORMAT_V1", - } - LogRootFormat_value = map[string]int32{ - "LOG_ROOT_FORMAT_UNKNOWN": 0, - "LOG_ROOT_FORMAT_V1": 1, - } -) - -func (x LogRootFormat) Enum() *LogRootFormat { - p := new(LogRootFormat) - *p = x - return p -} - -func (x LogRootFormat) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (LogRootFormat) Descriptor() protoreflect.EnumDescriptor { - return file_trillian_proto_enumTypes[0].Descriptor() -} - -func (LogRootFormat) Type() protoreflect.EnumType { - return &file_trillian_proto_enumTypes[0] -} - -func (x LogRootFormat) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use LogRootFormat.Descriptor instead. -func (LogRootFormat) EnumDescriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{0} -} - -// Defines the way empty / node / leaf hashes are constructed incorporating -// preimage protection, which can be application specific. -type HashStrategy int32 - -const ( - // Hash strategy cannot be determined. Included to enable detection of - // mismatched proto versions being used. Represents an invalid value. - HashStrategy_UNKNOWN_HASH_STRATEGY HashStrategy = 0 - // Certificate Transparency strategy: leaf hash prefix = 0x00, node prefix = - // 0x01, empty hash is digest([]byte{}), as defined in the specification. - HashStrategy_RFC6962_SHA256 HashStrategy = 1 - // Sparse Merkle Tree strategy: leaf hash prefix = 0x00, node prefix = 0x01, - // empty branch is recursively computed from empty leaf nodes. - // NOT secure in a multi tree environment. For testing only. - HashStrategy_TEST_MAP_HASHER HashStrategy = 2 - // Append-only log strategy where leaf nodes are defined as the ObjectHash. - // All other properties are equal to RFC6962_SHA256. - HashStrategy_OBJECT_RFC6962_SHA256 HashStrategy = 3 - // The CONIKS sparse tree hasher with SHA512_256 as the hash algorithm. - HashStrategy_CONIKS_SHA512_256 HashStrategy = 4 - // The CONIKS sparse tree hasher with SHA256 as the hash algorithm. - HashStrategy_CONIKS_SHA256 HashStrategy = 5 -) - -// Enum value maps for HashStrategy. -var ( - HashStrategy_name = map[int32]string{ - 0: "UNKNOWN_HASH_STRATEGY", - 1: "RFC6962_SHA256", - 2: "TEST_MAP_HASHER", - 3: "OBJECT_RFC6962_SHA256", - 4: "CONIKS_SHA512_256", - 5: "CONIKS_SHA256", - } - HashStrategy_value = map[string]int32{ - "UNKNOWN_HASH_STRATEGY": 0, - "RFC6962_SHA256": 1, - "TEST_MAP_HASHER": 2, - "OBJECT_RFC6962_SHA256": 3, - "CONIKS_SHA512_256": 4, - "CONIKS_SHA256": 5, - } -) - -func (x HashStrategy) Enum() *HashStrategy { - p := new(HashStrategy) - *p = x - return p -} - -func (x HashStrategy) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (HashStrategy) Descriptor() protoreflect.EnumDescriptor { - return file_trillian_proto_enumTypes[1].Descriptor() -} - -func (HashStrategy) Type() protoreflect.EnumType { - return &file_trillian_proto_enumTypes[1] -} - -func (x HashStrategy) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use HashStrategy.Descriptor instead. -func (HashStrategy) EnumDescriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{1} -} - -// State of the tree. -type TreeState int32 - -const ( - // Tree state cannot be determined. Included to enable detection of - // mismatched proto versions being used. Represents an invalid value. - TreeState_UNKNOWN_TREE_STATE TreeState = 0 - // Active trees are able to respond to both read and write requests. - TreeState_ACTIVE TreeState = 1 - // Frozen trees are only able to respond to read requests, writing to a frozen - // tree is forbidden. Trees should not be frozen when there are entries - // in the queue that have not yet been integrated. See the DRAINING - // state for this case. - TreeState_FROZEN TreeState = 2 - // Deprecated: now tracked in Tree.deleted. - // - // Deprecated: Marked as deprecated in trillian.proto. - TreeState_DEPRECATED_SOFT_DELETED TreeState = 3 - // Deprecated: now tracked in Tree.deleted. - // - // Deprecated: Marked as deprecated in trillian.proto. - TreeState_DEPRECATED_HARD_DELETED TreeState = 4 - // A tree that is draining will continue to integrate queued entries. - // No new entries should be accepted. - TreeState_DRAINING TreeState = 5 -) - -// Enum value maps for TreeState. -var ( - TreeState_name = map[int32]string{ - 0: "UNKNOWN_TREE_STATE", - 1: "ACTIVE", - 2: "FROZEN", - 3: "DEPRECATED_SOFT_DELETED", - 4: "DEPRECATED_HARD_DELETED", - 5: "DRAINING", - } - TreeState_value = map[string]int32{ - "UNKNOWN_TREE_STATE": 0, - "ACTIVE": 1, - "FROZEN": 2, - "DEPRECATED_SOFT_DELETED": 3, - "DEPRECATED_HARD_DELETED": 4, - "DRAINING": 5, - } -) - -func (x TreeState) Enum() *TreeState { - p := new(TreeState) - *p = x - return p -} - -func (x TreeState) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TreeState) Descriptor() protoreflect.EnumDescriptor { - return file_trillian_proto_enumTypes[2].Descriptor() -} - -func (TreeState) Type() protoreflect.EnumType { - return &file_trillian_proto_enumTypes[2] -} - -func (x TreeState) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TreeState.Descriptor instead. -func (TreeState) EnumDescriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{2} -} - -// Type of the tree. -type TreeType int32 - -const ( - // Tree type cannot be determined. Included to enable detection of mismatched - // proto versions being used. Represents an invalid value. - TreeType_UNKNOWN_TREE_TYPE TreeType = 0 - // Tree represents a verifiable log. - TreeType_LOG TreeType = 1 - // Tree represents a verifiable pre-ordered log, i.e., a log whose entries are - // placed according to sequence numbers assigned outside of Trillian. - TreeType_PREORDERED_LOG TreeType = 3 -) - -// Enum value maps for TreeType. -var ( - TreeType_name = map[int32]string{ - 0: "UNKNOWN_TREE_TYPE", - 1: "LOG", - 3: "PREORDERED_LOG", - } - TreeType_value = map[string]int32{ - "UNKNOWN_TREE_TYPE": 0, - "LOG": 1, - "PREORDERED_LOG": 3, - } -) - -func (x TreeType) Enum() *TreeType { - p := new(TreeType) - *p = x - return p -} - -func (x TreeType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TreeType) Descriptor() protoreflect.EnumDescriptor { - return file_trillian_proto_enumTypes[3].Descriptor() -} - -func (TreeType) Type() protoreflect.EnumType { - return &file_trillian_proto_enumTypes[3] -} - -func (x TreeType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TreeType.Descriptor instead. -func (TreeType) EnumDescriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{3} -} - -// Represents a tree. -// Readonly attributes are assigned at tree creation, after which they may not -// be modified. -// -// Note: Many APIs within the rest of the code require these objects to -// be provided. For safety they should be obtained via Admin API calls and -// not created dynamically. -type Tree struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the tree. - // Readonly. - TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` - // State of the tree. - // Trees are ACTIVE after creation. At any point the tree may transition - // between ACTIVE, DRAINING and FROZEN states. - TreeState TreeState `protobuf:"varint,2,opt,name=tree_state,json=treeState,proto3,enum=trillian.TreeState" json:"tree_state,omitempty"` - // Type of the tree. - // Readonly after Tree creation. Exception: Can be switched from - // PREORDERED_LOG to LOG if the Tree is and remains in the FROZEN state. - TreeType TreeType `protobuf:"varint,3,opt,name=tree_type,json=treeType,proto3,enum=trillian.TreeType" json:"tree_type,omitempty"` - // Display name of the tree. - // Optional. - DisplayName string `protobuf:"bytes,8,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` - // Description of the tree, - // Optional. - Description string `protobuf:"bytes,9,opt,name=description,proto3" json:"description,omitempty"` - // Storage-specific settings. - // Varies according to the storage implementation backing Trillian. - StorageSettings *anypb.Any `protobuf:"bytes,13,opt,name=storage_settings,json=storageSettings,proto3" json:"storage_settings,omitempty"` - // Interval after which a new signed root is produced even if there have been - // no submission. If zero, this behavior is disabled. - MaxRootDuration *durationpb.Duration `protobuf:"bytes,15,opt,name=max_root_duration,json=maxRootDuration,proto3" json:"max_root_duration,omitempty"` - // Time of tree creation. - // Readonly. - CreateTime *timestamppb.Timestamp `protobuf:"bytes,16,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // Time of last tree update. - // Readonly (automatically assigned on updates). - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // If true, the tree has been deleted. - // Deleted trees may be undeleted during a certain time window, after which - // they're permanently deleted (and unrecoverable). - // Readonly. - Deleted bool `protobuf:"varint,19,opt,name=deleted,proto3" json:"deleted,omitempty"` - // Time of tree deletion, if any. - // Readonly. - DeleteTime *timestamppb.Timestamp `protobuf:"bytes,20,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"` -} - -func (x *Tree) Reset() { - *x = Tree{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Tree) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Tree) ProtoMessage() {} - -func (x *Tree) ProtoReflect() protoreflect.Message { - mi := &file_trillian_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Tree.ProtoReflect.Descriptor instead. -func (*Tree) Descriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{0} -} - -func (x *Tree) GetTreeId() int64 { - if x != nil { - return x.TreeId - } - return 0 -} - -func (x *Tree) GetTreeState() TreeState { - if x != nil { - return x.TreeState - } - return TreeState_UNKNOWN_TREE_STATE -} - -func (x *Tree) GetTreeType() TreeType { - if x != nil { - return x.TreeType - } - return TreeType_UNKNOWN_TREE_TYPE -} - -func (x *Tree) GetDisplayName() string { - if x != nil { - return x.DisplayName - } - return "" -} - -func (x *Tree) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *Tree) GetStorageSettings() *anypb.Any { - if x != nil { - return x.StorageSettings - } - return nil -} - -func (x *Tree) GetMaxRootDuration() *durationpb.Duration { - if x != nil { - return x.MaxRootDuration - } - return nil -} - -func (x *Tree) GetCreateTime() *timestamppb.Timestamp { - if x != nil { - return x.CreateTime - } - return nil -} - -func (x *Tree) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -func (x *Tree) GetDeleted() bool { - if x != nil { - return x.Deleted - } - return false -} - -func (x *Tree) GetDeleteTime() *timestamppb.Timestamp { - if x != nil { - return x.DeleteTime - } - return nil -} - -// SignedLogRoot represents a commitment by a Log to a particular tree. -// -// Note that the signature itself is no-longer provided by Trillian since -// https://github.com/google/trillian/pull/2452 . -// This functionality was intended to support a niche-use case but added -// significant complexity and was prone to causing confusion and -// misunderstanding for personality authors. -type SignedLogRoot struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // log_root holds the TLS-serialization of the following structure (described - // in RFC5246 notation): - // - // enum { v1(1), (65535)} Version; - // - // struct { - // uint64 tree_size; - // opaque root_hash<0..128>; - // uint64 timestamp_nanos; - // uint64 revision; - // opaque metadata<0..65535>; - // } LogRootV1; - // - // struct { - // Version version; - // select(version) { - // case v1: LogRootV1; - // } - // } LogRoot; - // - // A serialized v1 log root will therefore be laid out as: - // - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+-....--+ - // | ver=1 | tree_size |len| root_hash | - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+-....--+ - // - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - // | timestamp_nanos | revision | - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - // - // +---+---+---+---+---+-....---+ - // | len | metadata | - // +---+---+---+---+---+-....---+ - // - // (with all integers encoded big-endian). - LogRoot []byte `protobuf:"bytes,8,opt,name=log_root,json=logRoot,proto3" json:"log_root,omitempty"` -} - -func (x *SignedLogRoot) Reset() { - *x = SignedLogRoot{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SignedLogRoot) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SignedLogRoot) ProtoMessage() {} - -func (x *SignedLogRoot) ProtoReflect() protoreflect.Message { - mi := &file_trillian_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SignedLogRoot.ProtoReflect.Descriptor instead. -func (*SignedLogRoot) Descriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{1} -} - -func (x *SignedLogRoot) GetLogRoot() []byte { - if x != nil { - return x.LogRoot - } - return nil -} - -// Proof holds a consistency or inclusion proof for a Merkle tree, as returned -// by the API. -type Proof struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // leaf_index indicates the requested leaf index when this message is used for - // a leaf inclusion proof. This field is set to zero when this message is - // used for a consistency proof. - LeafIndex int64 `protobuf:"varint,1,opt,name=leaf_index,json=leafIndex,proto3" json:"leaf_index,omitempty"` - Hashes [][]byte `protobuf:"bytes,3,rep,name=hashes,proto3" json:"hashes,omitempty"` -} - -func (x *Proof) Reset() { - *x = Proof{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Proof) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Proof) ProtoMessage() {} - -func (x *Proof) ProtoReflect() protoreflect.Message { - mi := &file_trillian_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Proof.ProtoReflect.Descriptor instead. -func (*Proof) Descriptor() ([]byte, []int) { - return file_trillian_proto_rawDescGZIP(), []int{2} -} - -func (x *Proof) GetLeafIndex() int64 { - if x != nil { - return x.LeafIndex - } - return 0 -} - -func (x *Proof) GetHashes() [][]byte { - if x != nil { - return x.Hashes - } - return nil -} - -var File_trillian_proto protoreflect.FileDescriptor - -var file_trillian_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x08, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x05, 0x0a, 0x04, 0x54, 0x72, 0x65, 0x65, 0x12, - 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x12, 0x32, 0x0a, 0x0a, 0x74, 0x72, 0x65, 0x65, - 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x74, - 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, - 0x65, 0x52, 0x09, 0x74, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2f, 0x0a, 0x09, - 0x74, 0x72, 0x65, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x08, 0x74, 0x72, 0x65, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x3f, 0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, - 0x6e, 0x79, 0x52, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x73, 0x12, 0x45, 0x0a, 0x11, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, - 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x6d, 0x61, 0x78, 0x52, 0x6f, - 0x6f, 0x74, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x3b, - 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x14, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, - 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x4a, 0x04, 0x08, 0x04, 0x10, - 0x08, 0x4a, 0x04, 0x08, 0x0a, 0x10, 0x0d, 0x4a, 0x04, 0x08, 0x0e, 0x10, 0x0f, 0x4a, 0x04, 0x08, - 0x12, 0x10, 0x13, 0x52, 0x1e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x65, 0x70, - 0x6f, 0x63, 0x68, 0x52, 0x10, 0x64, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x5f, 0x70, - 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x0e, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x61, 0x6c, 0x67, 0x6f, - 0x72, 0x69, 0x74, 0x68, 0x6d, 0x52, 0x0d, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x73, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x52, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x6b, 0x65, - 0x79, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x52, 0x13, 0x73, - 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, - 0x68, 0x6d, 0x52, 0x16, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x63, 0x69, - 0x70, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x69, 0x74, 0x65, 0x52, 0x1e, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x5f, 0x73, - 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x22, 0x9d, 0x01, 0x0a, 0x0d, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x19, 0x0a, 0x08, - 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x6c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x08, 0x4a, 0x04, 0x08, - 0x09, 0x10, 0x0a, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x68, 0x69, 0x6e, 0x74, 0x52, 0x06, 0x6c, - 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x52, 0x12, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x5f, - 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, - 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x5f, 0x6e, 0x61, 0x6e, 0x6f, 0x73, - 0x52, 0x0d, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x50, 0x0a, 0x05, 0x50, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0c, 0x52, 0x06, 0x68, 0x61, 0x73, 0x68, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, - 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2a, 0x44, 0x0a, 0x0d, - 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x1b, 0x0a, - 0x17, 0x4c, 0x4f, 0x47, 0x5f, 0x52, 0x4f, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, - 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, - 0x47, 0x5f, 0x52, 0x4f, 0x4f, 0x54, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x56, 0x31, - 0x10, 0x01, 0x2a, 0x97, 0x01, 0x0a, 0x0c, 0x48, 0x61, 0x73, 0x68, 0x53, 0x74, 0x72, 0x61, 0x74, - 0x65, 0x67, 0x79, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x48, - 0x41, 0x53, 0x48, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x10, 0x00, 0x12, 0x12, - 0x0a, 0x0e, 0x52, 0x46, 0x43, 0x36, 0x39, 0x36, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, - 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4d, 0x41, 0x50, 0x5f, 0x48, - 0x41, 0x53, 0x48, 0x45, 0x52, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x42, 0x4a, 0x45, 0x43, - 0x54, 0x5f, 0x52, 0x46, 0x43, 0x36, 0x39, 0x36, 0x32, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, - 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4e, 0x49, 0x4b, 0x53, 0x5f, 0x53, 0x48, 0x41, - 0x35, 0x31, 0x32, 0x5f, 0x32, 0x35, 0x36, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x4f, 0x4e, - 0x49, 0x4b, 0x53, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x10, 0x05, 0x2a, 0x8b, 0x01, 0x0a, - 0x09, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, - 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x0a, - 0x0a, 0x06, 0x46, 0x52, 0x4f, 0x5a, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x1f, 0x0a, 0x17, 0x44, 0x45, - 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x53, 0x4f, 0x46, 0x54, 0x5f, 0x44, 0x45, - 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x03, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x1f, 0x0a, 0x17, 0x44, - 0x45, 0x50, 0x52, 0x45, 0x43, 0x41, 0x54, 0x45, 0x44, 0x5f, 0x48, 0x41, 0x52, 0x44, 0x5f, 0x44, - 0x45, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x04, 0x1a, 0x02, 0x08, 0x01, 0x12, 0x0c, 0x0a, 0x08, - 0x44, 0x52, 0x41, 0x49, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x05, 0x2a, 0x49, 0x0a, 0x08, 0x54, 0x72, - 0x65, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, - 0x4e, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x4c, 0x4f, 0x47, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x52, 0x45, 0x4f, 0x52, 0x44, - 0x45, 0x52, 0x45, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x10, 0x03, 0x22, 0x04, 0x08, 0x02, 0x10, 0x02, - 0x2a, 0x03, 0x4d, 0x41, 0x50, 0x42, 0x48, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x42, 0x0d, 0x54, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x1a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_trillian_proto_rawDescOnce sync.Once - file_trillian_proto_rawDescData = file_trillian_proto_rawDesc -) - -func file_trillian_proto_rawDescGZIP() []byte { - file_trillian_proto_rawDescOnce.Do(func() { - file_trillian_proto_rawDescData = protoimpl.X.CompressGZIP(file_trillian_proto_rawDescData) - }) - return file_trillian_proto_rawDescData -} - -var file_trillian_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_trillian_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_trillian_proto_goTypes = []interface{}{ - (LogRootFormat)(0), // 0: trillian.LogRootFormat - (HashStrategy)(0), // 1: trillian.HashStrategy - (TreeState)(0), // 2: trillian.TreeState - (TreeType)(0), // 3: trillian.TreeType - (*Tree)(nil), // 4: trillian.Tree - (*SignedLogRoot)(nil), // 5: trillian.SignedLogRoot - (*Proof)(nil), // 6: trillian.Proof - (*anypb.Any)(nil), // 7: google.protobuf.Any - (*durationpb.Duration)(nil), // 8: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp -} -var file_trillian_proto_depIdxs = []int32{ - 2, // 0: trillian.Tree.tree_state:type_name -> trillian.TreeState - 3, // 1: trillian.Tree.tree_type:type_name -> trillian.TreeType - 7, // 2: trillian.Tree.storage_settings:type_name -> google.protobuf.Any - 8, // 3: trillian.Tree.max_root_duration:type_name -> google.protobuf.Duration - 9, // 4: trillian.Tree.create_time:type_name -> google.protobuf.Timestamp - 9, // 5: trillian.Tree.update_time:type_name -> google.protobuf.Timestamp - 9, // 6: trillian.Tree.delete_time:type_name -> google.protobuf.Timestamp - 7, // [7:7] is the sub-list for method output_type - 7, // [7:7] is the sub-list for method input_type - 7, // [7:7] is the sub-list for extension type_name - 7, // [7:7] is the sub-list for extension extendee - 0, // [0:7] is the sub-list for field type_name -} - -func init() { file_trillian_proto_init() } -func file_trillian_proto_init() { - if File_trillian_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_trillian_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Tree); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SignedLogRoot); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Proof); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_trillian_proto_rawDesc, - NumEnums: 4, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_trillian_proto_goTypes, - DependencyIndexes: file_trillian_proto_depIdxs, - EnumInfos: file_trillian_proto_enumTypes, - MessageInfos: file_trillian_proto_msgTypes, - }.Build() - File_trillian_proto = out.File - file_trillian_proto_rawDesc = nil - file_trillian_proto_goTypes = nil - file_trillian_proto_depIdxs = nil -} diff --git a/vendor/github.com/google/trillian/trillian.proto b/vendor/github.com/google/trillian/trillian.proto deleted file mode 100644 index 78869ba962..0000000000 --- a/vendor/github.com/google/trillian/trillian.proto +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "com.google.trillian.proto"; -option java_outer_classname = "TrillianProto"; -option go_package = "github.com/google/trillian"; - -package trillian; - -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// LogRootFormat specifies the fields that are covered by the -// SignedLogRoot signature, as well as their ordering and formats. -enum LogRootFormat { - LOG_ROOT_FORMAT_UNKNOWN = 0; - LOG_ROOT_FORMAT_V1 = 1; -} - -// What goes in here? -// Things which are exposed through the public trillian APIs. - -// Defines the way empty / node / leaf hashes are constructed incorporating -// preimage protection, which can be application specific. -enum HashStrategy { - // Hash strategy cannot be determined. Included to enable detection of - // mismatched proto versions being used. Represents an invalid value. - UNKNOWN_HASH_STRATEGY = 0; - - // Certificate Transparency strategy: leaf hash prefix = 0x00, node prefix = - // 0x01, empty hash is digest([]byte{}), as defined in the specification. - RFC6962_SHA256 = 1; - - // Sparse Merkle Tree strategy: leaf hash prefix = 0x00, node prefix = 0x01, - // empty branch is recursively computed from empty leaf nodes. - // NOT secure in a multi tree environment. For testing only. - TEST_MAP_HASHER = 2; - - // Append-only log strategy where leaf nodes are defined as the ObjectHash. - // All other properties are equal to RFC6962_SHA256. - OBJECT_RFC6962_SHA256 = 3; - - // The CONIKS sparse tree hasher with SHA512_256 as the hash algorithm. - CONIKS_SHA512_256 = 4; - - // The CONIKS sparse tree hasher with SHA256 as the hash algorithm. - CONIKS_SHA256 = 5; -} - -// State of the tree. -enum TreeState { - // Tree state cannot be determined. Included to enable detection of - // mismatched proto versions being used. Represents an invalid value. - UNKNOWN_TREE_STATE = 0; - - // Active trees are able to respond to both read and write requests. - ACTIVE = 1; - - // Frozen trees are only able to respond to read requests, writing to a frozen - // tree is forbidden. Trees should not be frozen when there are entries - // in the queue that have not yet been integrated. See the DRAINING - // state for this case. - FROZEN = 2; - - // Deprecated: now tracked in Tree.deleted. - DEPRECATED_SOFT_DELETED = 3 [deprecated = true]; - - // Deprecated: now tracked in Tree.deleted. - DEPRECATED_HARD_DELETED = 4 [deprecated = true]; - - // A tree that is draining will continue to integrate queued entries. - // No new entries should be accepted. - DRAINING = 5; -} - -// Type of the tree. -enum TreeType { - // Tree type cannot be determined. Included to enable detection of mismatched - // proto versions being used. Represents an invalid value. - UNKNOWN_TREE_TYPE = 0; - - // Tree represents a verifiable log. - LOG = 1; - - // Tree represents a verifiable pre-ordered log, i.e., a log whose entries are - // placed according to sequence numbers assigned outside of Trillian. - PREORDERED_LOG = 3; - - reserved 2; - reserved "MAP"; -} - -// Represents a tree. -// Readonly attributes are assigned at tree creation, after which they may not -// be modified. -// -// Note: Many APIs within the rest of the code require these objects to -// be provided. For safety they should be obtained via Admin API calls and -// not created dynamically. -message Tree { - // ID of the tree. - // Readonly. - int64 tree_id = 1; - - // State of the tree. - // Trees are ACTIVE after creation. At any point the tree may transition - // between ACTIVE, DRAINING and FROZEN states. - TreeState tree_state = 2; - - // Type of the tree. - // Readonly after Tree creation. Exception: Can be switched from - // PREORDERED_LOG to LOG if the Tree is and remains in the FROZEN state. - TreeType tree_type = 3; - - // Display name of the tree. - // Optional. - string display_name = 8; - - // Description of the tree, - // Optional. - string description = 9; - - // Storage-specific settings. - // Varies according to the storage implementation backing Trillian. - google.protobuf.Any storage_settings = 13; - - // Interval after which a new signed root is produced even if there have been - // no submission. If zero, this behavior is disabled. - google.protobuf.Duration max_root_duration = 15; - - // Time of tree creation. - // Readonly. - google.protobuf.Timestamp create_time = 16; - - // Time of last tree update. - // Readonly (automatically assigned on updates). - google.protobuf.Timestamp update_time = 17; - - // If true, the tree has been deleted. - // Deleted trees may be undeleted during a certain time window, after which - // they're permanently deleted (and unrecoverable). - // Readonly. - bool deleted = 19; - - // Time of tree deletion, if any. - // Readonly. - google.protobuf.Timestamp delete_time = 20; - - reserved 4 to 7, 10 to 12, 14, 18; - reserved "create_time_millis_since_epoch"; - reserved "duplicate_policy"; - reserved "hash_algorithm"; - reserved "hash_strategy"; - reserved "private_key"; - reserved "public_key"; - reserved "signature_algorithm"; - reserved "signature_cipher_suite"; - reserved "update_time_millis_since_epoch"; -} - -// SignedLogRoot represents a commitment by a Log to a particular tree. -// -// Note that the signature itself is no-longer provided by Trillian since -// https://github.com/google/trillian/pull/2452 . -// This functionality was intended to support a niche-use case but added -// significant complexity and was prone to causing confusion and -// misunderstanding for personality authors. -message SignedLogRoot { - // log_root holds the TLS-serialization of the following structure (described - // in RFC5246 notation): - // - // enum { v1(1), (65535)} Version; - // struct { - // uint64 tree_size; - // opaque root_hash<0..128>; - // uint64 timestamp_nanos; - // uint64 revision; - // opaque metadata<0..65535>; - // } LogRootV1; - // struct { - // Version version; - // select(version) { - // case v1: LogRootV1; - // } - // } LogRoot; - // - // A serialized v1 log root will therefore be laid out as: - // - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+-....--+ - // | ver=1 | tree_size |len| root_hash | - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+-....--+ - // - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - // | timestamp_nanos | revision | - // +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ - // - // +---+---+---+---+---+-....---+ - // | len | metadata | - // +---+---+---+---+---+-....---+ - // - // (with all integers encoded big-endian). - bytes log_root = 8; - - reserved 1 to 7, 9; - reserved "key_hint"; - reserved "log_id"; - reserved "log_root_signature"; - reserved "root_hash"; - reserved "signature"; - reserved "timestamp_nanos"; - reserved "tree_revision"; - reserved "tree_size"; -} - -// Proof holds a consistency or inclusion proof for a Merkle tree, as returned -// by the API. -message Proof { - // leaf_index indicates the requested leaf index when this message is used for - // a leaf inclusion proof. This field is set to zero when this message is - // used for a consistency proof. - int64 leaf_index = 1; - repeated bytes hashes = 3; - - reserved 2; - reserved "proof_node"; -} diff --git a/vendor/github.com/google/trillian/trillian_admin_api.pb.go b/vendor/github.com/google/trillian/trillian_admin_api.pb.go deleted file mode 100644 index a4123cdd49..0000000000 --- a/vendor/github.com/google/trillian/trillian_admin_api.pb.go +++ /dev/null @@ -1,621 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.20.1 -// source: trillian_admin_api.proto - -package trillian - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ListTrees request. -// No filters or pagination options are provided. -type ListTreesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // If true, deleted trees are included in the response. - ShowDeleted bool `protobuf:"varint,1,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"` -} - -func (x *ListTreesRequest) Reset() { - *x = ListTreesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTreesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTreesRequest) ProtoMessage() {} - -func (x *ListTreesRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTreesRequest.ProtoReflect.Descriptor instead. -func (*ListTreesRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{0} -} - -func (x *ListTreesRequest) GetShowDeleted() bool { - if x != nil { - return x.ShowDeleted - } - return false -} - -// ListTrees response. -// No pagination is provided, all trees the requester has access to are -// returned. -type ListTreesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Trees matching the list request filters. - Tree []*Tree `protobuf:"bytes,1,rep,name=tree,proto3" json:"tree,omitempty"` -} - -func (x *ListTreesResponse) Reset() { - *x = ListTreesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListTreesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListTreesResponse) ProtoMessage() {} - -func (x *ListTreesResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ListTreesResponse.ProtoReflect.Descriptor instead. -func (*ListTreesResponse) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{1} -} - -func (x *ListTreesResponse) GetTree() []*Tree { - if x != nil { - return x.Tree - } - return nil -} - -// GetTree request. -type GetTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the tree to retrieve. - TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` -} - -func (x *GetTreeRequest) Reset() { - *x = GetTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetTreeRequest) ProtoMessage() {} - -func (x *GetTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetTreeRequest.ProtoReflect.Descriptor instead. -func (*GetTreeRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{2} -} - -func (x *GetTreeRequest) GetTreeId() int64 { - if x != nil { - return x.TreeId - } - return 0 -} - -// CreateTree request. -type CreateTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tree to be created. See Tree and CreateTree for more details. - Tree *Tree `protobuf:"bytes,1,opt,name=tree,proto3" json:"tree,omitempty"` -} - -func (x *CreateTreeRequest) Reset() { - *x = CreateTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTreeRequest) ProtoMessage() {} - -func (x *CreateTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateTreeRequest.ProtoReflect.Descriptor instead. -func (*CreateTreeRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{3} -} - -func (x *CreateTreeRequest) GetTree() *Tree { - if x != nil { - return x.Tree - } - return nil -} - -// UpdateTree request. -type UpdateTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Tree to be updated. - Tree *Tree `protobuf:"bytes,1,opt,name=tree,proto3" json:"tree,omitempty"` - // Fields modified by the update request. - // For example: "tree_state", "display_name", "description". - UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` -} - -func (x *UpdateTreeRequest) Reset() { - *x = UpdateTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateTreeRequest) ProtoMessage() {} - -func (x *UpdateTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateTreeRequest.ProtoReflect.Descriptor instead. -func (*UpdateTreeRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{4} -} - -func (x *UpdateTreeRequest) GetTree() *Tree { - if x != nil { - return x.Tree - } - return nil -} - -func (x *UpdateTreeRequest) GetUpdateMask() *fieldmaskpb.FieldMask { - if x != nil { - return x.UpdateMask - } - return nil -} - -// DeleteTree request. -type DeleteTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the tree to delete. - TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` -} - -func (x *DeleteTreeRequest) Reset() { - *x = DeleteTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteTreeRequest) ProtoMessage() {} - -func (x *DeleteTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteTreeRequest.ProtoReflect.Descriptor instead. -func (*DeleteTreeRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteTreeRequest) GetTreeId() int64 { - if x != nil { - return x.TreeId - } - return 0 -} - -// UndeleteTree request. -type UndeleteTreeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // ID of the tree to undelete. - TreeId int64 `protobuf:"varint,1,opt,name=tree_id,json=treeId,proto3" json:"tree_id,omitempty"` -} - -func (x *UndeleteTreeRequest) Reset() { - *x = UndeleteTreeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_admin_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UndeleteTreeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UndeleteTreeRequest) ProtoMessage() {} - -func (x *UndeleteTreeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_admin_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UndeleteTreeRequest.ProtoReflect.Descriptor instead. -func (*UndeleteTreeRequest) Descriptor() ([]byte, []int) { - return file_trillian_admin_api_proto_rawDescGZIP(), []int{6} -} - -func (x *UndeleteTreeRequest) GetTreeId() int64 { - if x != nil { - return x.TreeId - } - return 0 -} - -var File_trillian_admin_api_proto protoreflect.FileDescriptor - -var file_trillian_admin_api_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x5f, 0x61, 0x64, 0x6d, 0x69, 0x6e, - 0x5f, 0x61, 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x72, 0x69, 0x6c, - 0x6c, 0x69, 0x61, 0x6e, 0x1a, 0x0e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x35, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, - 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, - 0x6f, 0x77, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x37, 0x0a, - 0x11, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0e, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, - 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x22, 0x29, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x65, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, - 0x64, 0x22, 0x47, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, - 0x54, 0x72, 0x65, 0x65, 0x52, 0x04, 0x74, 0x72, 0x65, 0x65, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, - 0x52, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x22, 0x74, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x22, 0x0a, 0x04, 0x74, 0x72, 0x65, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x52, 0x04, 0x74, - 0x72, 0x65, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, - 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, - 0x22, 0x2c, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x22, 0x2e, - 0x0a, 0x13, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x74, 0x72, 0x65, 0x65, 0x49, 0x64, 0x32, 0x86, - 0x03, 0x0a, 0x0d, 0x54, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x41, 0x64, 0x6d, 0x69, 0x6e, - 0x12, 0x46, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x73, 0x12, 0x1a, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x72, 0x69, 0x6c, - 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x35, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x54, - 0x72, 0x65, 0x65, 0x12, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, - 0x65, 0x74, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x22, 0x00, 0x12, - 0x3b, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1b, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, - 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x72, 0x69, - 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0a, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1b, 0x2e, 0x74, 0x72, 0x69, - 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0a, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1b, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, - 0x54, 0x72, 0x65, 0x65, 0x22, 0x00, 0x12, 0x3f, 0x0a, 0x0c, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x12, 0x1d, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, - 0x6e, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x72, 0x65, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, - 0x2e, 0x54, 0x72, 0x65, 0x65, 0x22, 0x00, 0x42, 0x50, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x15, 0x54, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x41, 0x64, - 0x6d, 0x69, 0x6e, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, -} - -var ( - file_trillian_admin_api_proto_rawDescOnce sync.Once - file_trillian_admin_api_proto_rawDescData = file_trillian_admin_api_proto_rawDesc -) - -func file_trillian_admin_api_proto_rawDescGZIP() []byte { - file_trillian_admin_api_proto_rawDescOnce.Do(func() { - file_trillian_admin_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_trillian_admin_api_proto_rawDescData) - }) - return file_trillian_admin_api_proto_rawDescData -} - -var file_trillian_admin_api_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_trillian_admin_api_proto_goTypes = []interface{}{ - (*ListTreesRequest)(nil), // 0: trillian.ListTreesRequest - (*ListTreesResponse)(nil), // 1: trillian.ListTreesResponse - (*GetTreeRequest)(nil), // 2: trillian.GetTreeRequest - (*CreateTreeRequest)(nil), // 3: trillian.CreateTreeRequest - (*UpdateTreeRequest)(nil), // 4: trillian.UpdateTreeRequest - (*DeleteTreeRequest)(nil), // 5: trillian.DeleteTreeRequest - (*UndeleteTreeRequest)(nil), // 6: trillian.UndeleteTreeRequest - (*Tree)(nil), // 7: trillian.Tree - (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask -} -var file_trillian_admin_api_proto_depIdxs = []int32{ - 7, // 0: trillian.ListTreesResponse.tree:type_name -> trillian.Tree - 7, // 1: trillian.CreateTreeRequest.tree:type_name -> trillian.Tree - 7, // 2: trillian.UpdateTreeRequest.tree:type_name -> trillian.Tree - 8, // 3: trillian.UpdateTreeRequest.update_mask:type_name -> google.protobuf.FieldMask - 0, // 4: trillian.TrillianAdmin.ListTrees:input_type -> trillian.ListTreesRequest - 2, // 5: trillian.TrillianAdmin.GetTree:input_type -> trillian.GetTreeRequest - 3, // 6: trillian.TrillianAdmin.CreateTree:input_type -> trillian.CreateTreeRequest - 4, // 7: trillian.TrillianAdmin.UpdateTree:input_type -> trillian.UpdateTreeRequest - 5, // 8: trillian.TrillianAdmin.DeleteTree:input_type -> trillian.DeleteTreeRequest - 6, // 9: trillian.TrillianAdmin.UndeleteTree:input_type -> trillian.UndeleteTreeRequest - 1, // 10: trillian.TrillianAdmin.ListTrees:output_type -> trillian.ListTreesResponse - 7, // 11: trillian.TrillianAdmin.GetTree:output_type -> trillian.Tree - 7, // 12: trillian.TrillianAdmin.CreateTree:output_type -> trillian.Tree - 7, // 13: trillian.TrillianAdmin.UpdateTree:output_type -> trillian.Tree - 7, // 14: trillian.TrillianAdmin.DeleteTree:output_type -> trillian.Tree - 7, // 15: trillian.TrillianAdmin.UndeleteTree:output_type -> trillian.Tree - 10, // [10:16] is the sub-list for method output_type - 4, // [4:10] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_trillian_admin_api_proto_init() } -func file_trillian_admin_api_proto_init() { - if File_trillian_admin_api_proto != nil { - return - } - file_trillian_proto_init() - if !protoimpl.UnsafeEnabled { - file_trillian_admin_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTreesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListTreesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_admin_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UndeleteTreeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_trillian_admin_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_trillian_admin_api_proto_goTypes, - DependencyIndexes: file_trillian_admin_api_proto_depIdxs, - MessageInfos: file_trillian_admin_api_proto_msgTypes, - }.Build() - File_trillian_admin_api_proto = out.File - file_trillian_admin_api_proto_rawDesc = nil - file_trillian_admin_api_proto_goTypes = nil - file_trillian_admin_api_proto_depIdxs = nil -} diff --git a/vendor/github.com/google/trillian/trillian_admin_api.proto b/vendor/github.com/google/trillian/trillian_admin_api.proto deleted file mode 100644 index 39aac0f8e3..0000000000 --- a/vendor/github.com/google/trillian/trillian_admin_api.proto +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "com.google.trillian.proto"; -option java_outer_classname = "TrillianAdminApiProto"; -option go_package = "github.com/google/trillian"; - -package trillian; - -import "trillian.proto"; -import "google/protobuf/field_mask.proto"; - -// ListTrees request. -// No filters or pagination options are provided. -message ListTreesRequest { - // If true, deleted trees are included in the response. - bool show_deleted = 1; -} - -// ListTrees response. -// No pagination is provided, all trees the requester has access to are -// returned. -message ListTreesResponse { - // Trees matching the list request filters. - repeated Tree tree = 1; -} - -// GetTree request. -message GetTreeRequest { - // ID of the tree to retrieve. - int64 tree_id = 1; -} - -// CreateTree request. -message CreateTreeRequest { - // Tree to be created. See Tree and CreateTree for more details. - Tree tree = 1; - - reserved 2; - reserved "key_spec"; -} - -// UpdateTree request. -message UpdateTreeRequest { - // Tree to be updated. - Tree tree = 1; - - // Fields modified by the update request. - // For example: "tree_state", "display_name", "description". - google.protobuf.FieldMask update_mask = 2; -} - -// DeleteTree request. -message DeleteTreeRequest { - // ID of the tree to delete. - int64 tree_id = 1; -} - -// UndeleteTree request. -message UndeleteTreeRequest { - // ID of the tree to undelete. - int64 tree_id = 1; -} - -// Trillian Administrative interface. -// Allows creation and management of Trillian trees. -service TrillianAdmin { - // Lists all trees the requester has access to. - rpc ListTrees(ListTreesRequest) returns (ListTreesResponse) {} - - // Retrieves a tree by ID. - rpc GetTree(GetTreeRequest) returns (Tree) {} - - // Creates a new tree. - // System-generated fields are not required and will be ignored if present, - // e.g.: tree_id, create_time and update_time. - // Returns the created tree, with all system-generated fields assigned. - rpc CreateTree(CreateTreeRequest) returns (Tree) {} - - // Updates a tree. - // See Tree for details. Readonly fields cannot be updated. - rpc UpdateTree(UpdateTreeRequest) returns (Tree) {} - - // Soft-deletes a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - rpc DeleteTree(DeleteTreeRequest) returns (Tree) {} - - // Undeletes a soft-deleted a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - rpc UndeleteTree(UndeleteTreeRequest) returns (Tree) {} -} diff --git a/vendor/github.com/google/trillian/trillian_admin_api_grpc.pb.go b/vendor/github.com/google/trillian/trillian_admin_api_grpc.pb.go deleted file mode 100644 index d01ca0759d..0000000000 --- a/vendor/github.com/google/trillian/trillian_admin_api_grpc.pb.go +++ /dev/null @@ -1,334 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.20.1 -// source: trillian_admin_api.proto - -package trillian - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - TrillianAdmin_ListTrees_FullMethodName = "/trillian.TrillianAdmin/ListTrees" - TrillianAdmin_GetTree_FullMethodName = "/trillian.TrillianAdmin/GetTree" - TrillianAdmin_CreateTree_FullMethodName = "/trillian.TrillianAdmin/CreateTree" - TrillianAdmin_UpdateTree_FullMethodName = "/trillian.TrillianAdmin/UpdateTree" - TrillianAdmin_DeleteTree_FullMethodName = "/trillian.TrillianAdmin/DeleteTree" - TrillianAdmin_UndeleteTree_FullMethodName = "/trillian.TrillianAdmin/UndeleteTree" -) - -// TrillianAdminClient is the client API for TrillianAdmin service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TrillianAdminClient interface { - // Lists all trees the requester has access to. - ListTrees(ctx context.Context, in *ListTreesRequest, opts ...grpc.CallOption) (*ListTreesResponse, error) - // Retrieves a tree by ID. - GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*Tree, error) - // Creates a new tree. - // System-generated fields are not required and will be ignored if present, - // e.g.: tree_id, create_time and update_time. - // Returns the created tree, with all system-generated fields assigned. - CreateTree(ctx context.Context, in *CreateTreeRequest, opts ...grpc.CallOption) (*Tree, error) - // Updates a tree. - // See Tree for details. Readonly fields cannot be updated. - UpdateTree(ctx context.Context, in *UpdateTreeRequest, opts ...grpc.CallOption) (*Tree, error) - // Soft-deletes a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - DeleteTree(ctx context.Context, in *DeleteTreeRequest, opts ...grpc.CallOption) (*Tree, error) - // Undeletes a soft-deleted a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - UndeleteTree(ctx context.Context, in *UndeleteTreeRequest, opts ...grpc.CallOption) (*Tree, error) -} - -type trillianAdminClient struct { - cc grpc.ClientConnInterface -} - -func NewTrillianAdminClient(cc grpc.ClientConnInterface) TrillianAdminClient { - return &trillianAdminClient{cc} -} - -func (c *trillianAdminClient) ListTrees(ctx context.Context, in *ListTreesRequest, opts ...grpc.CallOption) (*ListTreesResponse, error) { - out := new(ListTreesResponse) - err := c.cc.Invoke(ctx, TrillianAdmin_ListTrees_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianAdminClient) GetTree(ctx context.Context, in *GetTreeRequest, opts ...grpc.CallOption) (*Tree, error) { - out := new(Tree) - err := c.cc.Invoke(ctx, TrillianAdmin_GetTree_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianAdminClient) CreateTree(ctx context.Context, in *CreateTreeRequest, opts ...grpc.CallOption) (*Tree, error) { - out := new(Tree) - err := c.cc.Invoke(ctx, TrillianAdmin_CreateTree_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianAdminClient) UpdateTree(ctx context.Context, in *UpdateTreeRequest, opts ...grpc.CallOption) (*Tree, error) { - out := new(Tree) - err := c.cc.Invoke(ctx, TrillianAdmin_UpdateTree_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianAdminClient) DeleteTree(ctx context.Context, in *DeleteTreeRequest, opts ...grpc.CallOption) (*Tree, error) { - out := new(Tree) - err := c.cc.Invoke(ctx, TrillianAdmin_DeleteTree_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianAdminClient) UndeleteTree(ctx context.Context, in *UndeleteTreeRequest, opts ...grpc.CallOption) (*Tree, error) { - out := new(Tree) - err := c.cc.Invoke(ctx, TrillianAdmin_UndeleteTree_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TrillianAdminServer is the server API for TrillianAdmin service. -// All implementations should embed UnimplementedTrillianAdminServer -// for forward compatibility -type TrillianAdminServer interface { - // Lists all trees the requester has access to. - ListTrees(context.Context, *ListTreesRequest) (*ListTreesResponse, error) - // Retrieves a tree by ID. - GetTree(context.Context, *GetTreeRequest) (*Tree, error) - // Creates a new tree. - // System-generated fields are not required and will be ignored if present, - // e.g.: tree_id, create_time and update_time. - // Returns the created tree, with all system-generated fields assigned. - CreateTree(context.Context, *CreateTreeRequest) (*Tree, error) - // Updates a tree. - // See Tree for details. Readonly fields cannot be updated. - UpdateTree(context.Context, *UpdateTreeRequest) (*Tree, error) - // Soft-deletes a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - DeleteTree(context.Context, *DeleteTreeRequest) (*Tree, error) - // Undeletes a soft-deleted a tree. - // A soft-deleted tree may be undeleted for a certain period, after which - // it'll be permanently deleted. - UndeleteTree(context.Context, *UndeleteTreeRequest) (*Tree, error) -} - -// UnimplementedTrillianAdminServer should be embedded to have forward compatible implementations. -type UnimplementedTrillianAdminServer struct { -} - -func (UnimplementedTrillianAdminServer) ListTrees(context.Context, *ListTreesRequest) (*ListTreesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTrees not implemented") -} -func (UnimplementedTrillianAdminServer) GetTree(context.Context, *GetTreeRequest) (*Tree, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTree not implemented") -} -func (UnimplementedTrillianAdminServer) CreateTree(context.Context, *CreateTreeRequest) (*Tree, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTree not implemented") -} -func (UnimplementedTrillianAdminServer) UpdateTree(context.Context, *UpdateTreeRequest) (*Tree, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateTree not implemented") -} -func (UnimplementedTrillianAdminServer) DeleteTree(context.Context, *DeleteTreeRequest) (*Tree, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteTree not implemented") -} -func (UnimplementedTrillianAdminServer) UndeleteTree(context.Context, *UndeleteTreeRequest) (*Tree, error) { - return nil, status.Errorf(codes.Unimplemented, "method UndeleteTree not implemented") -} - -// UnsafeTrillianAdminServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TrillianAdminServer will -// result in compilation errors. -type UnsafeTrillianAdminServer interface { - mustEmbedUnimplementedTrillianAdminServer() -} - -func RegisterTrillianAdminServer(s grpc.ServiceRegistrar, srv TrillianAdminServer) { - s.RegisterService(&TrillianAdmin_ServiceDesc, srv) -} - -func _TrillianAdmin_ListTrees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListTreesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).ListTrees(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_ListTrees_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).ListTrees(ctx, req.(*ListTreesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianAdmin_GetTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTreeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).GetTree(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_GetTree_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).GetTree(ctx, req.(*GetTreeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianAdmin_CreateTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTreeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).CreateTree(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_CreateTree_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).CreateTree(ctx, req.(*CreateTreeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianAdmin_UpdateTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateTreeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).UpdateTree(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_UpdateTree_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).UpdateTree(ctx, req.(*UpdateTreeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianAdmin_DeleteTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTreeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).DeleteTree(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_DeleteTree_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).DeleteTree(ctx, req.(*DeleteTreeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianAdmin_UndeleteTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UndeleteTreeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianAdminServer).UndeleteTree(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianAdmin_UndeleteTree_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianAdminServer).UndeleteTree(ctx, req.(*UndeleteTreeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TrillianAdmin_ServiceDesc is the grpc.ServiceDesc for TrillianAdmin service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TrillianAdmin_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "trillian.TrillianAdmin", - HandlerType: (*TrillianAdminServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListTrees", - Handler: _TrillianAdmin_ListTrees_Handler, - }, - { - MethodName: "GetTree", - Handler: _TrillianAdmin_GetTree_Handler, - }, - { - MethodName: "CreateTree", - Handler: _TrillianAdmin_CreateTree_Handler, - }, - { - MethodName: "UpdateTree", - Handler: _TrillianAdmin_UpdateTree_Handler, - }, - { - MethodName: "DeleteTree", - Handler: _TrillianAdmin_DeleteTree_Handler, - }, - { - MethodName: "UndeleteTree", - Handler: _TrillianAdmin_UndeleteTree_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "trillian_admin_api.proto", -} diff --git a/vendor/github.com/google/trillian/trillian_log_api.pb.go b/vendor/github.com/google/trillian/trillian_log_api.pb.go deleted file mode 100644 index c8cb663f21..0000000000 --- a/vendor/github.com/google/trillian/trillian_log_api.pb.go +++ /dev/null @@ -1,2069 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v3.20.1 -// source: trillian_log_api.proto - -package trillian - -import ( - status "google.golang.org/genproto/googleapis/rpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// ChargeTo describes the user(s) associated with the request whose quota should -// be checked and charged. -type ChargeTo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // user is a list of personality-defined strings. - // Trillian will treat them as /User/%{user}/... keys when checking and - // charging quota. - // If one or more of the specified users has insufficient quota, the - // request will be denied. - // - // As an example, a Certificate Transparency frontend might set the following - // user strings when sending a QueueLeaf request to the Trillian log: - // - The requesting IP address. - // This would limit the number of requests per IP. - // - The "intermediate-" for each of the intermediate certificates in - // the submitted chain. - // This would have the effect of limiting the rate of submissions under - // a given intermediate/root. - User []string `protobuf:"bytes,1,rep,name=user,proto3" json:"user,omitempty"` -} - -func (x *ChargeTo) Reset() { - *x = ChargeTo{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChargeTo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChargeTo) ProtoMessage() {} - -func (x *ChargeTo) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ChargeTo.ProtoReflect.Descriptor instead. -func (*ChargeTo) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{0} -} - -func (x *ChargeTo) GetUser() []string { - if x != nil { - return x.User - } - return nil -} - -type QueueLeafRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - Leaf *LogLeaf `protobuf:"bytes,2,opt,name=leaf,proto3" json:"leaf,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,3,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *QueueLeafRequest) Reset() { - *x = QueueLeafRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueueLeafRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueueLeafRequest) ProtoMessage() {} - -func (x *QueueLeafRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueueLeafRequest.ProtoReflect.Descriptor instead. -func (*QueueLeafRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{1} -} - -func (x *QueueLeafRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *QueueLeafRequest) GetLeaf() *LogLeaf { - if x != nil { - return x.Leaf - } - return nil -} - -func (x *QueueLeafRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type QueueLeafResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // queued_leaf describes the leaf which is or will be incorporated into the - // Log. If the submitted leaf was already present in the Log (as indicated by - // its leaf identity hash), then the returned leaf will be the pre-existing - // leaf entry rather than the submitted leaf. - QueuedLeaf *QueuedLogLeaf `protobuf:"bytes,2,opt,name=queued_leaf,json=queuedLeaf,proto3" json:"queued_leaf,omitempty"` -} - -func (x *QueueLeafResponse) Reset() { - *x = QueueLeafResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueueLeafResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueueLeafResponse) ProtoMessage() {} - -func (x *QueueLeafResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueueLeafResponse.ProtoReflect.Descriptor instead. -func (*QueueLeafResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{2} -} - -func (x *QueueLeafResponse) GetQueuedLeaf() *QueuedLogLeaf { - if x != nil { - return x.QueuedLeaf - } - return nil -} - -type GetInclusionProofRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - LeafIndex int64 `protobuf:"varint,2,opt,name=leaf_index,json=leafIndex,proto3" json:"leaf_index,omitempty"` - TreeSize int64 `protobuf:"varint,3,opt,name=tree_size,json=treeSize,proto3" json:"tree_size,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,4,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *GetInclusionProofRequest) Reset() { - *x = GetInclusionProofRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetInclusionProofRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInclusionProofRequest) ProtoMessage() {} - -func (x *GetInclusionProofRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetInclusionProofRequest.ProtoReflect.Descriptor instead. -func (*GetInclusionProofRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{3} -} - -func (x *GetInclusionProofRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetInclusionProofRequest) GetLeafIndex() int64 { - if x != nil { - return x.LeafIndex - } - return 0 -} - -func (x *GetInclusionProofRequest) GetTreeSize() int64 { - if x != nil { - return x.TreeSize - } - return 0 -} - -func (x *GetInclusionProofRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type GetInclusionProofResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The proof field may be empty if the requested tree_size was larger - // than that available at the server (e.g. because there is skew between - // server instances, and an earlier client request was processed by a - // more up-to-date instance). In this case, the signed_log_root - // field will indicate the tree size that the server is aware of, and - // the proof field will be empty. - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - SignedLogRoot *SignedLogRoot `protobuf:"bytes,3,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` -} - -func (x *GetInclusionProofResponse) Reset() { - *x = GetInclusionProofResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetInclusionProofResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInclusionProofResponse) ProtoMessage() {} - -func (x *GetInclusionProofResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetInclusionProofResponse.ProtoReflect.Descriptor instead. -func (*GetInclusionProofResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{4} -} - -func (x *GetInclusionProofResponse) GetProof() *Proof { - if x != nil { - return x.Proof - } - return nil -} - -func (x *GetInclusionProofResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -type GetInclusionProofByHashRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - // The leaf hash field provides the Merkle tree hash of the leaf entry - // to be retrieved. - LeafHash []byte `protobuf:"bytes,2,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"` - TreeSize int64 `protobuf:"varint,3,opt,name=tree_size,json=treeSize,proto3" json:"tree_size,omitempty"` - OrderBySequence bool `protobuf:"varint,4,opt,name=order_by_sequence,json=orderBySequence,proto3" json:"order_by_sequence,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,5,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *GetInclusionProofByHashRequest) Reset() { - *x = GetInclusionProofByHashRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetInclusionProofByHashRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInclusionProofByHashRequest) ProtoMessage() {} - -func (x *GetInclusionProofByHashRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetInclusionProofByHashRequest.ProtoReflect.Descriptor instead. -func (*GetInclusionProofByHashRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{5} -} - -func (x *GetInclusionProofByHashRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetInclusionProofByHashRequest) GetLeafHash() []byte { - if x != nil { - return x.LeafHash - } - return nil -} - -func (x *GetInclusionProofByHashRequest) GetTreeSize() int64 { - if x != nil { - return x.TreeSize - } - return 0 -} - -func (x *GetInclusionProofByHashRequest) GetOrderBySequence() bool { - if x != nil { - return x.OrderBySequence - } - return false -} - -func (x *GetInclusionProofByHashRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type GetInclusionProofByHashResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Logs can potentially contain leaves with duplicate hashes so it's possible - // for this to return multiple proofs. If the leaf index for a particular - // instance of the requested Merkle leaf hash is beyond the requested tree - // size, the corresponding proof entry will be missing. - Proof []*Proof `protobuf:"bytes,2,rep,name=proof,proto3" json:"proof,omitempty"` - SignedLogRoot *SignedLogRoot `protobuf:"bytes,3,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` -} - -func (x *GetInclusionProofByHashResponse) Reset() { - *x = GetInclusionProofByHashResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetInclusionProofByHashResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInclusionProofByHashResponse) ProtoMessage() {} - -func (x *GetInclusionProofByHashResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetInclusionProofByHashResponse.ProtoReflect.Descriptor instead. -func (*GetInclusionProofByHashResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{6} -} - -func (x *GetInclusionProofByHashResponse) GetProof() []*Proof { - if x != nil { - return x.Proof - } - return nil -} - -func (x *GetInclusionProofByHashResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -type GetConsistencyProofRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - FirstTreeSize int64 `protobuf:"varint,2,opt,name=first_tree_size,json=firstTreeSize,proto3" json:"first_tree_size,omitempty"` - SecondTreeSize int64 `protobuf:"varint,3,opt,name=second_tree_size,json=secondTreeSize,proto3" json:"second_tree_size,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,4,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *GetConsistencyProofRequest) Reset() { - *x = GetConsistencyProofRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetConsistencyProofRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConsistencyProofRequest) ProtoMessage() {} - -func (x *GetConsistencyProofRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetConsistencyProofRequest.ProtoReflect.Descriptor instead. -func (*GetConsistencyProofRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{7} -} - -func (x *GetConsistencyProofRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetConsistencyProofRequest) GetFirstTreeSize() int64 { - if x != nil { - return x.FirstTreeSize - } - return 0 -} - -func (x *GetConsistencyProofRequest) GetSecondTreeSize() int64 { - if x != nil { - return x.SecondTreeSize - } - return 0 -} - -func (x *GetConsistencyProofRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type GetConsistencyProofResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The proof field may be empty if the requested tree_size was larger - // than that available at the server (e.g. because there is skew between - // server instances, and an earlier client request was processed by a - // more up-to-date instance). In this case, the signed_log_root - // field will indicate the tree size that the server is aware of, and - // the proof field will be empty. - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - SignedLogRoot *SignedLogRoot `protobuf:"bytes,3,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` -} - -func (x *GetConsistencyProofResponse) Reset() { - *x = GetConsistencyProofResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetConsistencyProofResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetConsistencyProofResponse) ProtoMessage() {} - -func (x *GetConsistencyProofResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetConsistencyProofResponse.ProtoReflect.Descriptor instead. -func (*GetConsistencyProofResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{8} -} - -func (x *GetConsistencyProofResponse) GetProof() *Proof { - if x != nil { - return x.Proof - } - return nil -} - -func (x *GetConsistencyProofResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -type GetLatestSignedLogRootRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,2,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` - // If first_tree_size is non-zero, the response will include a consistency - // proof between first_tree_size and the new tree size (if not smaller). - FirstTreeSize int64 `protobuf:"varint,3,opt,name=first_tree_size,json=firstTreeSize,proto3" json:"first_tree_size,omitempty"` -} - -func (x *GetLatestSignedLogRootRequest) Reset() { - *x = GetLatestSignedLogRootRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLatestSignedLogRootRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestSignedLogRootRequest) ProtoMessage() {} - -func (x *GetLatestSignedLogRootRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestSignedLogRootRequest.ProtoReflect.Descriptor instead. -func (*GetLatestSignedLogRootRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{9} -} - -func (x *GetLatestSignedLogRootRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetLatestSignedLogRootRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -func (x *GetLatestSignedLogRootRequest) GetFirstTreeSize() int64 { - if x != nil { - return x.FirstTreeSize - } - return 0 -} - -type GetLatestSignedLogRootResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SignedLogRoot *SignedLogRoot `protobuf:"bytes,2,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` - // proof is filled in with a consistency proof if first_tree_size in - // GetLatestSignedLogRootRequest is non-zero (and within the tree size - // available at the server). - Proof *Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (x *GetLatestSignedLogRootResponse) Reset() { - *x = GetLatestSignedLogRootResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLatestSignedLogRootResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLatestSignedLogRootResponse) ProtoMessage() {} - -func (x *GetLatestSignedLogRootResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLatestSignedLogRootResponse.ProtoReflect.Descriptor instead. -func (*GetLatestSignedLogRootResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{10} -} - -func (x *GetLatestSignedLogRootResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -func (x *GetLatestSignedLogRootResponse) GetProof() *Proof { - if x != nil { - return x.Proof - } - return nil -} - -type GetEntryAndProofRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - LeafIndex int64 `protobuf:"varint,2,opt,name=leaf_index,json=leafIndex,proto3" json:"leaf_index,omitempty"` - TreeSize int64 `protobuf:"varint,3,opt,name=tree_size,json=treeSize,proto3" json:"tree_size,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,4,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *GetEntryAndProofRequest) Reset() { - *x = GetEntryAndProofRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetEntryAndProofRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntryAndProofRequest) ProtoMessage() {} - -func (x *GetEntryAndProofRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetEntryAndProofRequest.ProtoReflect.Descriptor instead. -func (*GetEntryAndProofRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{11} -} - -func (x *GetEntryAndProofRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetEntryAndProofRequest) GetLeafIndex() int64 { - if x != nil { - return x.LeafIndex - } - return 0 -} - -func (x *GetEntryAndProofRequest) GetTreeSize() int64 { - if x != nil { - return x.TreeSize - } - return 0 -} - -func (x *GetEntryAndProofRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type GetEntryAndProofResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` - Leaf *LogLeaf `protobuf:"bytes,3,opt,name=leaf,proto3" json:"leaf,omitempty"` - SignedLogRoot *SignedLogRoot `protobuf:"bytes,4,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` -} - -func (x *GetEntryAndProofResponse) Reset() { - *x = GetEntryAndProofResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetEntryAndProofResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetEntryAndProofResponse) ProtoMessage() {} - -func (x *GetEntryAndProofResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetEntryAndProofResponse.ProtoReflect.Descriptor instead. -func (*GetEntryAndProofResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{12} -} - -func (x *GetEntryAndProofResponse) GetProof() *Proof { - if x != nil { - return x.Proof - } - return nil -} - -func (x *GetEntryAndProofResponse) GetLeaf() *LogLeaf { - if x != nil { - return x.Leaf - } - return nil -} - -func (x *GetEntryAndProofResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -type InitLogRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,2,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *InitLogRequest) Reset() { - *x = InitLogRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InitLogRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitLogRequest) ProtoMessage() {} - -func (x *InitLogRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitLogRequest.ProtoReflect.Descriptor instead. -func (*InitLogRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{13} -} - -func (x *InitLogRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *InitLogRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type InitLogResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Created *SignedLogRoot `protobuf:"bytes,1,opt,name=created,proto3" json:"created,omitempty"` -} - -func (x *InitLogResponse) Reset() { - *x = InitLogResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InitLogResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InitLogResponse) ProtoMessage() {} - -func (x *InitLogResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InitLogResponse.ProtoReflect.Descriptor instead. -func (*InitLogResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{14} -} - -func (x *InitLogResponse) GetCreated() *SignedLogRoot { - if x != nil { - return x.Created - } - return nil -} - -type AddSequencedLeavesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - Leaves []*LogLeaf `protobuf:"bytes,2,rep,name=leaves,proto3" json:"leaves,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,4,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *AddSequencedLeavesRequest) Reset() { - *x = AddSequencedLeavesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSequencedLeavesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSequencedLeavesRequest) ProtoMessage() {} - -func (x *AddSequencedLeavesRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddSequencedLeavesRequest.ProtoReflect.Descriptor instead. -func (*AddSequencedLeavesRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{15} -} - -func (x *AddSequencedLeavesRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *AddSequencedLeavesRequest) GetLeaves() []*LogLeaf { - if x != nil { - return x.Leaves - } - return nil -} - -func (x *AddSequencedLeavesRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type AddSequencedLeavesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Same number and order as in the corresponding request. - Results []*QueuedLogLeaf `protobuf:"bytes,2,rep,name=results,proto3" json:"results,omitempty"` -} - -func (x *AddSequencedLeavesResponse) Reset() { - *x = AddSequencedLeavesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddSequencedLeavesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddSequencedLeavesResponse) ProtoMessage() {} - -func (x *AddSequencedLeavesResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AddSequencedLeavesResponse.ProtoReflect.Descriptor instead. -func (*AddSequencedLeavesResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{16} -} - -func (x *AddSequencedLeavesResponse) GetResults() []*QueuedLogLeaf { - if x != nil { - return x.Results - } - return nil -} - -type GetLeavesByRangeRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LogId int64 `protobuf:"varint,1,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"` - StartIndex int64 `protobuf:"varint,2,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"` - Count int64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"` - ChargeTo *ChargeTo `protobuf:"bytes,4,opt,name=charge_to,json=chargeTo,proto3" json:"charge_to,omitempty"` -} - -func (x *GetLeavesByRangeRequest) Reset() { - *x = GetLeavesByRangeRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLeavesByRangeRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLeavesByRangeRequest) ProtoMessage() {} - -func (x *GetLeavesByRangeRequest) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLeavesByRangeRequest.ProtoReflect.Descriptor instead. -func (*GetLeavesByRangeRequest) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{17} -} - -func (x *GetLeavesByRangeRequest) GetLogId() int64 { - if x != nil { - return x.LogId - } - return 0 -} - -func (x *GetLeavesByRangeRequest) GetStartIndex() int64 { - if x != nil { - return x.StartIndex - } - return 0 -} - -func (x *GetLeavesByRangeRequest) GetCount() int64 { - if x != nil { - return x.Count - } - return 0 -} - -func (x *GetLeavesByRangeRequest) GetChargeTo() *ChargeTo { - if x != nil { - return x.ChargeTo - } - return nil -} - -type GetLeavesByRangeResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Returned log leaves starting from the `start_index` of the request, in - // order. There may be fewer than `request.count` leaves returned, if the - // requested range extended beyond the size of the tree or if the server opted - // to return fewer leaves than requested. - Leaves []*LogLeaf `protobuf:"bytes,1,rep,name=leaves,proto3" json:"leaves,omitempty"` - SignedLogRoot *SignedLogRoot `protobuf:"bytes,2,opt,name=signed_log_root,json=signedLogRoot,proto3" json:"signed_log_root,omitempty"` -} - -func (x *GetLeavesByRangeResponse) Reset() { - *x = GetLeavesByRangeResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetLeavesByRangeResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLeavesByRangeResponse) ProtoMessage() {} - -func (x *GetLeavesByRangeResponse) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetLeavesByRangeResponse.ProtoReflect.Descriptor instead. -func (*GetLeavesByRangeResponse) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{18} -} - -func (x *GetLeavesByRangeResponse) GetLeaves() []*LogLeaf { - if x != nil { - return x.Leaves - } - return nil -} - -func (x *GetLeavesByRangeResponse) GetSignedLogRoot() *SignedLogRoot { - if x != nil { - return x.SignedLogRoot - } - return nil -} - -// QueuedLogLeaf provides the result of submitting an entry to the log. -// TODO(pavelkalinnikov): Consider renaming it to AddLogLeafResult or the like. -type QueuedLogLeaf struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The leaf as it was stored by Trillian. Empty unless `status.code` is: - // - `google.rpc.OK`: the `leaf` data is the same as in the request. - // - `google.rpc.ALREADY_EXISTS` or 'google.rpc.FAILED_PRECONDITION`: the - // `leaf` is the conflicting one already in the log. - Leaf *LogLeaf `protobuf:"bytes,1,opt,name=leaf,proto3" json:"leaf,omitempty"` - // The status of adding the leaf. - // - `google.rpc.OK`: successfully added. - // - `google.rpc.ALREADY_EXISTS`: the leaf is a duplicate of an already - // existing one. Either `leaf_identity_hash` is the same in the `LOG` - // mode, or `leaf_index` in the `PREORDERED_LOG`. - // - `google.rpc.FAILED_PRECONDITION`: A conflicting entry is already - // present in the log, e.g., same `leaf_index` but different `leaf_data`. - Status *status.Status `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` -} - -func (x *QueuedLogLeaf) Reset() { - *x = QueuedLogLeaf{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QueuedLogLeaf) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QueuedLogLeaf) ProtoMessage() {} - -func (x *QueuedLogLeaf) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use QueuedLogLeaf.ProtoReflect.Descriptor instead. -func (*QueuedLogLeaf) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{19} -} - -func (x *QueuedLogLeaf) GetLeaf() *LogLeaf { - if x != nil { - return x.Leaf - } - return nil -} - -func (x *QueuedLogLeaf) GetStatus() *status.Status { - if x != nil { - return x.Status - } - return nil -} - -// LogLeaf describes a leaf in the Log's Merkle tree, corresponding to a single log entry. -// Each leaf has a unique leaf index in the scope of this tree. Clients submitting new -// leaf entries should only set the following fields: -// - leaf_value -// - extra_data (optionally) -// - leaf_identity_hash (optionally) -// - leaf_index (iff the log is a PREORDERED_LOG) -type LogLeaf struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // merkle_leaf_hash holds the Merkle leaf hash over leaf_value. This is - // calculated by the Trillian server when leaves are added to the tree, using - // the defined hashing algorithm and strategy for the tree; as such, the client - // does not need to set it on leaf submissions. - MerkleLeafHash []byte `protobuf:"bytes,1,opt,name=merkle_leaf_hash,json=merkleLeafHash,proto3" json:"merkle_leaf_hash,omitempty"` - // leaf_value holds the data that forms the value of the Merkle tree leaf. - // The client should set this field on all leaf submissions, and is - // responsible for ensuring its validity (the Trillian server treats it as an - // opaque blob). - LeafValue []byte `protobuf:"bytes,2,opt,name=leaf_value,json=leafValue,proto3" json:"leaf_value,omitempty"` - // extra_data holds additional data associated with the Merkle tree leaf. - // The client may set this data on leaf submissions, and the Trillian server - // will return it on subsequent read operations. However, the contents of - // this field are not covered by and do not affect the Merkle tree hash - // calculations. - ExtraData []byte `protobuf:"bytes,3,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` - // leaf_index indicates the index of this leaf in the Merkle tree. - // This field is returned on all read operations, but should only be - // set for leaf submissions in PREORDERED_LOG mode (for a normal log - // the leaf index is assigned by Trillian when the submitted leaf is - // integrated into the Merkle tree). - LeafIndex int64 `protobuf:"varint,4,opt,name=leaf_index,json=leafIndex,proto3" json:"leaf_index,omitempty"` - // leaf_identity_hash provides a hash value that indicates the client's - // concept of which leaf entries should be considered identical. - // - // This mechanism allows the client personality to indicate that two leaves - // should be considered "duplicates" even though their `leaf_value`s differ. - // - // If this is not set on leaf submissions, the Trillian server will take its - // value to be the same as merkle_leaf_hash (and thus only leaves with - // identical leaf_value contents will be considered identical). - // - // For example, in Certificate Transparency each certificate submission is - // associated with a submission timestamp, but subsequent submissions of the - // same certificate should be considered identical. This is achieved - // by setting the leaf identity hash to a hash over (just) the certificate, - // whereas the Merkle leaf hash encompasses both the certificate and its - // submission time -- allowing duplicate certificates to be detected. - // - // Continuing the CT example, for a CT mirror personality (which must allow - // dupes since the source log could contain them), the part of the - // personality which fetches and submits the entries might set - // `leaf_identity_hash` to `H(leaf_index||cert)`. - // - // TODO(pavelkalinnikov): Consider instead using `H(cert)` and allowing - // identity hash dupes in `PREORDERED_LOG` mode, for it can later be - // upgraded to `LOG` which will need to correctly detect duplicates with - // older entries when new ones get queued. - LeafIdentityHash []byte `protobuf:"bytes,5,opt,name=leaf_identity_hash,json=leafIdentityHash,proto3" json:"leaf_identity_hash,omitempty"` - // queue_timestamp holds the time at which this leaf was queued for - // inclusion in the Log, or zero if the entry was submitted without - // queuing. Clients should not set this field on submissions. - QueueTimestamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=queue_timestamp,json=queueTimestamp,proto3" json:"queue_timestamp,omitempty"` - // integrate_timestamp holds the time at which this leaf was integrated into - // the tree. Clients should not set this field on submissions. - IntegrateTimestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=integrate_timestamp,json=integrateTimestamp,proto3" json:"integrate_timestamp,omitempty"` -} - -func (x *LogLeaf) Reset() { - *x = LogLeaf{} - if protoimpl.UnsafeEnabled { - mi := &file_trillian_log_api_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *LogLeaf) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogLeaf) ProtoMessage() {} - -func (x *LogLeaf) ProtoReflect() protoreflect.Message { - mi := &file_trillian_log_api_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use LogLeaf.ProtoReflect.Descriptor instead. -func (*LogLeaf) Descriptor() ([]byte, []int) { - return file_trillian_log_api_proto_rawDescGZIP(), []int{20} -} - -func (x *LogLeaf) GetMerkleLeafHash() []byte { - if x != nil { - return x.MerkleLeafHash - } - return nil -} - -func (x *LogLeaf) GetLeafValue() []byte { - if x != nil { - return x.LeafValue - } - return nil -} - -func (x *LogLeaf) GetExtraData() []byte { - if x != nil { - return x.ExtraData - } - return nil -} - -func (x *LogLeaf) GetLeafIndex() int64 { - if x != nil { - return x.LeafIndex - } - return 0 -} - -func (x *LogLeaf) GetLeafIdentityHash() []byte { - if x != nil { - return x.LeafIdentityHash - } - return nil -} - -func (x *LogLeaf) GetQueueTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.QueueTimestamp - } - return nil -} - -func (x *LogLeaf) GetIntegrateTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.IntegrateTimestamp - } - return nil -} - -var File_trillian_log_api_proto protoreflect.FileDescriptor - -var file_trillian_log_api_proto_rawDesc = []byte{ - 0x0a, 0x16, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x61, - 0x70, 0x69, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1e, 0x0a, 0x08, - 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x81, 0x01, 0x0a, - 0x10, 0x51, 0x75, 0x65, 0x75, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, - 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x12, - 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, - 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, - 0x22, 0x4d, 0x0a, 0x11, 0x51, 0x75, 0x65, 0x75, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x61, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x69, - 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x75, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x4c, - 0x65, 0x61, 0x66, 0x52, 0x0a, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x4c, 0x65, 0x61, 0x66, 0x22, - 0x9e, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, - 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, - 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, - 0x67, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x64, - 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x72, 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, - 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, - 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, - 0x22, 0x83, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, - 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, - 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, - 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, - 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, - 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xce, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x49, 0x6e, - 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x48, 0x61, - 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, - 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, - 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6c, 0x65, 0x61, 0x66, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1b, 0x0a, - 0x09, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x08, 0x74, 0x72, 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x72, - 0x64, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x5f, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x79, 0x53, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, - 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, - 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x22, 0x89, 0x01, 0x0a, 0x1f, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x48, - 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x70, - 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x69, - 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, - 0x6f, 0x6f, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x69, - 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x12, 0x28, 0x0a, 0x10, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x5f, 0x74, 0x72, 0x65, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x73, 0x65, 0x63, - 0x6f, 0x6e, 0x64, 0x54, 0x72, 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x63, - 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, - 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x22, 0x85, 0x01, 0x0a, - 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6c, 0x6f, - 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, - 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, - 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x8f, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x12, 0x2f, 0x0a, - 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, - 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x12, 0x26, - 0x0a, 0x0f, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x54, 0x72, - 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x1e, 0x47, 0x65, 0x74, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, - 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x72, 0x69, 0x6c, - 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x22, 0x9d, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x41, 0x6e, - 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, - 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, - 0x6f, 0x67, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x65, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x74, 0x72, 0x65, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, - 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, - 0x6f, 0x22, 0xa9, 0x01, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x41, 0x6e, - 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, - 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x4c, - 0x6f, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x12, 0x3f, 0x0a, 0x0f, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, - 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, - 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x58, 0x0a, - 0x0e, 0x49, 0x6e, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x15, 0x0a, 0x06, 0x6c, 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x05, 0x6c, 0x6f, 0x67, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, - 0x5f, 0x74, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, - 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, - 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x22, 0x44, 0x0a, 0x0f, 0x49, 0x6e, 0x69, 0x74, 0x4c, - 0x6f, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x8e, 0x01, - 0x0a, 0x19, 0x41, 0x64, 0x64, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x65, - 0x61, 0x76, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, - 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, - 0x49, 0x64, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x4c, 0x6f, - 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x2f, 0x0a, - 0x09, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, - 0x67, 0x65, 0x54, 0x6f, 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x22, 0x4f, - 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x65, - 0x61, 0x76, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x75, 0x65, 0x64, 0x4c, - 0x6f, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, - 0x98, 0x01, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x42, 0x79, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x6c, - 0x6f, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x6c, 0x6f, 0x67, - 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, - 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, - 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x68, 0x61, - 0x72, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, - 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x43, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, - 0x52, 0x08, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x54, 0x6f, 0x22, 0x86, 0x01, 0x0a, 0x18, 0x47, - 0x65, 0x74, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x6c, 0x65, 0x61, 0x76, 0x65, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x4c, 0x6f, 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x06, 0x6c, 0x65, 0x61, 0x76, - 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0f, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x5f, 0x6c, 0x6f, 0x67, - 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0d, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, - 0x6f, 0x6f, 0x74, 0x22, 0x62, 0x0a, 0x0d, 0x51, 0x75, 0x65, 0x75, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x4c, 0x65, 0x61, 0x66, 0x12, 0x25, 0x0a, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x4c, 0x6f, - 0x67, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x04, 0x6c, 0x65, 0x61, 0x66, 0x12, 0x2a, 0x0a, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x4c, - 0x65, 0x61, 0x66, 0x12, 0x28, 0x0a, 0x10, 0x6d, 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x5f, 0x6c, 0x65, - 0x61, 0x66, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x6d, - 0x65, 0x72, 0x6b, 0x6c, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, - 0x0a, 0x6c, 0x65, 0x61, 0x66, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x6c, 0x65, 0x61, 0x66, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, - 0x65, 0x61, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x09, 0x6c, 0x65, 0x61, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x65, - 0x61, 0x66, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x6c, 0x65, 0x61, 0x66, 0x49, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x43, 0x0a, 0x0f, 0x71, 0x75, 0x65, 0x75, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0e, 0x71, - 0x75, 0x65, 0x75, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x4b, 0x0a, - 0x13, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x12, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0xdb, 0x06, 0x0a, 0x0b, 0x54, - 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x4c, 0x6f, 0x67, 0x12, 0x46, 0x0a, 0x09, 0x51, 0x75, - 0x65, 0x75, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x12, 0x1a, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x51, 0x75, 0x65, 0x75, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x51, - 0x75, 0x65, 0x75, 0x65, 0x4c, 0x65, 0x61, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x22, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, - 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x70, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x12, 0x28, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, - 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, - 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6c, 0x75, 0x73, 0x69, 0x6f, 0x6e, 0x50, - 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x79, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x69, - 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x24, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, - 0x74, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, - 0x43, 0x6f, 0x6e, 0x73, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6d, 0x0a, 0x16, 0x47, 0x65, - 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, - 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x27, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, - 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, - 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x4c, 0x6f, 0x67, 0x52, 0x6f, 0x6f, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, 0x47, 0x65, 0x74, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x2e, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x22, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x41, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x07, 0x49, 0x6e, 0x69, 0x74, 0x4c, 0x6f, - 0x67, 0x12, 0x18, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x49, 0x6e, 0x69, - 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x74, 0x72, - 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x49, 0x6e, 0x69, 0x74, 0x4c, 0x6f, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x53, - 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x12, 0x23, - 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x41, 0x64, 0x64, 0x53, 0x65, 0x71, - 0x75, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x41, - 0x64, 0x64, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x64, 0x4c, 0x65, 0x61, 0x76, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x10, 0x47, - 0x65, 0x74, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, - 0x21, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x65, - 0x61, 0x76, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, 0x47, 0x65, - 0x74, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x73, 0x42, 0x79, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x4e, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x42, 0x13, 0x54, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x4c, - 0x6f, 0x67, 0x41, 0x70, 0x69, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1a, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x74, 0x72, 0x69, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_trillian_log_api_proto_rawDescOnce sync.Once - file_trillian_log_api_proto_rawDescData = file_trillian_log_api_proto_rawDesc -) - -func file_trillian_log_api_proto_rawDescGZIP() []byte { - file_trillian_log_api_proto_rawDescOnce.Do(func() { - file_trillian_log_api_proto_rawDescData = protoimpl.X.CompressGZIP(file_trillian_log_api_proto_rawDescData) - }) - return file_trillian_log_api_proto_rawDescData -} - -var file_trillian_log_api_proto_msgTypes = make([]protoimpl.MessageInfo, 21) -var file_trillian_log_api_proto_goTypes = []interface{}{ - (*ChargeTo)(nil), // 0: trillian.ChargeTo - (*QueueLeafRequest)(nil), // 1: trillian.QueueLeafRequest - (*QueueLeafResponse)(nil), // 2: trillian.QueueLeafResponse - (*GetInclusionProofRequest)(nil), // 3: trillian.GetInclusionProofRequest - (*GetInclusionProofResponse)(nil), // 4: trillian.GetInclusionProofResponse - (*GetInclusionProofByHashRequest)(nil), // 5: trillian.GetInclusionProofByHashRequest - (*GetInclusionProofByHashResponse)(nil), // 6: trillian.GetInclusionProofByHashResponse - (*GetConsistencyProofRequest)(nil), // 7: trillian.GetConsistencyProofRequest - (*GetConsistencyProofResponse)(nil), // 8: trillian.GetConsistencyProofResponse - (*GetLatestSignedLogRootRequest)(nil), // 9: trillian.GetLatestSignedLogRootRequest - (*GetLatestSignedLogRootResponse)(nil), // 10: trillian.GetLatestSignedLogRootResponse - (*GetEntryAndProofRequest)(nil), // 11: trillian.GetEntryAndProofRequest - (*GetEntryAndProofResponse)(nil), // 12: trillian.GetEntryAndProofResponse - (*InitLogRequest)(nil), // 13: trillian.InitLogRequest - (*InitLogResponse)(nil), // 14: trillian.InitLogResponse - (*AddSequencedLeavesRequest)(nil), // 15: trillian.AddSequencedLeavesRequest - (*AddSequencedLeavesResponse)(nil), // 16: trillian.AddSequencedLeavesResponse - (*GetLeavesByRangeRequest)(nil), // 17: trillian.GetLeavesByRangeRequest - (*GetLeavesByRangeResponse)(nil), // 18: trillian.GetLeavesByRangeResponse - (*QueuedLogLeaf)(nil), // 19: trillian.QueuedLogLeaf - (*LogLeaf)(nil), // 20: trillian.LogLeaf - (*Proof)(nil), // 21: trillian.Proof - (*SignedLogRoot)(nil), // 22: trillian.SignedLogRoot - (*status.Status)(nil), // 23: google.rpc.Status - (*timestamppb.Timestamp)(nil), // 24: google.protobuf.Timestamp -} -var file_trillian_log_api_proto_depIdxs = []int32{ - 20, // 0: trillian.QueueLeafRequest.leaf:type_name -> trillian.LogLeaf - 0, // 1: trillian.QueueLeafRequest.charge_to:type_name -> trillian.ChargeTo - 19, // 2: trillian.QueueLeafResponse.queued_leaf:type_name -> trillian.QueuedLogLeaf - 0, // 3: trillian.GetInclusionProofRequest.charge_to:type_name -> trillian.ChargeTo - 21, // 4: trillian.GetInclusionProofResponse.proof:type_name -> trillian.Proof - 22, // 5: trillian.GetInclusionProofResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 0, // 6: trillian.GetInclusionProofByHashRequest.charge_to:type_name -> trillian.ChargeTo - 21, // 7: trillian.GetInclusionProofByHashResponse.proof:type_name -> trillian.Proof - 22, // 8: trillian.GetInclusionProofByHashResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 0, // 9: trillian.GetConsistencyProofRequest.charge_to:type_name -> trillian.ChargeTo - 21, // 10: trillian.GetConsistencyProofResponse.proof:type_name -> trillian.Proof - 22, // 11: trillian.GetConsistencyProofResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 0, // 12: trillian.GetLatestSignedLogRootRequest.charge_to:type_name -> trillian.ChargeTo - 22, // 13: trillian.GetLatestSignedLogRootResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 21, // 14: trillian.GetLatestSignedLogRootResponse.proof:type_name -> trillian.Proof - 0, // 15: trillian.GetEntryAndProofRequest.charge_to:type_name -> trillian.ChargeTo - 21, // 16: trillian.GetEntryAndProofResponse.proof:type_name -> trillian.Proof - 20, // 17: trillian.GetEntryAndProofResponse.leaf:type_name -> trillian.LogLeaf - 22, // 18: trillian.GetEntryAndProofResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 0, // 19: trillian.InitLogRequest.charge_to:type_name -> trillian.ChargeTo - 22, // 20: trillian.InitLogResponse.created:type_name -> trillian.SignedLogRoot - 20, // 21: trillian.AddSequencedLeavesRequest.leaves:type_name -> trillian.LogLeaf - 0, // 22: trillian.AddSequencedLeavesRequest.charge_to:type_name -> trillian.ChargeTo - 19, // 23: trillian.AddSequencedLeavesResponse.results:type_name -> trillian.QueuedLogLeaf - 0, // 24: trillian.GetLeavesByRangeRequest.charge_to:type_name -> trillian.ChargeTo - 20, // 25: trillian.GetLeavesByRangeResponse.leaves:type_name -> trillian.LogLeaf - 22, // 26: trillian.GetLeavesByRangeResponse.signed_log_root:type_name -> trillian.SignedLogRoot - 20, // 27: trillian.QueuedLogLeaf.leaf:type_name -> trillian.LogLeaf - 23, // 28: trillian.QueuedLogLeaf.status:type_name -> google.rpc.Status - 24, // 29: trillian.LogLeaf.queue_timestamp:type_name -> google.protobuf.Timestamp - 24, // 30: trillian.LogLeaf.integrate_timestamp:type_name -> google.protobuf.Timestamp - 1, // 31: trillian.TrillianLog.QueueLeaf:input_type -> trillian.QueueLeafRequest - 3, // 32: trillian.TrillianLog.GetInclusionProof:input_type -> trillian.GetInclusionProofRequest - 5, // 33: trillian.TrillianLog.GetInclusionProofByHash:input_type -> trillian.GetInclusionProofByHashRequest - 7, // 34: trillian.TrillianLog.GetConsistencyProof:input_type -> trillian.GetConsistencyProofRequest - 9, // 35: trillian.TrillianLog.GetLatestSignedLogRoot:input_type -> trillian.GetLatestSignedLogRootRequest - 11, // 36: trillian.TrillianLog.GetEntryAndProof:input_type -> trillian.GetEntryAndProofRequest - 13, // 37: trillian.TrillianLog.InitLog:input_type -> trillian.InitLogRequest - 15, // 38: trillian.TrillianLog.AddSequencedLeaves:input_type -> trillian.AddSequencedLeavesRequest - 17, // 39: trillian.TrillianLog.GetLeavesByRange:input_type -> trillian.GetLeavesByRangeRequest - 2, // 40: trillian.TrillianLog.QueueLeaf:output_type -> trillian.QueueLeafResponse - 4, // 41: trillian.TrillianLog.GetInclusionProof:output_type -> trillian.GetInclusionProofResponse - 6, // 42: trillian.TrillianLog.GetInclusionProofByHash:output_type -> trillian.GetInclusionProofByHashResponse - 8, // 43: trillian.TrillianLog.GetConsistencyProof:output_type -> trillian.GetConsistencyProofResponse - 10, // 44: trillian.TrillianLog.GetLatestSignedLogRoot:output_type -> trillian.GetLatestSignedLogRootResponse - 12, // 45: trillian.TrillianLog.GetEntryAndProof:output_type -> trillian.GetEntryAndProofResponse - 14, // 46: trillian.TrillianLog.InitLog:output_type -> trillian.InitLogResponse - 16, // 47: trillian.TrillianLog.AddSequencedLeaves:output_type -> trillian.AddSequencedLeavesResponse - 18, // 48: trillian.TrillianLog.GetLeavesByRange:output_type -> trillian.GetLeavesByRangeResponse - 40, // [40:49] is the sub-list for method output_type - 31, // [31:40] is the sub-list for method input_type - 31, // [31:31] is the sub-list for extension type_name - 31, // [31:31] is the sub-list for extension extendee - 0, // [0:31] is the sub-list for field type_name -} - -func init() { file_trillian_log_api_proto_init() } -func file_trillian_log_api_proto_init() { - if File_trillian_log_api_proto != nil { - return - } - file_trillian_proto_init() - if !protoimpl.UnsafeEnabled { - file_trillian_log_api_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChargeTo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueueLeafRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueueLeafResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInclusionProofRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInclusionProofResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInclusionProofByHashRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetInclusionProofByHashResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConsistencyProofRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetConsistencyProofResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestSignedLogRootRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLatestSignedLogRootResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetEntryAndProofRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetEntryAndProofResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitLogRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitLogResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSequencedLeavesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddSequencedLeavesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLeavesByRangeRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLeavesByRangeResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QueuedLogLeaf); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_trillian_log_api_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LogLeaf); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_trillian_log_api_proto_rawDesc, - NumEnums: 0, - NumMessages: 21, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_trillian_log_api_proto_goTypes, - DependencyIndexes: file_trillian_log_api_proto_depIdxs, - MessageInfos: file_trillian_log_api_proto_msgTypes, - }.Build() - File_trillian_log_api_proto = out.File - file_trillian_log_api_proto_rawDesc = nil - file_trillian_log_api_proto_goTypes = nil - file_trillian_log_api_proto_depIdxs = nil -} diff --git a/vendor/github.com/google/trillian/trillian_log_api.proto b/vendor/github.com/google/trillian/trillian_log_api.proto deleted file mode 100644 index 74cbb96c3e..0000000000 --- a/vendor/github.com/google/trillian/trillian_log_api.proto +++ /dev/null @@ -1,363 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package trillian; - -option go_package = "github.com/google/trillian"; -option java_multiple_files = true; -option java_outer_classname = "TrillianLogApiProto"; -option java_package = "com.google.trillian.proto"; - -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "trillian.proto"; - -// The TrillianLog service provides access to an append-only Log data structure -// as described in the [Verifiable Data -// Structures](docs/papers/VerifiableDataStructures.pdf) paper. -// -// The API supports adding new entries to the Merkle tree for a specific Log -// instance (identified by its log_id) in two modes: -// - For a normal log, new leaf entries are queued up for subsequent -// inclusion in the log, and the leaves are assigned consecutive leaf_index -// values as part of that integration process. -// - For a 'pre-ordered log', new entries have an already-defined leaf -// ordering, and leaves are only integrated into the Merkle tree when a -// contiguous range of leaves is available. -// -// The API also supports read operations to retrieve leaf contents, and to -// provide cryptographic proofs of leaf inclusion and of the append-only nature -// of the Log. -// -// Each API request also includes a charge_to field, which allows API users -// to provide quota identifiers that should be "charged" for each API request -// (and potentially rejected with codes.ResourceExhausted). -// -// Various operations on the API also allows for 'server skew', which can occur -// when different API requests happen to be handled by different server instances -// that may not all be up to date. An API request that is relative to a specific -// tree size may reach a server instance that is not yet aware of this tree size; -// in this case the server will typically return an OK response that contains: -// - a signed log root that indicates the tree size that it is aware of -// - an empty response otherwise. -service TrillianLog { - // QueueLeaf adds a single leaf to the queue of pending leaves for a normal - // log. - rpc QueueLeaf(QueueLeafRequest) returns (QueueLeafResponse) {} - - // GetInclusionProof returns an inclusion proof for a leaf with a given index - // in a particular tree. - // - // If the requested tree_size is larger than the server is aware of, the - // response will include the latest known log root and an empty proof. - rpc GetInclusionProof(GetInclusionProofRequest) - returns (GetInclusionProofResponse) {} - - // GetInclusionProofByHash returns an inclusion proof for any leaves that have - // the given Merkle hash in a particular tree. - // - // If any of the leaves that match the given Merkle has have a leaf index that - // is beyond the requested tree size, the corresponding proof entry will be empty. - rpc GetInclusionProofByHash(GetInclusionProofByHashRequest) - returns (GetInclusionProofByHashResponse) {} - - // GetConsistencyProof returns a consistency proof between different sizes of - // a particular tree. - // - // If the requested tree size is larger than the server is aware of, - // the response will include the latest known log root and an empty proof. - rpc GetConsistencyProof(GetConsistencyProofRequest) - returns (GetConsistencyProofResponse) {} - - // GetLatestSignedLogRoot returns the latest log root for a given tree, - // and optionally also includes a consistency proof from an earlier tree size - // to the new size of the tree. - // - // If the earlier tree size is larger than the server is aware of, - // an InvalidArgument error is returned. - rpc GetLatestSignedLogRoot(GetLatestSignedLogRootRequest) - returns (GetLatestSignedLogRootResponse) {} - - // GetEntryAndProof returns a log leaf and the corresponding inclusion proof - // to a specified tree size, for a given leaf index in a particular tree. - // - // If the requested tree size is unavailable but the leaf is - // in scope for the current tree, the returned proof will be for the - // current tree size rather than the requested tree size. - rpc GetEntryAndProof(GetEntryAndProofRequest) - returns (GetEntryAndProofResponse) {} - - // InitLog initializes a particular tree, creating the initial signed log - // root (which will be of size 0). - rpc InitLog(InitLogRequest) returns (InitLogResponse) {} - - - // AddSequencedLeaves adds a batch of leaves with assigned sequence numbers - // to a pre-ordered log. The indices of the provided leaves must be contiguous. - rpc AddSequencedLeaves(AddSequencedLeavesRequest) - returns (AddSequencedLeavesResponse) {} - - // GetLeavesByRange returns a batch of leaves whose leaf indices are in a - // sequential range. - rpc GetLeavesByRange(GetLeavesByRangeRequest) - returns (GetLeavesByRangeResponse) {} -} - -// ChargeTo describes the user(s) associated with the request whose quota should -// be checked and charged. -message ChargeTo { - // user is a list of personality-defined strings. - // Trillian will treat them as /User/%{user}/... keys when checking and - // charging quota. - // If one or more of the specified users has insufficient quota, the - // request will be denied. - // - // As an example, a Certificate Transparency frontend might set the following - // user strings when sending a QueueLeaf request to the Trillian log: - // - The requesting IP address. - // This would limit the number of requests per IP. - // - The "intermediate-" for each of the intermediate certificates in - // the submitted chain. - // This would have the effect of limiting the rate of submissions under - // a given intermediate/root. - repeated string user = 1; -} - -message QueueLeafRequest { - int64 log_id = 1; - LogLeaf leaf = 2; - ChargeTo charge_to = 3; -} - -message QueueLeafResponse { - // queued_leaf describes the leaf which is or will be incorporated into the - // Log. If the submitted leaf was already present in the Log (as indicated by - // its leaf identity hash), then the returned leaf will be the pre-existing - // leaf entry rather than the submitted leaf. - QueuedLogLeaf queued_leaf = 2; -} - -message GetInclusionProofRequest { - int64 log_id = 1; - int64 leaf_index = 2; - int64 tree_size = 3; - ChargeTo charge_to = 4; -} - -message GetInclusionProofResponse { - // The proof field may be empty if the requested tree_size was larger - // than that available at the server (e.g. because there is skew between - // server instances, and an earlier client request was processed by a - // more up-to-date instance). In this case, the signed_log_root - // field will indicate the tree size that the server is aware of, and - // the proof field will be empty. - Proof proof = 2; - SignedLogRoot signed_log_root = 3; -} - -message GetInclusionProofByHashRequest { - int64 log_id = 1; - // The leaf hash field provides the Merkle tree hash of the leaf entry - // to be retrieved. - bytes leaf_hash = 2; - int64 tree_size = 3; - bool order_by_sequence = 4; - ChargeTo charge_to = 5; -} - -message GetInclusionProofByHashResponse { - // Logs can potentially contain leaves with duplicate hashes so it's possible - // for this to return multiple proofs. If the leaf index for a particular - // instance of the requested Merkle leaf hash is beyond the requested tree - // size, the corresponding proof entry will be missing. - repeated Proof proof = 2; - SignedLogRoot signed_log_root = 3; -} - -message GetConsistencyProofRequest { - int64 log_id = 1; - int64 first_tree_size = 2; - int64 second_tree_size = 3; - ChargeTo charge_to = 4; -} - -message GetConsistencyProofResponse { - // The proof field may be empty if the requested tree_size was larger - // than that available at the server (e.g. because there is skew between - // server instances, and an earlier client request was processed by a - // more up-to-date instance). In this case, the signed_log_root - // field will indicate the tree size that the server is aware of, and - // the proof field will be empty. - Proof proof = 2; - SignedLogRoot signed_log_root = 3; -} - -message GetLatestSignedLogRootRequest { - int64 log_id = 1; - ChargeTo charge_to = 2; - // If first_tree_size is non-zero, the response will include a consistency - // proof between first_tree_size and the new tree size (if not smaller). - int64 first_tree_size = 3; -} - -message GetLatestSignedLogRootResponse { - SignedLogRoot signed_log_root = 2; - // proof is filled in with a consistency proof if first_tree_size in - // GetLatestSignedLogRootRequest is non-zero (and within the tree size - // available at the server). - Proof proof = 3; -} - -message GetEntryAndProofRequest { - int64 log_id = 1; - int64 leaf_index = 2; - int64 tree_size = 3; - ChargeTo charge_to = 4; -} - -message GetEntryAndProofResponse { - Proof proof = 2; - LogLeaf leaf = 3; - SignedLogRoot signed_log_root = 4; -} - -message InitLogRequest { - int64 log_id = 1; - ChargeTo charge_to = 2; -} - -message InitLogResponse { - SignedLogRoot created = 1; -} - -message AddSequencedLeavesRequest { - int64 log_id = 1; - repeated LogLeaf leaves = 2; - ChargeTo charge_to = 4; -} - -message AddSequencedLeavesResponse { - // Same number and order as in the corresponding request. - repeated QueuedLogLeaf results = 2; -} - -message GetLeavesByRangeRequest { - int64 log_id = 1; - int64 start_index = 2; - int64 count = 3; - ChargeTo charge_to = 4; -} - -message GetLeavesByRangeResponse { - // Returned log leaves starting from the `start_index` of the request, in - // order. There may be fewer than `request.count` leaves returned, if the - // requested range extended beyond the size of the tree or if the server opted - // to return fewer leaves than requested. - repeated LogLeaf leaves = 1; - SignedLogRoot signed_log_root = 2; -} - -// QueuedLogLeaf provides the result of submitting an entry to the log. -// TODO(pavelkalinnikov): Consider renaming it to AddLogLeafResult or the like. -message QueuedLogLeaf { - // The leaf as it was stored by Trillian. Empty unless `status.code` is: - // - `google.rpc.OK`: the `leaf` data is the same as in the request. - // - `google.rpc.ALREADY_EXISTS` or 'google.rpc.FAILED_PRECONDITION`: the - // `leaf` is the conflicting one already in the log. - LogLeaf leaf = 1; - - // The status of adding the leaf. - // - `google.rpc.OK`: successfully added. - // - `google.rpc.ALREADY_EXISTS`: the leaf is a duplicate of an already - // existing one. Either `leaf_identity_hash` is the same in the `LOG` - // mode, or `leaf_index` in the `PREORDERED_LOG`. - // - `google.rpc.FAILED_PRECONDITION`: A conflicting entry is already - // present in the log, e.g., same `leaf_index` but different `leaf_data`. - google.rpc.Status status = 2; -} - -// LogLeaf describes a leaf in the Log's Merkle tree, corresponding to a single log entry. -// Each leaf has a unique leaf index in the scope of this tree. Clients submitting new -// leaf entries should only set the following fields: -// - leaf_value -// - extra_data (optionally) -// - leaf_identity_hash (optionally) -// - leaf_index (iff the log is a PREORDERED_LOG) -message LogLeaf { - // merkle_leaf_hash holds the Merkle leaf hash over leaf_value. This is - // calculated by the Trillian server when leaves are added to the tree, using - // the defined hashing algorithm and strategy for the tree; as such, the client - // does not need to set it on leaf submissions. - bytes merkle_leaf_hash = 1; - - // leaf_value holds the data that forms the value of the Merkle tree leaf. - // The client should set this field on all leaf submissions, and is - // responsible for ensuring its validity (the Trillian server treats it as an - // opaque blob). - bytes leaf_value = 2; - - // extra_data holds additional data associated with the Merkle tree leaf. - // The client may set this data on leaf submissions, and the Trillian server - // will return it on subsequent read operations. However, the contents of - // this field are not covered by and do not affect the Merkle tree hash - // calculations. - bytes extra_data = 3; - - // leaf_index indicates the index of this leaf in the Merkle tree. - // This field is returned on all read operations, but should only be - // set for leaf submissions in PREORDERED_LOG mode (for a normal log - // the leaf index is assigned by Trillian when the submitted leaf is - // integrated into the Merkle tree). - int64 leaf_index = 4; - - // leaf_identity_hash provides a hash value that indicates the client's - // concept of which leaf entries should be considered identical. - // - // This mechanism allows the client personality to indicate that two leaves - // should be considered "duplicates" even though their `leaf_value`s differ. - // - // If this is not set on leaf submissions, the Trillian server will take its - // value to be the same as merkle_leaf_hash (and thus only leaves with - // identical leaf_value contents will be considered identical). - // - // For example, in Certificate Transparency each certificate submission is - // associated with a submission timestamp, but subsequent submissions of the - // same certificate should be considered identical. This is achieved - // by setting the leaf identity hash to a hash over (just) the certificate, - // whereas the Merkle leaf hash encompasses both the certificate and its - // submission time -- allowing duplicate certificates to be detected. - // - // - // Continuing the CT example, for a CT mirror personality (which must allow - // dupes since the source log could contain them), the part of the - // personality which fetches and submits the entries might set - // `leaf_identity_hash` to `H(leaf_index||cert)`. - // - // TODO(pavelkalinnikov): Consider instead using `H(cert)` and allowing - // identity hash dupes in `PREORDERED_LOG` mode, for it can later be - // upgraded to `LOG` which will need to correctly detect duplicates with - // older entries when new ones get queued. - bytes leaf_identity_hash = 5; - - // queue_timestamp holds the time at which this leaf was queued for - // inclusion in the Log, or zero if the entry was submitted without - // queuing. Clients should not set this field on submissions. - google.protobuf.Timestamp queue_timestamp = 6; - - // integrate_timestamp holds the time at which this leaf was integrated into - // the tree. Clients should not set this field on submissions. - google.protobuf.Timestamp integrate_timestamp = 7; -} diff --git a/vendor/github.com/google/trillian/trillian_log_api_grpc.pb.go b/vendor/github.com/google/trillian/trillian_log_api_grpc.pb.go deleted file mode 100644 index 679b9c525c..0000000000 --- a/vendor/github.com/google/trillian/trillian_log_api_grpc.pb.go +++ /dev/null @@ -1,487 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.3.0 -// - protoc v3.20.1 -// source: trillian_log_api.proto - -package trillian - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -const ( - TrillianLog_QueueLeaf_FullMethodName = "/trillian.TrillianLog/QueueLeaf" - TrillianLog_GetInclusionProof_FullMethodName = "/trillian.TrillianLog/GetInclusionProof" - TrillianLog_GetInclusionProofByHash_FullMethodName = "/trillian.TrillianLog/GetInclusionProofByHash" - TrillianLog_GetConsistencyProof_FullMethodName = "/trillian.TrillianLog/GetConsistencyProof" - TrillianLog_GetLatestSignedLogRoot_FullMethodName = "/trillian.TrillianLog/GetLatestSignedLogRoot" - TrillianLog_GetEntryAndProof_FullMethodName = "/trillian.TrillianLog/GetEntryAndProof" - TrillianLog_InitLog_FullMethodName = "/trillian.TrillianLog/InitLog" - TrillianLog_AddSequencedLeaves_FullMethodName = "/trillian.TrillianLog/AddSequencedLeaves" - TrillianLog_GetLeavesByRange_FullMethodName = "/trillian.TrillianLog/GetLeavesByRange" -) - -// TrillianLogClient is the client API for TrillianLog service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type TrillianLogClient interface { - // QueueLeaf adds a single leaf to the queue of pending leaves for a normal - // log. - QueueLeaf(ctx context.Context, in *QueueLeafRequest, opts ...grpc.CallOption) (*QueueLeafResponse, error) - // GetInclusionProof returns an inclusion proof for a leaf with a given index - // in a particular tree. - // - // If the requested tree_size is larger than the server is aware of, the - // response will include the latest known log root and an empty proof. - GetInclusionProof(ctx context.Context, in *GetInclusionProofRequest, opts ...grpc.CallOption) (*GetInclusionProofResponse, error) - // GetInclusionProofByHash returns an inclusion proof for any leaves that have - // the given Merkle hash in a particular tree. - // - // If any of the leaves that match the given Merkle has have a leaf index that - // is beyond the requested tree size, the corresponding proof entry will be empty. - GetInclusionProofByHash(ctx context.Context, in *GetInclusionProofByHashRequest, opts ...grpc.CallOption) (*GetInclusionProofByHashResponse, error) - // GetConsistencyProof returns a consistency proof between different sizes of - // a particular tree. - // - // If the requested tree size is larger than the server is aware of, - // the response will include the latest known log root and an empty proof. - GetConsistencyProof(ctx context.Context, in *GetConsistencyProofRequest, opts ...grpc.CallOption) (*GetConsistencyProofResponse, error) - // GetLatestSignedLogRoot returns the latest log root for a given tree, - // and optionally also includes a consistency proof from an earlier tree size - // to the new size of the tree. - // - // If the earlier tree size is larger than the server is aware of, - // an InvalidArgument error is returned. - GetLatestSignedLogRoot(ctx context.Context, in *GetLatestSignedLogRootRequest, opts ...grpc.CallOption) (*GetLatestSignedLogRootResponse, error) - // GetEntryAndProof returns a log leaf and the corresponding inclusion proof - // to a specified tree size, for a given leaf index in a particular tree. - // - // If the requested tree size is unavailable but the leaf is - // in scope for the current tree, the returned proof will be for the - // current tree size rather than the requested tree size. - GetEntryAndProof(ctx context.Context, in *GetEntryAndProofRequest, opts ...grpc.CallOption) (*GetEntryAndProofResponse, error) - // InitLog initializes a particular tree, creating the initial signed log - // root (which will be of size 0). - InitLog(ctx context.Context, in *InitLogRequest, opts ...grpc.CallOption) (*InitLogResponse, error) - // AddSequencedLeaves adds a batch of leaves with assigned sequence numbers - // to a pre-ordered log. The indices of the provided leaves must be contiguous. - AddSequencedLeaves(ctx context.Context, in *AddSequencedLeavesRequest, opts ...grpc.CallOption) (*AddSequencedLeavesResponse, error) - // GetLeavesByRange returns a batch of leaves whose leaf indices are in a - // sequential range. - GetLeavesByRange(ctx context.Context, in *GetLeavesByRangeRequest, opts ...grpc.CallOption) (*GetLeavesByRangeResponse, error) -} - -type trillianLogClient struct { - cc grpc.ClientConnInterface -} - -func NewTrillianLogClient(cc grpc.ClientConnInterface) TrillianLogClient { - return &trillianLogClient{cc} -} - -func (c *trillianLogClient) QueueLeaf(ctx context.Context, in *QueueLeafRequest, opts ...grpc.CallOption) (*QueueLeafResponse, error) { - out := new(QueueLeafResponse) - err := c.cc.Invoke(ctx, TrillianLog_QueueLeaf_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetInclusionProof(ctx context.Context, in *GetInclusionProofRequest, opts ...grpc.CallOption) (*GetInclusionProofResponse, error) { - out := new(GetInclusionProofResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetInclusionProof_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetInclusionProofByHash(ctx context.Context, in *GetInclusionProofByHashRequest, opts ...grpc.CallOption) (*GetInclusionProofByHashResponse, error) { - out := new(GetInclusionProofByHashResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetInclusionProofByHash_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetConsistencyProof(ctx context.Context, in *GetConsistencyProofRequest, opts ...grpc.CallOption) (*GetConsistencyProofResponse, error) { - out := new(GetConsistencyProofResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetConsistencyProof_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetLatestSignedLogRoot(ctx context.Context, in *GetLatestSignedLogRootRequest, opts ...grpc.CallOption) (*GetLatestSignedLogRootResponse, error) { - out := new(GetLatestSignedLogRootResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetLatestSignedLogRoot_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetEntryAndProof(ctx context.Context, in *GetEntryAndProofRequest, opts ...grpc.CallOption) (*GetEntryAndProofResponse, error) { - out := new(GetEntryAndProofResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetEntryAndProof_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) InitLog(ctx context.Context, in *InitLogRequest, opts ...grpc.CallOption) (*InitLogResponse, error) { - out := new(InitLogResponse) - err := c.cc.Invoke(ctx, TrillianLog_InitLog_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) AddSequencedLeaves(ctx context.Context, in *AddSequencedLeavesRequest, opts ...grpc.CallOption) (*AddSequencedLeavesResponse, error) { - out := new(AddSequencedLeavesResponse) - err := c.cc.Invoke(ctx, TrillianLog_AddSequencedLeaves_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *trillianLogClient) GetLeavesByRange(ctx context.Context, in *GetLeavesByRangeRequest, opts ...grpc.CallOption) (*GetLeavesByRangeResponse, error) { - out := new(GetLeavesByRangeResponse) - err := c.cc.Invoke(ctx, TrillianLog_GetLeavesByRange_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// TrillianLogServer is the server API for TrillianLog service. -// All implementations should embed UnimplementedTrillianLogServer -// for forward compatibility -type TrillianLogServer interface { - // QueueLeaf adds a single leaf to the queue of pending leaves for a normal - // log. - QueueLeaf(context.Context, *QueueLeafRequest) (*QueueLeafResponse, error) - // GetInclusionProof returns an inclusion proof for a leaf with a given index - // in a particular tree. - // - // If the requested tree_size is larger than the server is aware of, the - // response will include the latest known log root and an empty proof. - GetInclusionProof(context.Context, *GetInclusionProofRequest) (*GetInclusionProofResponse, error) - // GetInclusionProofByHash returns an inclusion proof for any leaves that have - // the given Merkle hash in a particular tree. - // - // If any of the leaves that match the given Merkle has have a leaf index that - // is beyond the requested tree size, the corresponding proof entry will be empty. - GetInclusionProofByHash(context.Context, *GetInclusionProofByHashRequest) (*GetInclusionProofByHashResponse, error) - // GetConsistencyProof returns a consistency proof between different sizes of - // a particular tree. - // - // If the requested tree size is larger than the server is aware of, - // the response will include the latest known log root and an empty proof. - GetConsistencyProof(context.Context, *GetConsistencyProofRequest) (*GetConsistencyProofResponse, error) - // GetLatestSignedLogRoot returns the latest log root for a given tree, - // and optionally also includes a consistency proof from an earlier tree size - // to the new size of the tree. - // - // If the earlier tree size is larger than the server is aware of, - // an InvalidArgument error is returned. - GetLatestSignedLogRoot(context.Context, *GetLatestSignedLogRootRequest) (*GetLatestSignedLogRootResponse, error) - // GetEntryAndProof returns a log leaf and the corresponding inclusion proof - // to a specified tree size, for a given leaf index in a particular tree. - // - // If the requested tree size is unavailable but the leaf is - // in scope for the current tree, the returned proof will be for the - // current tree size rather than the requested tree size. - GetEntryAndProof(context.Context, *GetEntryAndProofRequest) (*GetEntryAndProofResponse, error) - // InitLog initializes a particular tree, creating the initial signed log - // root (which will be of size 0). - InitLog(context.Context, *InitLogRequest) (*InitLogResponse, error) - // AddSequencedLeaves adds a batch of leaves with assigned sequence numbers - // to a pre-ordered log. The indices of the provided leaves must be contiguous. - AddSequencedLeaves(context.Context, *AddSequencedLeavesRequest) (*AddSequencedLeavesResponse, error) - // GetLeavesByRange returns a batch of leaves whose leaf indices are in a - // sequential range. - GetLeavesByRange(context.Context, *GetLeavesByRangeRequest) (*GetLeavesByRangeResponse, error) -} - -// UnimplementedTrillianLogServer should be embedded to have forward compatible implementations. -type UnimplementedTrillianLogServer struct { -} - -func (UnimplementedTrillianLogServer) QueueLeaf(context.Context, *QueueLeafRequest) (*QueueLeafResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueueLeaf not implemented") -} -func (UnimplementedTrillianLogServer) GetInclusionProof(context.Context, *GetInclusionProofRequest) (*GetInclusionProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInclusionProof not implemented") -} -func (UnimplementedTrillianLogServer) GetInclusionProofByHash(context.Context, *GetInclusionProofByHashRequest) (*GetInclusionProofByHashResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInclusionProofByHash not implemented") -} -func (UnimplementedTrillianLogServer) GetConsistencyProof(context.Context, *GetConsistencyProofRequest) (*GetConsistencyProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConsistencyProof not implemented") -} -func (UnimplementedTrillianLogServer) GetLatestSignedLogRoot(context.Context, *GetLatestSignedLogRootRequest) (*GetLatestSignedLogRootResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLatestSignedLogRoot not implemented") -} -func (UnimplementedTrillianLogServer) GetEntryAndProof(context.Context, *GetEntryAndProofRequest) (*GetEntryAndProofResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetEntryAndProof not implemented") -} -func (UnimplementedTrillianLogServer) InitLog(context.Context, *InitLogRequest) (*InitLogResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InitLog not implemented") -} -func (UnimplementedTrillianLogServer) AddSequencedLeaves(context.Context, *AddSequencedLeavesRequest) (*AddSequencedLeavesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AddSequencedLeaves not implemented") -} -func (UnimplementedTrillianLogServer) GetLeavesByRange(context.Context, *GetLeavesByRangeRequest) (*GetLeavesByRangeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetLeavesByRange not implemented") -} - -// UnsafeTrillianLogServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to TrillianLogServer will -// result in compilation errors. -type UnsafeTrillianLogServer interface { - mustEmbedUnimplementedTrillianLogServer() -} - -func RegisterTrillianLogServer(s grpc.ServiceRegistrar, srv TrillianLogServer) { - s.RegisterService(&TrillianLog_ServiceDesc, srv) -} - -func _TrillianLog_QueueLeaf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueueLeafRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).QueueLeaf(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_QueueLeaf_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).QueueLeaf(ctx, req.(*QueueLeafRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetInclusionProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInclusionProofRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetInclusionProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetInclusionProof_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetInclusionProof(ctx, req.(*GetInclusionProofRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetInclusionProofByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInclusionProofByHashRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetInclusionProofByHash(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetInclusionProofByHash_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetInclusionProofByHash(ctx, req.(*GetInclusionProofByHashRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetConsistencyProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConsistencyProofRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetConsistencyProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetConsistencyProof_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetConsistencyProof(ctx, req.(*GetConsistencyProofRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetLatestSignedLogRoot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLatestSignedLogRootRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetLatestSignedLogRoot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetLatestSignedLogRoot_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetLatestSignedLogRoot(ctx, req.(*GetLatestSignedLogRootRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetEntryAndProof_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetEntryAndProofRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetEntryAndProof(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetEntryAndProof_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetEntryAndProof(ctx, req.(*GetEntryAndProofRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_InitLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InitLogRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).InitLog(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_InitLog_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).InitLog(ctx, req.(*InitLogRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_AddSequencedLeaves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AddSequencedLeavesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).AddSequencedLeaves(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_AddSequencedLeaves_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).AddSequencedLeaves(ctx, req.(*AddSequencedLeavesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TrillianLog_GetLeavesByRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLeavesByRangeRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TrillianLogServer).GetLeavesByRange(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: TrillianLog_GetLeavesByRange_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TrillianLogServer).GetLeavesByRange(ctx, req.(*GetLeavesByRangeRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// TrillianLog_ServiceDesc is the grpc.ServiceDesc for TrillianLog service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var TrillianLog_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "trillian.TrillianLog", - HandlerType: (*TrillianLogServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "QueueLeaf", - Handler: _TrillianLog_QueueLeaf_Handler, - }, - { - MethodName: "GetInclusionProof", - Handler: _TrillianLog_GetInclusionProof_Handler, - }, - { - MethodName: "GetInclusionProofByHash", - Handler: _TrillianLog_GetInclusionProofByHash_Handler, - }, - { - MethodName: "GetConsistencyProof", - Handler: _TrillianLog_GetConsistencyProof_Handler, - }, - { - MethodName: "GetLatestSignedLogRoot", - Handler: _TrillianLog_GetLatestSignedLogRoot_Handler, - }, - { - MethodName: "GetEntryAndProof", - Handler: _TrillianLog_GetEntryAndProof_Handler, - }, - { - MethodName: "InitLog", - Handler: _TrillianLog_InitLog_Handler, - }, - { - MethodName: "AddSequencedLeaves", - Handler: _TrillianLog_AddSequencedLeaves_Handler, - }, - { - MethodName: "GetLeavesByRange", - Handler: _TrillianLog_GetLeavesByRange_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "trillian_log_api.proto", -} diff --git a/vendor/github.com/google/trillian/types/internal/tls/tls.go b/vendor/github.com/google/trillian/types/internal/tls/tls.go deleted file mode 100644 index badec7b500..0000000000 --- a/vendor/github.com/google/trillian/types/internal/tls/tls.go +++ /dev/null @@ -1,713 +0,0 @@ -// Copyright 2016 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package tls implements functionality for dealing with TLS-encoded data, -// as defined in RFC 5246. This includes parsing and generation of TLS-encoded -// data, together with utility functions for dealing with the DigitallySigned -// TLS type. -// N.B. This is copied from https://github.com/google/certificate-transparency-go/tree/master/tls -// - DO NOT MAKE CHANGES TO THIS FILE except to sync to the latest from ct-go. -package tls - -import ( - "bytes" - "encoding/binary" - "fmt" - "reflect" - "strconv" - "strings" -) - -// This file holds utility functions for TLS encoding/decoding data -// as per RFC 5246 section 4. - -// A structuralError suggests that the TLS data is valid, but the Go type -// which is receiving it doesn't match. -type structuralError struct { - field string - msg string -} - -func (e structuralError) Error() string { - var prefix string - if e.field != "" { - prefix = e.field + ": " - } - return "tls: structure error: " + prefix + e.msg -} - -// A syntaxError suggests that the TLS data is invalid. -type syntaxError struct { - field string - msg string -} - -func (e syntaxError) Error() string { - var prefix string - if e.field != "" { - prefix = e.field + ": " - } - return "tls: syntax error: " + prefix + e.msg -} - -// Uint24 is an unsigned 3-byte integer. -type Uint24 uint32 - -// Enum is an unsigned integer. -type Enum uint64 - -var ( - uint8Type = reflect.TypeOf(uint8(0)) - uint16Type = reflect.TypeOf(uint16(0)) - uint24Type = reflect.TypeOf(Uint24(0)) - uint32Type = reflect.TypeOf(uint32(0)) - uint64Type = reflect.TypeOf(uint64(0)) - enumType = reflect.TypeOf(Enum(0)) -) - -// Unmarshal parses the TLS-encoded data in b and uses the reflect package to -// fill in an arbitrary value pointed at by val. Because Unmarshal uses the -// reflect package, the structs being written to must use exported fields -// (upper case names). -// -// The mappings between TLS types and Go types is as follows; some fields -// must have tags (to indicate their encoded size). -// -// TLS Go Required Tags -// opaque byte / uint8 -// uint8 byte / uint8 -// uint16 uint16 -// uint24 tls.Uint24 -// uint32 uint32 -// uint64 uint64 -// enum tls.Enum size:S or maxval:N -// Type []Type minlen:N,maxlen:M -// opaque[N] [N]byte / [N]uint8 -// uint8[N] [N]byte / [N]uint8 -// struct { } struct { } -// select(T) { -// case e1: Type *T selector:Field,val:e1 -// } -// -// TLS variants (RFC 5246 s4.6.1) are only supported when the value of the -// associated enumeration type is available earlier in the same enclosing -// struct, and each possible variant is marked with a selector tag (to -// indicate which field selects the variants) and a val tag (to indicate -// what value of the selector picks this particular field). -// -// For example, a TLS structure: -// -// enum { e1(1), e2(2) } EnumType; -// struct { -// EnumType sel; -// select(sel) { -// case e1: uint16 -// case e2: uint32 -// } data; -// } VariantItem; -// -// would have a corresponding Go type: -// -// type VariantItem struct { -// Sel tls.Enum `tls:"maxval:2"` -// Data16 *uint16 `tls:"selector:Sel,val:1"` -// Data32 *uint32 `tls:"selector:Sel,val:2"` -// } -// -// TLS fixed-length vectors of types other than opaque or uint8 are not supported. -// -// For TLS variable-length vectors that are themselves used in other vectors, -// create a single-field structure to represent the inner type. For example, for: -// -// opaque InnerType<1..65535>; -// struct { -// InnerType inners<1,65535>; -// } Something; -// -// convert to: -// -// type InnerType struct { -// Val []byte `tls:"minlen:1,maxlen:65535"` -// } -// type Something struct { -// Inners []InnerType `tls:"minlen:1,maxlen:65535"` -// } -// -// If the encoded value does not fit in the Go type, Unmarshal returns a parse error. -func Unmarshal(b []byte, val interface{}) ([]byte, error) { - return UnmarshalWithParams(b, val, "") -} - -// UnmarshalWithParams allows field parameters to be specified for the -// top-level element. The form of the params is the same as the field tags. -func UnmarshalWithParams(b []byte, val interface{}, params string) ([]byte, error) { - info, err := fieldTagToFieldInfo(params, "") - if err != nil { - return nil, err - } - // The passed in interface{} is a pointer (to allow the value to be written - // to); extract the pointed-to object as a reflect.Value, so parseField - // can do various introspection things. - v := reflect.ValueOf(val).Elem() - offset, err := parseField(v, b, 0, info) - if err != nil { - return nil, err - } - return b[offset:], nil -} - -// Return the number of bytes needed to encode values up to (and including) x. -func byteCount(x uint64) uint { - switch { - case x < 0x100: - return 1 - case x < 0x10000: - return 2 - case x < 0x1000000: - return 3 - case x < 0x100000000: - return 4 - case x < 0x10000000000: - return 5 - case x < 0x1000000000000: - return 6 - case x < 0x100000000000000: - return 7 - default: - return 8 - } -} - -type fieldInfo struct { - count uint // Number of bytes - countSet bool - minlen uint64 // Only relevant for slices - maxlen uint64 // Only relevant for slices - selector string // Only relevant for select sub-values - val uint64 // Only relevant for select sub-values - name string // Used for better error messages -} - -func (i *fieldInfo) fieldName() string { - if i == nil { - return "" - } - return i.name -} - -// Given a tag string, return a fieldInfo describing the field. -func fieldTagToFieldInfo(str string, name string) (*fieldInfo, error) { - var info *fieldInfo - // Iterate over clauses in the tag, ignoring any that don't parse properly. - for _, part := range strings.Split(str, ",") { - switch { - case strings.HasPrefix(part, "maxval:"): - if v, err := strconv.ParseUint(part[7:], 10, 64); err == nil { - info = &fieldInfo{count: byteCount(v), countSet: true} - } - case strings.HasPrefix(part, "size:"): - if sz, err := strconv.ParseUint(part[5:], 10, 32); err == nil { - info = &fieldInfo{count: uint(sz), countSet: true} - } - case strings.HasPrefix(part, "maxlen:"): - v, err := strconv.ParseUint(part[7:], 10, 64) - if err != nil { - continue - } - if info == nil { - info = &fieldInfo{} - } - info.count = byteCount(v) - info.countSet = true - info.maxlen = v - case strings.HasPrefix(part, "minlen:"): - v, err := strconv.ParseUint(part[7:], 10, 64) - if err != nil { - continue - } - if info == nil { - info = &fieldInfo{} - } - info.minlen = v - case strings.HasPrefix(part, "selector:"): - if info == nil { - info = &fieldInfo{} - } - info.selector = part[9:] - case strings.HasPrefix(part, "val:"): - v, err := strconv.ParseUint(part[4:], 10, 64) - if err != nil { - continue - } - if info == nil { - info = &fieldInfo{} - } - info.val = v - } - } - if info != nil { - info.name = name - if info.selector == "" { - if info.count < 1 { - return nil, structuralError{name, "field of unknown size in " + str} - } else if info.count > 8 { - return nil, structuralError{name, "specified size too large in " + str} - } else if info.minlen > info.maxlen { - return nil, structuralError{name, "specified length range inverted in " + str} - } else if info.val > 0 { - return nil, structuralError{name, "specified selector value but not field in " + str} - } - } - } else if name != "" { - info = &fieldInfo{name: name} - } - return info, nil -} - -// Check that a value fits into a field described by a fieldInfo structure. -func (i fieldInfo) check(val uint64, fldName string) error { - if val >= (1 << (8 * i.count)) { - return structuralError{fldName, fmt.Sprintf("value %d too large for size", val)} - } - if i.maxlen != 0 { - if val < i.minlen { - return structuralError{fldName, fmt.Sprintf("value %d too small for minimum %d", val, i.minlen)} - } - if val > i.maxlen { - return structuralError{fldName, fmt.Sprintf("value %d too large for maximum %d", val, i.maxlen)} - } - } - return nil -} - -// readVarUint reads an big-endian unsigned integer of the given size in -// bytes. -func readVarUint(data []byte, info *fieldInfo) (uint64, error) { - if info == nil || !info.countSet { - return 0, structuralError{info.fieldName(), "no field size information available"} - } - if len(data) < int(info.count) { - return 0, syntaxError{info.fieldName(), "truncated variable-length integer"} - } - var result uint64 - for i := uint(0); i < info.count; i++ { - result = (result << 8) | uint64(data[i]) - } - if err := info.check(result, info.name); err != nil { - return 0, err - } - return result, nil -} - -// parseField is the main parsing function. Given a byte slice and an offset -// (in bytes) into the data, it will try to parse a suitable ASN.1 value out -// and store it in the given Value. -func parseField(v reflect.Value, data []byte, initOffset int, info *fieldInfo) (int, error) { - offset := initOffset - rest := data[offset:] - - fieldType := v.Type() - // First look for known fixed types. - switch fieldType { - case uint8Type: - if len(rest) < 1 { - return offset, syntaxError{info.fieldName(), "truncated uint8"} - } - v.SetUint(uint64(rest[0])) - offset++ - return offset, nil - case uint16Type: - if len(rest) < 2 { - return offset, syntaxError{info.fieldName(), "truncated uint16"} - } - v.SetUint(uint64(binary.BigEndian.Uint16(rest))) - offset += 2 - return offset, nil - case uint24Type: - if len(rest) < 3 { - return offset, syntaxError{info.fieldName(), "truncated uint24"} - } - v.SetUint(uint64(data[0])<<16 | uint64(data[1])<<8 | uint64(data[2])) - offset += 3 - return offset, nil - case uint32Type: - if len(rest) < 4 { - return offset, syntaxError{info.fieldName(), "truncated uint32"} - } - v.SetUint(uint64(binary.BigEndian.Uint32(rest))) - offset += 4 - return offset, nil - case uint64Type: - if len(rest) < 8 { - return offset, syntaxError{info.fieldName(), "truncated uint64"} - } - v.SetUint(uint64(binary.BigEndian.Uint64(rest))) - offset += 8 - return offset, nil - } - - // Now deal with user-defined types. - switch v.Kind() { - case enumType.Kind(): - // Assume that anything of the same kind as Enum is an Enum, so that - // users can alias types of their own to Enum. - val, err := readVarUint(rest, info) - if err != nil { - return offset, err - } - v.SetUint(val) - offset += int(info.count) - return offset, nil - case reflect.Struct: - structType := fieldType - // TLS includes a select(Enum) {..} construct, where the value of an enum - // indicates which variant field is present (like a C union). We require - // that the enum value be an earlier field in the same structure (the selector), - // and that each of the possible variant destination fields be pointers. - // So the Go mapping looks like: - // type variantType struct { - // Which tls.Enum `tls:"size:1"` // this is the selector - // Val1 *type1 `tls:"selector:Which,val:1"` // this is a destination - // Val2 *type2 `tls:"selector:Which,val:1"` // this is a destination - // } - - // To deal with this, we track any enum-like fields and their values... - enums := make(map[string]uint64) - // .. and we track which selector names we've seen (in the destination field tags), - // and whether a destination for that selector has been chosen. - selectorSeen := make(map[string]bool) - for i := 0; i < structType.NumField(); i++ { - // Find information about this field. - tag := structType.Field(i).Tag.Get("tls") - fieldInfo, err := fieldTagToFieldInfo(tag, structType.Field(i).Name) - if err != nil { - return offset, err - } - - destination := v.Field(i) - if fieldInfo.selector != "" { - // This is a possible select(Enum) destination, so first check that the referenced - // selector field has already been seen earlier in the struct. - choice, ok := enums[fieldInfo.selector] - if !ok { - return offset, structuralError{fieldInfo.name, "selector not seen: " + fieldInfo.selector} - } - if structType.Field(i).Type.Kind() != reflect.Ptr { - return offset, structuralError{fieldInfo.name, "choice field not a pointer type"} - } - // Is this the first mention of the selector field name? If so, remember it. - seen, ok := selectorSeen[fieldInfo.selector] - if !ok { - selectorSeen[fieldInfo.selector] = false - } - if choice != fieldInfo.val { - // This destination field was not the chosen one, so make it nil (we checked - // it was a pointer above). - v.Field(i).Set(reflect.Zero(structType.Field(i).Type)) - continue - } - if seen { - // We already saw a different destination field receive the value for this - // selector value, which indicates a badly annotated structure. - return offset, structuralError{fieldInfo.name, "duplicate selector value for " + fieldInfo.selector} - } - selectorSeen[fieldInfo.selector] = true - // Make an object of the pointed-to type and parse into that. - v.Field(i).Set(reflect.New(structType.Field(i).Type.Elem())) - destination = v.Field(i).Elem() - } - offset, err = parseField(destination, data, offset, fieldInfo) - if err != nil { - return offset, err - } - - // Remember any possible tls.Enum values encountered in case they are selectors. - if structType.Field(i).Type.Kind() == enumType.Kind() { - enums[structType.Field(i).Name] = v.Field(i).Uint() - } - - } - - // Now we have seen all fields in the structure, check that all select(Enum) {..} selector - // fields found a destination to put their data in. - for selector, seen := range selectorSeen { - if !seen { - return offset, syntaxError{info.fieldName(), selector + ": unhandled value for selector"} - } - } - return offset, nil - case reflect.Array: - datalen := v.Len() - - if datalen > len(rest) { - return offset, syntaxError{info.fieldName(), "truncated array"} - } - inner := rest[:datalen] - offset += datalen - if fieldType.Elem().Kind() != reflect.Uint8 { - // Only byte/uint8 arrays are supported - return offset, structuralError{info.fieldName(), "unsupported array type: " + v.Type().String()} - } - reflect.Copy(v, reflect.ValueOf(inner)) - return offset, nil - - case reflect.Slice: - sliceType := fieldType - // Slices represent variable-length vectors, which are prefixed by a length field. - // The fieldInfo indicates the size of that length field. - varlen, err := readVarUint(rest, info) - if err != nil { - return offset, err - } - datalen := int(varlen) - offset += int(info.count) - rest = rest[info.count:] - - if datalen > len(rest) { - return offset, syntaxError{info.fieldName(), "truncated slice"} - } - inner := rest[:datalen] - offset += datalen - if fieldType.Elem().Kind() == reflect.Uint8 { - // Fast version for []byte - v.Set(reflect.MakeSlice(sliceType, datalen, datalen)) - reflect.Copy(v, reflect.ValueOf(inner)) - return offset, nil - } - - v.Set(reflect.MakeSlice(sliceType, 0, datalen)) - single := reflect.New(sliceType.Elem()) - for innerOffset := 0; innerOffset < len(inner); { - var err error - innerOffset, err = parseField(single.Elem(), inner, innerOffset, nil) - if err != nil { - return offset, err - } - v.Set(reflect.Append(v, single.Elem())) - } - return offset, nil - - default: - return offset, structuralError{info.fieldName(), fmt.Sprintf("unsupported type: %s of kind %s", fieldType, v.Kind())} - } -} - -// Marshal returns the TLS encoding of val. -func Marshal(val interface{}) ([]byte, error) { - return MarshalWithParams(val, "") -} - -// MarshalWithParams returns the TLS encoding of val, and allows field -// parameters to be specified for the top-level element. The form -// of the params is the same as the field tags. -func MarshalWithParams(val interface{}, params string) ([]byte, error) { - info, err := fieldTagToFieldInfo(params, "") - if err != nil { - return nil, err - } - var out bytes.Buffer - v := reflect.ValueOf(val) - if err := marshalField(&out, v, info); err != nil { - return nil, err - } - return out.Bytes(), err -} - -func marshalField(out *bytes.Buffer, v reflect.Value, info *fieldInfo) error { - var prefix string - if info != nil && len(info.name) > 0 { - prefix = info.name + ": " - } - fieldType := v.Type() - // First look for known fixed types. - switch fieldType { - case uint8Type: - out.WriteByte(byte(v.Uint())) - return nil - case uint16Type: - scratch := make([]byte, 2) - binary.BigEndian.PutUint16(scratch, uint16(v.Uint())) - out.Write(scratch) - return nil - case uint24Type: - i := v.Uint() - if i > 0xffffff { - return structuralError{info.fieldName(), fmt.Sprintf("uint24 overflow %d", i)} - } - scratch := make([]byte, 4) - binary.BigEndian.PutUint32(scratch, uint32(i)) - out.Write(scratch[1:]) - return nil - case uint32Type: - scratch := make([]byte, 4) - binary.BigEndian.PutUint32(scratch, uint32(v.Uint())) - out.Write(scratch) - return nil - case uint64Type: - scratch := make([]byte, 8) - binary.BigEndian.PutUint64(scratch, uint64(v.Uint())) - out.Write(scratch) - return nil - } - - // Now deal with user-defined types. - switch v.Kind() { - case enumType.Kind(): - i := v.Uint() - if info == nil { - return structuralError{info.fieldName(), "enum field tag missing"} - } - if err := info.check(i, prefix); err != nil { - return err - } - scratch := make([]byte, 8) - binary.BigEndian.PutUint64(scratch, uint64(i)) - out.Write(scratch[(8 - info.count):]) - return nil - case reflect.Struct: - structType := fieldType - enums := make(map[string]uint64) // Values of any Enum fields - // The comment parseField() describes the mapping of the TLS select(Enum) {..} construct; - // here we have selector and source (rather than destination) fields. - - // Track which selector names we've seen (in the source field tags), and whether a source - // value for that selector has been processed. - selectorSeen := make(map[string]bool) - for i := 0; i < structType.NumField(); i++ { - // Find information about this field. - tag := structType.Field(i).Tag.Get("tls") - fieldInfo, err := fieldTagToFieldInfo(tag, structType.Field(i).Name) - if err != nil { - return err - } - - source := v.Field(i) - if fieldInfo.selector != "" { - // This field is a possible source for a select(Enum) {..}. First check - // the selector field name has been seen. - choice, ok := enums[fieldInfo.selector] - if !ok { - return structuralError{fieldInfo.name, "selector not seen: " + fieldInfo.selector} - } - if structType.Field(i).Type.Kind() != reflect.Ptr { - return structuralError{fieldInfo.name, "choice field not a pointer type"} - } - // Is this the first mention of the selector field name? If so, remember it. - seen, ok := selectorSeen[fieldInfo.selector] - if !ok { - selectorSeen[fieldInfo.selector] = false - } - if choice != fieldInfo.val { - // This source was not chosen; police that it should be nil. - if v.Field(i).Pointer() != uintptr(0) { - return structuralError{fieldInfo.name, "unchosen field is non-nil"} - } - continue - } - if seen { - // We already saw a different source field generate the value for this - // selector value, which indicates a badly annotated structure. - return structuralError{fieldInfo.name, "duplicate selector value for " + fieldInfo.selector} - } - selectorSeen[fieldInfo.selector] = true - if v.Field(i).Pointer() == uintptr(0) { - return structuralError{fieldInfo.name, "chosen field is nil"} - } - // Marshal from the pointed-to source object. - source = v.Field(i).Elem() - } - - var fieldData bytes.Buffer - if err := marshalField(&fieldData, source, fieldInfo); err != nil { - return err - } - out.Write(fieldData.Bytes()) - - // Remember any tls.Enum values encountered in case they are selectors. - if structType.Field(i).Type.Kind() == enumType.Kind() { - enums[structType.Field(i).Name] = v.Field(i).Uint() - } - } - // Now we have seen all fields in the structure, check that all select(Enum) {..} selector - // fields found a source field get get their data from. - for selector, seen := range selectorSeen { - if !seen { - return syntaxError{info.fieldName(), selector + ": unhandled value for selector"} - } - } - return nil - - case reflect.Array: - datalen := v.Len() - arrayType := fieldType - if arrayType.Elem().Kind() != reflect.Uint8 { - // Only byte/uint8 arrays are supported - return structuralError{info.fieldName(), "unsupported array type"} - } - bytes := make([]byte, datalen) - for i := 0; i < datalen; i++ { - bytes[i] = uint8(v.Index(i).Uint()) - } - _, err := out.Write(bytes) - return err - - case reflect.Slice: - if info == nil { - return structuralError{info.fieldName(), "slice field tag missing"} - } - - sliceType := fieldType - if sliceType.Elem().Kind() == reflect.Uint8 { - // Fast version for []byte: first write the length as info.count bytes. - datalen := v.Len() - scratch := make([]byte, 8) - binary.BigEndian.PutUint64(scratch, uint64(datalen)) - out.Write(scratch[(8 - info.count):]) - - if err := info.check(uint64(datalen), prefix); err != nil { - return err - } - // Then just write the data. - bytes := make([]byte, datalen) - for i := 0; i < datalen; i++ { - bytes[i] = uint8(v.Index(i).Uint()) - } - _, err := out.Write(bytes) - return err - } - // General version: use a separate Buffer to write the slice entries into. - var innerBuf bytes.Buffer - for i := 0; i < v.Len(); i++ { - if err := marshalField(&innerBuf, v.Index(i), nil); err != nil { - return err - } - } - - // Now insert (and check) the size. - size := uint64(innerBuf.Len()) - if err := info.check(size, prefix); err != nil { - return err - } - scratch := make([]byte, 8) - binary.BigEndian.PutUint64(scratch, size) - out.Write(scratch[(8 - info.count):]) - - // Then copy the data. - _, err := out.Write(innerBuf.Bytes()) - return err - - default: - return structuralError{info.fieldName(), fmt.Sprintf("unsupported type: %s of kind %s", fieldType, v.Kind())} - } -} diff --git a/vendor/github.com/google/trillian/types/logroot.go b/vendor/github.com/google/trillian/types/logroot.go deleted file mode 100644 index 1c3a38045e..0000000000 --- a/vendor/github.com/google/trillian/types/logroot.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2018 Google LLC. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package types defines serialization and parsing functions for SignedLogRoot -// fields. -package types - -import ( - "encoding/binary" - "fmt" - - "github.com/google/trillian/types/internal/tls" - - "github.com/google/trillian" -) - -// LogRootV1 holds the TLS-deserialization of the following structure -// (described in RFC5246 section 4 notation): -// -// struct { -// uint64 tree_size; -// opaque root_hash<0..128>; -// uint64 timestamp_nanos; -// uint64 revision; -// opaque metadata<0..65535>; -// } LogRootV1; -type LogRootV1 struct { - // TreeSize is the number of leaves in the log Merkle tree. - TreeSize uint64 - // RootHash is the hash of the root node of the tree. - RootHash []byte `tls:"minlen:0,maxlen:128"` - // TimestampNanos is the time in nanoseconds for when this root was created, - // counting from the UNIX epoch. - TimestampNanos uint64 - - // Revision is the Merkle tree revision associated with this root. - // - // Deprecated: Revision is a concept internal to the storage layer. - Revision uint64 - - // Metadata holds additional data associated with this root. - Metadata []byte `tls:"minlen:0,maxlen:65535"` -} - -// LogRoot holds the TLS-deserialization of the following structure -// (described in RFC5246 section 4 notation): -// enum { v1(1), (65535)} Version; -// -// struct { -// Version version; -// select(version) { -// case v1: LogRootV1; -// } -// } LogRoot; -type LogRoot struct { - Version tls.Enum `tls:"size:2"` - V1 *LogRootV1 `tls:"selector:Version,val:1"` -} - -// UnmarshalBinary verifies that logRootBytes is a TLS serialized LogRoot, has -// the LOG_ROOT_FORMAT_V1 tag, and populates the caller with the deserialized -// *LogRootV1. -func (l *LogRootV1) UnmarshalBinary(logRootBytes []byte) error { - if len(logRootBytes) < 3 { - return fmt.Errorf("logRootBytes too short") - } - if l == nil { - return fmt.Errorf("nil log root") - } - version := binary.BigEndian.Uint16(logRootBytes) - if version != uint16(trillian.LogRootFormat_LOG_ROOT_FORMAT_V1) { - return fmt.Errorf("invalid LogRoot.Version: %v, want %v", - version, trillian.LogRootFormat_LOG_ROOT_FORMAT_V1) - } - - var logRoot LogRoot - if _, err := tls.Unmarshal(logRootBytes, &logRoot); err != nil { - return err - } - - *l = *logRoot.V1 - return nil -} - -// MarshalBinary returns a canonical TLS serialization of LogRoot. -func (l *LogRootV1) MarshalBinary() ([]byte, error) { - return tls.Marshal(LogRoot{ - Version: tls.Enum(trillian.LogRootFormat_LOG_ROOT_FORMAT_V1), - V1: l, - }) -} diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md new file mode 100644 index 0000000000..33686e4da8 --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md @@ -0,0 +1,9 @@ +## 0.7.4 (Jun 6, 2023) + +BUG FIXES + +- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 [GH-194] + +## 0.7.3 (May 15, 2023) + +Initial release diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS new file mode 100644 index 0000000000..f8389c995e --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS @@ -0,0 +1 @@ +* @hashicorp/release-engineering \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE index e87a115e46..f4f97ee585 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE +++ b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2015 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go index f40d2411cf..cad96bd97b 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package retryablehttp provides a familiar HTTP client interface with // automatic retries and exponential backoff. It is a thin wrapper over the // standard net/http client library and exposes nearly the same public API. @@ -257,10 +260,17 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro if err != nil { return nil, 0, err } - bodyReader = func() (io.Reader, error) { - return bytes.NewReader(buf), nil + if len(buf) == 0 { + bodyReader = func() (io.Reader, error) { + return http.NoBody, nil + } + contentLength = 0 + } else { + bodyReader = func() (io.Reader, error) { + return bytes.NewReader(buf), nil + } + contentLength = int64(len(buf)) } - contentLength = int64(len(buf)) // No body provided, nothing to do case nil: diff --git a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go index 8f3ee35842..8c407adb3b 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package retryablehttp import ( diff --git a/vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go b/vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go index ee6059e2b9..94dc68c66a 100644 --- a/vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go +++ b/vendor/github.com/sigstore/rekor/pkg/util/checkpoint.go @@ -25,7 +25,6 @@ import ( "strings" "time" - "github.com/google/trillian/types" "github.com/sigstore/sigstore/pkg/signature" "github.com/sigstore/sigstore/pkg/signature/options" ) @@ -168,11 +167,11 @@ func (r *SignedCheckpoint) GetTimestamp() uint64 { } // CreateAndSignCheckpoint creates a signed checkpoint as a commitment to the current root hash -func CreateAndSignCheckpoint(ctx context.Context, hostname string, treeID int64, root *types.LogRootV1, signer signature.Signer) ([]byte, error) { +func CreateAndSignCheckpoint(ctx context.Context, hostname string, treeID int64, treeSize uint64, rootHash []byte, signer signature.Signer) ([]byte, error) { sth, err := CreateSignedCheckpoint(Checkpoint{ Origin: fmt.Sprintf("%s - %d", hostname, treeID), - Size: root.TreeSize, - Hash: root.RootHash, + Size: treeSize, + Hash: rootHash, }) if err != nil { return nil, fmt.Errorf("error creating checkpoint: %v", err) diff --git a/vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go b/vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go index 8b61aa15f6..2764b4b315 100644 --- a/vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go +++ b/vendor/github.com/sigstore/sigstore/pkg/signature/payload/payload.go @@ -52,16 +52,32 @@ type Image struct { // Cosign describes a container image signed using Cosign type Cosign struct { - Image name.Digest - Annotations map[string]interface{} + Image name.Digest + // ClaimedIdentity is what the signer claims the image to be; usually a registry.com/…/repo:tag, but can also use a digest instead. + // ALMOST ALL consumers MUST verify that ClaimedIdentity in the signature is correct given how user refers to the image; + // e.g. if the user asks to access a signed image example.com/repo/mysql:3.14, + // it is ALMOST ALWAYS necessary to validate that ClaimedIdentity = example.com/repo/mysql:3.14 + // + // Considerations: + // - The user might refer to an image using a digest (example.com/repo/mysql@sha256:…); in that case the registry/…/repo should still match + // - If the image is multi-arch, ClaimedIdentity usually refers to the top-level multi-arch image index also on the per-arch images + // (possibly even if ClaimedIdentity contains a digest!) + // - Older versions of cosign generate signatures where ClaimedIdentity only contains a registry/…/repo ; signature consumers should allow users + // to determine whether such images should be accepted (and, long-term, the default SHOULD be to reject them) + ClaimedIdentity string + Annotations map[string]interface{} } // SimpleContainerImage returns information about a container image in the github.com/containers/image/signature format func (p Cosign) SimpleContainerImage() SimpleContainerImage { + dockerReference := p.Image.Repository.Name() + if p.ClaimedIdentity != "" { + dockerReference = p.ClaimedIdentity + } return SimpleContainerImage{ Critical: Critical{ Identity: Identity{ - DockerReference: p.Image.Repository.Name(), + DockerReference: dockerReference, }, Image: Image{ DockerManifestDigest: p.Image.DigestStr(), @@ -98,6 +114,7 @@ func (p *Cosign) UnmarshalJSON(data []byte) error { return fmt.Errorf("could not parse image digest string %q: %w", digestStr, err) } p.Image = digest + p.ClaimedIdentity = simple.Critical.Identity.DockerReference p.Annotations = simple.Optional return nil } diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index cd057f3982..033b6e6db6 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -441,7 +441,7 @@ func (s *Server) ServeConn(c net.Conn, opts *ServeConnOpts) { if s.NewWriteScheduler != nil { sc.writeSched = s.NewWriteScheduler() } else { - sc.writeSched = NewPriorityWriteScheduler(nil) + sc.writeSched = newRoundRobinWriteScheduler() } // These start at the RFC-specified defaults. If there is a higher @@ -2429,7 +2429,7 @@ type requestBody struct { conn *serverConn closeOnce sync.Once // for use by Close only sawEOF bool // for use by Read only - pipe *pipe // non-nil if we have a HTTP entity message body + pipe *pipe // non-nil if we have an HTTP entity message body needsContinue bool // need to send a 100-continue } @@ -2569,7 +2569,8 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { clen = "" } } - if clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { + _, hasContentLength := rws.snapHeader["Content-Length"] + if !hasContentLength && clen == "" && rws.handlerDone && bodyAllowedForStatus(rws.status) && (len(p) > 0 || !isHeadResp) { clen = strconv.Itoa(len(p)) } _, hasContentType := rws.snapHeader["Content-Type"] @@ -2774,7 +2775,7 @@ func (w *responseWriter) FlushError() error { err = rws.bw.Flush() } else { // The bufio.Writer won't call chunkWriter.Write - // (writeChunk with zero bytes, so we have to do it + // (writeChunk with zero bytes), so we have to do it // ourselves to force the HTTP response header and/or // final DATA frame (with END_STREAM) to be sent. _, err = chunkWriter{rws}.Write(nil) diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index ac90a2631c..4f08ccba9a 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -1268,8 +1268,8 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { cancelRequest := func(cs *clientStream, err error) error { cs.cc.mu.Lock() - defer cs.cc.mu.Unlock() cs.abortStreamLocked(err) + bodyClosed := cs.reqBodyClosed if cs.ID != 0 { // This request may have failed because of a problem with the connection, // or for some unrelated reason. (For example, the user might have canceled @@ -1284,6 +1284,23 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { // will not help. cs.cc.doNotReuse = true } + cs.cc.mu.Unlock() + // Wait for the request body to be closed. + // + // If nothing closed the body before now, abortStreamLocked + // will have started a goroutine to close it. + // + // Closing the body before returning avoids a race condition + // with net/http checking its readTrackingBody to see if the + // body was read from or closed. See golang/go#60041. + // + // The body is closed in a separate goroutine without the + // connection mutex held, but dropping the mutex before waiting + // will keep us from holding it indefinitely if the body + // close is slow for some reason. + if bodyClosed != nil { + <-bodyClosed + } return err } @@ -1899,7 +1916,7 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail // 8.1.2.3 Request Pseudo-Header Fields // The :path pseudo-header field includes the path and query parts of the // target URI (the path-absolute production and optionally a '?' character - // followed by the query production (see Sections 3.3 and 3.4 of + // followed by the query production, see Sections 3.3 and 3.4 of // [RFC3986]). f(":authority", host) m := req.Method diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go index c7cd001739..cc893adc29 100644 --- a/vendor/golang.org/x/net/http2/writesched.go +++ b/vendor/golang.org/x/net/http2/writesched.go @@ -184,7 +184,8 @@ func (wr *FrameWriteRequest) replyToWriter(err error) { // writeQueue is used by implementations of WriteScheduler. type writeQueue struct { - s []FrameWriteRequest + s []FrameWriteRequest + prev, next *writeQueue } func (q *writeQueue) empty() bool { return len(q.s) == 0 } diff --git a/vendor/golang.org/x/net/http2/writesched_roundrobin.go b/vendor/golang.org/x/net/http2/writesched_roundrobin.go new file mode 100644 index 0000000000..54fe86322d --- /dev/null +++ b/vendor/golang.org/x/net/http2/writesched_roundrobin.go @@ -0,0 +1,119 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package http2 + +import ( + "fmt" + "math" +) + +type roundRobinWriteScheduler struct { + // control contains control frames (SETTINGS, PING, etc.). + control writeQueue + + // streams maps stream ID to a queue. + streams map[uint32]*writeQueue + + // stream queues are stored in a circular linked list. + // head is the next stream to write, or nil if there are no streams open. + head *writeQueue + + // pool of empty queues for reuse. + queuePool writeQueuePool +} + +// newRoundRobinWriteScheduler constructs a new write scheduler. +// The round robin scheduler priorizes control frames +// like SETTINGS and PING over DATA frames. +// When there are no control frames to send, it performs a round-robin +// selection from the ready streams. +func newRoundRobinWriteScheduler() WriteScheduler { + ws := &roundRobinWriteScheduler{ + streams: make(map[uint32]*writeQueue), + } + return ws +} + +func (ws *roundRobinWriteScheduler) OpenStream(streamID uint32, options OpenStreamOptions) { + if ws.streams[streamID] != nil { + panic(fmt.Errorf("stream %d already opened", streamID)) + } + q := ws.queuePool.get() + ws.streams[streamID] = q + if ws.head == nil { + ws.head = q + q.next = q + q.prev = q + } else { + // Queues are stored in a ring. + // Insert the new stream before ws.head, putting it at the end of the list. + q.prev = ws.head.prev + q.next = ws.head + q.prev.next = q + q.next.prev = q + } +} + +func (ws *roundRobinWriteScheduler) CloseStream(streamID uint32) { + q := ws.streams[streamID] + if q == nil { + return + } + if q.next == q { + // This was the only open stream. + ws.head = nil + } else { + q.prev.next = q.next + q.next.prev = q.prev + if ws.head == q { + ws.head = q.next + } + } + delete(ws.streams, streamID) + ws.queuePool.put(q) +} + +func (ws *roundRobinWriteScheduler) AdjustStream(streamID uint32, priority PriorityParam) {} + +func (ws *roundRobinWriteScheduler) Push(wr FrameWriteRequest) { + if wr.isControl() { + ws.control.push(wr) + return + } + q := ws.streams[wr.StreamID()] + if q == nil { + // This is a closed stream. + // wr should not be a HEADERS or DATA frame. + // We push the request onto the control queue. + if wr.DataSize() > 0 { + panic("add DATA on non-open stream") + } + ws.control.push(wr) + return + } + q.push(wr) +} + +func (ws *roundRobinWriteScheduler) Pop() (FrameWriteRequest, bool) { + // Control and RST_STREAM frames first. + if !ws.control.empty() { + return ws.control.shift(), true + } + if ws.head == nil { + return FrameWriteRequest{}, false + } + q := ws.head + for { + if wr, ok := q.consume(math.MaxInt32); ok { + ws.head = q.next + return wr, true + } + q = q.next + if q == ws.head { + break + } + } + return FrameWriteRequest{}, false +} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cbee7a4e23..b18efb743f 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -20,7 +20,7 @@ type token struct{} // A zero Group is valid, has no limit on the number of active goroutines, // and does not cancel on error. type Group struct { - cancel func() + cancel func(error) wg sync.WaitGroup @@ -43,7 +43,7 @@ func (g *Group) done() { // returns a non-nil error or the first time Wait returns, whichever occurs // first. func WithContext(ctx context.Context) (*Group, context.Context) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := withCancelCause(ctx) return &Group{cancel: cancel}, ctx } @@ -52,7 +52,7 @@ func WithContext(ctx context.Context) (*Group, context.Context) { func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { - g.cancel() + g.cancel(g.err) } return g.err } @@ -76,7 +76,7 @@ func (g *Group) Go(f func() error) { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } @@ -105,7 +105,7 @@ func (g *Group) TryGo(f func() error) bool { g.errOnce.Do(func() { g.err = err if g.cancel != nil { - g.cancel() + g.cancel(g.err) } }) } diff --git a/vendor/golang.org/x/sync/errgroup/go120.go b/vendor/golang.org/x/sync/errgroup/go120.go new file mode 100644 index 0000000000..7d419d3760 --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/go120.go @@ -0,0 +1,14 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build go1.20 +// +build go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + return context.WithCancelCause(parent) +} diff --git a/vendor/golang.org/x/sync/errgroup/pre_go120.go b/vendor/golang.org/x/sync/errgroup/pre_go120.go new file mode 100644 index 0000000000..1795c18ace --- /dev/null +++ b/vendor/golang.org/x/sync/errgroup/pre_go120.go @@ -0,0 +1,15 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !go1.20 +// +build !go1.20 + +package errgroup + +import "context" + +func withCancelCause(parent context.Context) (context.Context, func(error)) { + ctx, cancel := context.WithCancel(parent) + return ctx, func(error) { cancel() } +} diff --git a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go b/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go deleted file mode 100644 index e8789cb331..0000000000 --- a/vendor/google.golang.org/protobuf/types/known/fieldmaskpb/field_mask.pb.go +++ /dev/null @@ -1,588 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: google/protobuf/field_mask.proto - -// Package fieldmaskpb contains generated types for google/protobuf/field_mask.proto. -// -// The FieldMask message represents a set of symbolic field paths. -// The paths are specific to some target message type, -// which is not stored within the FieldMask message itself. -// -// # Constructing a FieldMask -// -// The New function is used construct a FieldMask: -// -// var messageType *descriptorpb.DescriptorProto -// fm, err := fieldmaskpb.New(messageType, "field.name", "field.number") -// if err != nil { -// ... // handle error -// } -// ... // make use of fm -// -// The "field.name" and "field.number" paths are valid paths according to the -// google.protobuf.DescriptorProto message. Use of a path that does not correlate -// to valid fields reachable from DescriptorProto would result in an error. -// -// Once a FieldMask message has been constructed, -// the Append method can be used to insert additional paths to the path set: -// -// var messageType *descriptorpb.DescriptorProto -// if err := fm.Append(messageType, "options"); err != nil { -// ... // handle error -// } -// -// # Type checking a FieldMask -// -// In order to verify that a FieldMask represents a set of fields that are -// reachable from some target message type, use the IsValid method: -// -// var messageType *descriptorpb.DescriptorProto -// if fm.IsValid(messageType) { -// ... // make use of fm -// } -// -// IsValid needs to be passed the target message type as an input since the -// FieldMask message itself does not store the message type that the set of paths -// are for. -package fieldmaskpb - -import ( - proto "google.golang.org/protobuf/proto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sort "sort" - strings "strings" - sync "sync" -) - -// `FieldMask` represents a set of symbolic field paths, for example: -// -// paths: "f.a" -// paths: "f.b.d" -// -// Here `f` represents a field in some root message, `a` and `b` -// fields in the message found in `f`, and `d` a field found in the -// message in `f.b`. -// -// Field masks are used to specify a subset of fields that should be -// returned by a get operation or modified by an update operation. -// Field masks also have a custom JSON encoding (see below). -// -// # Field Masks in Projections -// -// When used in the context of a projection, a response message or -// sub-message is filtered by the API to only contain those fields as -// specified in the mask. For example, if the mask in the previous -// example is applied to a response message as follows: -// -// f { -// a : 22 -// b { -// d : 1 -// x : 2 -// } -// y : 13 -// } -// z: 8 -// -// The result will not contain specific values for fields x,y and z -// (their value will be set to the default, and omitted in proto text -// output): -// -// f { -// a : 22 -// b { -// d : 1 -// } -// } -// -// A repeated field is not allowed except at the last position of a -// paths string. -// -// If a FieldMask object is not present in a get operation, the -// operation applies to all fields (as if a FieldMask of all fields -// had been specified). -// -// Note that a field mask does not necessarily apply to the -// top-level response message. In case of a REST get operation, the -// field mask applies directly to the response, but in case of a REST -// list operation, the mask instead applies to each individual message -// in the returned resource list. In case of a REST custom method, -// other definitions may be used. Where the mask applies will be -// clearly documented together with its declaration in the API. In -// any case, the effect on the returned resource/resources is required -// behavior for APIs. -// -// # Field Masks in Update Operations -// -// A field mask in update operations specifies which fields of the -// targeted resource are going to be updated. The API is required -// to only change the values of the fields as specified in the mask -// and leave the others untouched. If a resource is passed in to -// describe the updated values, the API ignores the values of all -// fields not covered by the mask. -// -// If a repeated field is specified for an update operation, new values will -// be appended to the existing repeated field in the target resource. Note that -// a repeated field is only allowed in the last position of a `paths` string. -// -// If a sub-message is specified in the last position of the field mask for an -// update operation, then new value will be merged into the existing sub-message -// in the target resource. -// -// For example, given the target message: -// -// f { -// b { -// d: 1 -// x: 2 -// } -// c: [1] -// } -// -// And an update message: -// -// f { -// b { -// d: 10 -// } -// c: [2] -// } -// -// then if the field mask is: -// -// paths: ["f.b", "f.c"] -// -// then the result will be: -// -// f { -// b { -// d: 10 -// x: 2 -// } -// c: [1, 2] -// } -// -// An implementation may provide options to override this default behavior for -// repeated and message fields. -// -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. -// -// ## Considerations for HTTP REST -// -// The HTTP kind of an update operation which uses a field mask must -// be set to PATCH instead of PUT in order to satisfy HTTP semantics -// (PUT must only be used for full updates). -// -// # JSON Encoding of Field Masks -// -// In JSON, a field mask is encoded as a single string where paths are -// separated by a comma. Fields name in each path are converted -// to/from lower-camel naming conventions. -// -// As an example, consider the following message declarations: -// -// message Profile { -// User user = 1; -// Photo photo = 2; -// } -// message User { -// string display_name = 1; -// string address = 2; -// } -// -// In proto a field mask for `Profile` may look as such: -// -// mask { -// paths: "user.display_name" -// paths: "photo" -// } -// -// In JSON, the same mask is represented as below: -// -// { -// mask: "user.displayName,photo" -// } -// -// # Field Masks and Oneof Fields -// -// Field masks treat fields in oneofs just as regular fields. Consider the -// following message: -// -// message SampleMessage { -// oneof test_oneof { -// string name = 4; -// SubMessage sub_message = 9; -// } -// } -// -// The field mask can be: -// -// mask { -// paths: "name" -// } -// -// Or: -// -// mask { -// paths: "sub_message" -// } -// -// Note that oneof type names ("test_oneof" in this case) cannot be used in -// paths. -// -// ## Field Mask Verification -// -// The implementation of any API method which has a FieldMask type field in the -// request should verify the included field paths, and return an -// `INVALID_ARGUMENT` error if any path is unmappable. -type FieldMask struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The set of field mask paths. - Paths []string `protobuf:"bytes,1,rep,name=paths,proto3" json:"paths,omitempty"` -} - -// New constructs a field mask from a list of paths and verifies that -// each one is valid according to the specified message type. -func New(m proto.Message, paths ...string) (*FieldMask, error) { - x := new(FieldMask) - return x, x.Append(m, paths...) -} - -// Union returns the union of all the paths in the input field masks. -func Union(mx *FieldMask, my *FieldMask, ms ...*FieldMask) *FieldMask { - var out []string - out = append(out, mx.GetPaths()...) - out = append(out, my.GetPaths()...) - for _, m := range ms { - out = append(out, m.GetPaths()...) - } - return &FieldMask{Paths: normalizePaths(out)} -} - -// Intersect returns the intersection of all the paths in the input field masks. -func Intersect(mx *FieldMask, my *FieldMask, ms ...*FieldMask) *FieldMask { - var ss1, ss2 []string // reused buffers for performance - intersect := func(out, in []string) []string { - ss1 = normalizePaths(append(ss1[:0], in...)) - ss2 = normalizePaths(append(ss2[:0], out...)) - out = out[:0] - for i1, i2 := 0, 0; i1 < len(ss1) && i2 < len(ss2); { - switch s1, s2 := ss1[i1], ss2[i2]; { - case hasPathPrefix(s1, s2): - out = append(out, s1) - i1++ - case hasPathPrefix(s2, s1): - out = append(out, s2) - i2++ - case lessPath(s1, s2): - i1++ - case lessPath(s2, s1): - i2++ - } - } - return out - } - - out := Union(mx, my, ms...).GetPaths() - out = intersect(out, mx.GetPaths()) - out = intersect(out, my.GetPaths()) - for _, m := range ms { - out = intersect(out, m.GetPaths()) - } - return &FieldMask{Paths: normalizePaths(out)} -} - -// IsValid reports whether all the paths are syntactically valid and -// refer to known fields in the specified message type. -// It reports false for a nil FieldMask. -func (x *FieldMask) IsValid(m proto.Message) bool { - paths := x.GetPaths() - return x != nil && numValidPaths(m, paths) == len(paths) -} - -// Append appends a list of paths to the mask and verifies that each one -// is valid according to the specified message type. -// An invalid path is not appended and breaks insertion of subsequent paths. -func (x *FieldMask) Append(m proto.Message, paths ...string) error { - numValid := numValidPaths(m, paths) - x.Paths = append(x.Paths, paths[:numValid]...) - paths = paths[numValid:] - if len(paths) > 0 { - name := m.ProtoReflect().Descriptor().FullName() - return protoimpl.X.NewError("invalid path %q for message %q", paths[0], name) - } - return nil -} - -func numValidPaths(m proto.Message, paths []string) int { - md0 := m.ProtoReflect().Descriptor() - for i, path := range paths { - md := md0 - if !rangeFields(path, func(field string) bool { - // Search the field within the message. - if md == nil { - return false // not within a message - } - fd := md.Fields().ByName(protoreflect.Name(field)) - // The real field name of a group is the message name. - if fd == nil { - gd := md.Fields().ByName(protoreflect.Name(strings.ToLower(field))) - if gd != nil && gd.Kind() == protoreflect.GroupKind && string(gd.Message().Name()) == field { - fd = gd - } - } else if fd.Kind() == protoreflect.GroupKind && string(fd.Message().Name()) != field { - fd = nil - } - if fd == nil { - return false // message has does not have this field - } - - // Identify the next message to search within. - md = fd.Message() // may be nil - - // Repeated fields are only allowed at the last position. - if fd.IsList() || fd.IsMap() { - md = nil - } - - return true - }) { - return i - } - } - return len(paths) -} - -// Normalize converts the mask to its canonical form where all paths are sorted -// and redundant paths are removed. -func (x *FieldMask) Normalize() { - x.Paths = normalizePaths(x.Paths) -} - -func normalizePaths(paths []string) []string { - sort.Slice(paths, func(i, j int) bool { - return lessPath(paths[i], paths[j]) - }) - - // Elide any path that is a prefix match on the previous. - out := paths[:0] - for _, path := range paths { - if len(out) > 0 && hasPathPrefix(path, out[len(out)-1]) { - continue - } - out = append(out, path) - } - return out -} - -// hasPathPrefix is like strings.HasPrefix, but further checks for either -// an exact matche or that the prefix is delimited by a dot. -func hasPathPrefix(path, prefix string) bool { - return strings.HasPrefix(path, prefix) && (len(path) == len(prefix) || path[len(prefix)] == '.') -} - -// lessPath is a lexicographical comparison where dot is specially treated -// as the smallest symbol. -func lessPath(x, y string) bool { - for i := 0; i < len(x) && i < len(y); i++ { - if x[i] != y[i] { - return (x[i] - '.') < (y[i] - '.') - } - } - return len(x) < len(y) -} - -// rangeFields is like strings.Split(path, "."), but avoids allocations by -// iterating over each field in place and calling a iterator function. -func rangeFields(path string, f func(field string) bool) bool { - for { - var field string - if i := strings.IndexByte(path, '.'); i >= 0 { - field, path = path[:i], path[i:] - } else { - field, path = path, "" - } - - if !f(field) { - return false - } - - if len(path) == 0 { - return true - } - path = strings.TrimPrefix(path, ".") - } -} - -func (x *FieldMask) Reset() { - *x = FieldMask{} - if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_field_mask_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *FieldMask) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*FieldMask) ProtoMessage() {} - -func (x *FieldMask) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_field_mask_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use FieldMask.ProtoReflect.Descriptor instead. -func (*FieldMask) Descriptor() ([]byte, []int) { - return file_google_protobuf_field_mask_proto_rawDescGZIP(), []int{0} -} - -func (x *FieldMask) GetPaths() []string { - if x != nil { - return x.Paths - } - return nil -} - -var File_google_protobuf_field_mask_proto protoreflect.FileDescriptor - -var file_google_protobuf_field_mask_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x22, 0x21, 0x0a, 0x09, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, - 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x05, 0x70, 0x61, 0x74, 0x68, 0x73, 0x42, 0x85, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x32, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, - 0x6f, 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2f, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x6d, 0x61, - 0x73, 0x6b, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1e, - 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x57, 0x65, 0x6c, 0x6c, 0x4b, 0x6e, 0x6f, 0x77, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_google_protobuf_field_mask_proto_rawDescOnce sync.Once - file_google_protobuf_field_mask_proto_rawDescData = file_google_protobuf_field_mask_proto_rawDesc -) - -func file_google_protobuf_field_mask_proto_rawDescGZIP() []byte { - file_google_protobuf_field_mask_proto_rawDescOnce.Do(func() { - file_google_protobuf_field_mask_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_protobuf_field_mask_proto_rawDescData) - }) - return file_google_protobuf_field_mask_proto_rawDescData -} - -var file_google_protobuf_field_mask_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_google_protobuf_field_mask_proto_goTypes = []interface{}{ - (*FieldMask)(nil), // 0: google.protobuf.FieldMask -} -var file_google_protobuf_field_mask_proto_depIdxs = []int32{ - 0, // [0:0] is the sub-list for method output_type - 0, // [0:0] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_google_protobuf_field_mask_proto_init() } -func file_google_protobuf_field_mask_proto_init() { - if File_google_protobuf_field_mask_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_google_protobuf_field_mask_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FieldMask); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_google_protobuf_field_mask_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_google_protobuf_field_mask_proto_goTypes, - DependencyIndexes: file_google_protobuf_field_mask_proto_depIdxs, - MessageInfos: file_google_protobuf_field_mask_proto_msgTypes, - }.Build() - File_google_protobuf_field_mask_proto = out.File - file_google_protobuf_field_mask_proto_rawDesc = nil - file_google_protobuf_field_mask_proto_goTypes = nil - file_google_protobuf_field_mask_proto_depIdxs = nil -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 9049acad5e..f14f642a09 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,3 +1,6 @@ +# dario.cat/mergo v1.0.0 +## explicit; go 1.13 +dario.cat/mergo # github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 ## explicit; go 1.16 # github.com/BurntSushi/toml v1.3.2 @@ -66,7 +69,7 @@ github.com/containers/common/pkg/flag github.com/containers/common/pkg/report github.com/containers/common/pkg/report/camelcase github.com/containers/common/pkg/retry -# github.com/containers/image/v5 v5.25.1-0.20230530235238-e14c1c5f94d0 +# github.com/containers/image/v5 v5.26.0 ## explicit; go 1.18 github.com/containers/image/v5/copy github.com/containers/image/v5/directory @@ -208,7 +211,7 @@ github.com/containers/storage/types # github.com/coreos/go-oidc/v3 v3.6.0 ## explicit; go 1.19 github.com/coreos/go-oidc/v3/oidc -# github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 +# github.com/cyberphone/json-canonicalization v0.0.0-20230514072755-504adb8a8af1 ## explicit github.com/cyberphone/json-canonicalization/go/src/webpki.org/jsoncanonicalizer # github.com/cyphar/filepath-securejoin v0.2.3 @@ -309,7 +312,7 @@ github.com/go-openapi/spec # github.com/go-openapi/strfmt v0.21.7 ## explicit; go 1.19 github.com/go-openapi/strfmt -# github.com/go-openapi/swag v0.22.3 +# github.com/go-openapi/swag v0.22.4 ## explicit; go 1.18 github.com/go-openapi/swag # github.com/go-openapi/validate v0.22.1 @@ -337,11 +340,8 @@ github.com/google/go-containerregistry/pkg/name # github.com/google/go-intervals v0.0.2 ## explicit; go 1.12 github.com/google/go-intervals/intervalset -# github.com/google/trillian v1.5.2 -## explicit; go 1.19 -github.com/google/trillian -github.com/google/trillian/types -github.com/google/trillian/types/internal/tls +# github.com/google/pprof v0.0.0-20221103000818-d260c55eee4c +## explicit; go 1.18 # github.com/google/uuid v1.3.0 ## explicit github.com/google/uuid @@ -357,12 +357,9 @@ github.com/hashicorp/go-cleanhttp # github.com/hashicorp/go-multierror v1.1.1 ## explicit; go 1.13 github.com/hashicorp/go-multierror -# github.com/hashicorp/go-retryablehttp v0.7.2 +# github.com/hashicorp/go-retryablehttp v0.7.4 ## explicit; go 1.13 github.com/hashicorp/go-retryablehttp -# github.com/imdario/mergo v0.3.16 -## explicit; go 1.13 -github.com/imdario/mergo # github.com/inconshreveable/mousetrap v1.1.0 ## explicit; go 1.18 github.com/inconshreveable/mousetrap @@ -478,7 +475,7 @@ github.com/segmentio/ksuid ## explicit; go 1.20 github.com/sigstore/fulcio/pkg/api github.com/sigstore/fulcio/pkg/certificate -# github.com/sigstore/rekor v1.2.2-0.20230529154427-55a5a338d149 +# github.com/sigstore/rekor v1.2.2-0.20230601122533-4c81ff246d12 ## explicit; go 1.19 github.com/sigstore/rekor/pkg/client github.com/sigstore/rekor/pkg/generated/client @@ -488,8 +485,8 @@ github.com/sigstore/rekor/pkg/generated/client/pubkey github.com/sigstore/rekor/pkg/generated/client/tlog github.com/sigstore/rekor/pkg/generated/models github.com/sigstore/rekor/pkg/util -# github.com/sigstore/sigstore v1.6.5 -## explicit; go 1.18 +# github.com/sigstore/sigstore v1.7.1 +## explicit; go 1.19 github.com/sigstore/sigstore/pkg/cryptoutils github.com/sigstore/sigstore/pkg/oauth github.com/sigstore/sigstore/pkg/oauthflow @@ -516,7 +513,7 @@ github.com/stefanberger/go-pkcs11uri github.com/stretchr/testify/assert github.com/stretchr/testify/require github.com/stretchr/testify/suite -# github.com/sylabs/sif/v2 v2.11.4 +# github.com/sylabs/sif/v2 v2.11.5 ## explicit; go 1.19 github.com/sylabs/sif/v2/pkg/sif # github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 @@ -595,7 +592,7 @@ go.opentelemetry.io/otel/semconv/v1.12.0 # go.opentelemetry.io/otel/trace v1.15.0 ## explicit; go 1.19 go.opentelemetry.io/otel/trace -# golang.org/x/crypto v0.9.0 +# golang.org/x/crypto v0.10.0 ## explicit; go 1.17 golang.org/x/crypto/cast5 golang.org/x/crypto/ed25519 @@ -622,7 +619,7 @@ golang.org/x/exp/slices ## explicit; go 1.17 golang.org/x/mod/semver golang.org/x/mod/sumdb/note -# golang.org/x/net v0.10.0 +# golang.org/x/net v0.11.0 ## explicit; go 1.17 golang.org/x/net/context golang.org/x/net/http/httpguts @@ -633,12 +630,12 @@ golang.org/x/net/internal/socks golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/trace -# golang.org/x/oauth2 v0.8.0 +# golang.org/x/oauth2 v0.9.0 ## explicit; go 1.17 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.2.0 -## explicit +# golang.org/x/sync v0.3.0 +## explicit; go 1.17 golang.org/x/sync/errgroup golang.org/x/sync/semaphore # golang.org/x/sys v0.9.0 @@ -652,7 +649,7 @@ golang.org/x/sys/windows # golang.org/x/term v0.9.0 ## explicit; go 1.17 golang.org/x/term -# golang.org/x/text v0.9.0 +# golang.org/x/text v0.10.0 ## explicit; go 1.17 golang.org/x/text/secure/bidirule golang.org/x/text/transform @@ -771,7 +768,6 @@ google.golang.org/protobuf/runtime/protoimpl google.golang.org/protobuf/types/descriptorpb google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb -google.golang.org/protobuf/types/known/fieldmaskpb google.golang.org/protobuf/types/known/timestamppb # gopkg.in/go-jose/go-jose.v2 v2.6.1 ## explicit