From 43c9590c88de69924900ce4735995b750f80c20c Mon Sep 17 00:00:00 2001 From: Eugene Zagidullin Date: Mon, 4 Dec 2023 20:41:24 +0200 Subject: [PATCH 1/5] deps versions bump --- go.mod | 54 +++++++++++++++++++++++++++--------------------------- go.sum | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 27 deletions(-) diff --git a/go.mod b/go.mod index c87c525b..2dc44e62 100644 --- a/go.mod +++ b/go.mod @@ -3,48 +3,48 @@ module github.com/ecadlabs/signatory go 1.21 require ( - cloud.google.com/go/kms v1.15.3 + cloud.google.com/go/kms v1.15.5 github.com/certusone/yubihsm-go v0.3.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/ecadlabs/goblst v1.0.0 github.com/ecadlabs/gotez v1.0.0 - github.com/go-playground/validator/v10 v10.15.5 + github.com/go-playground/validator/v10 v10.16.0 github.com/google/tink/go v1.7.0 - github.com/google/uuid v1.3.1 - github.com/gorilla/mux v1.8.0 + github.com/google/uuid v1.4.0 + github.com/gorilla/mux v1.8.1 github.com/hashicorp/vault/api v1.10.0 github.com/hashicorp/vault/api/auth/approle v0.5.0 github.com/karalabe/hid v1.0.0 github.com/prometheus/client_golang v1.17.0 github.com/segmentio/ksuid v1.0.4 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 - golang.org/x/crypto v0.14.0 - golang.org/x/exp v0.0.0-20230420155640-133eef4313cb - golang.org/x/oauth2 v0.13.0 - google.golang.org/api v0.148.0 + golang.org/x/crypto v0.16.0 + golang.org/x/exp v0.0.0-20231127185646-65229373498e + golang.org/x/oauth2 v0.15.0 + google.golang.org/api v0.152.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - cloud.google.com/go/compute v1.23.1 // indirect + cloud.google.com/go/compute v1.23.3 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.3 // indirect + cloud.google.com/go/iam v1.1.5 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/go-jose/go-jose/v3 v3.0.0 // indirect + github.com/go-jose/go-jose/v3 v3.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.1 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.2 // 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.4 // indirect + github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect + github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.5 // indirect + github.com/hashicorp/go-sockaddr v1.0.6 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kr/text v0.2.0 // indirect @@ -52,22 +52,22 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect - golang.org/x/sync v0.4.0 // indirect - golang.org/x/time v0.3.0 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 // indirect ) require ( - github.com/aws/aws-sdk-go v1.45.28 + github.com/aws/aws-sdk-go v1.48.11 github.com/beorn7/perks v1.0.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible - github.com/golang-jwt/jwt/v5 v5.0.0 + github.com/golang-jwt/jwt/v5 v5.2.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-cmp v0.6.0 // indirect @@ -81,10 +81,10 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/term v0.13.0 - golang.org/x/text v0.13.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 + golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect diff --git a/go.sum b/go.sum index 26d5f4a0..044c5357 100644 --- a/go.sum +++ b/go.sum @@ -6,16 +6,22 @@ cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopT cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= +cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= +cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= +cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/kms v1.15.1 h1:HUC3fAoepH3RpcQXiJhXWWYizjQ5r7YjI7SO9ZbHf9s= cloud.google.com/go/kms v1.15.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= cloud.google.com/go/kms v1.15.3 h1:RYsbxTRmk91ydKCzekI2YjryO4c5Y2M80Zwcs9/D/cI= cloud.google.com/go/kms v1.15.3/go.mod h1:AJdXqHxS2GlPyduM99s9iGqi2nwbviBbhV/hdmt4iOQ= +cloud.google.com/go/kms v1.15.5 h1:pj1sRfut2eRbD9pFRjNnPNg/CzJPuQAzUujMIM1vVeM= +cloud.google.com/go/kms v1.15.5/go.mod h1:cU2H5jnp6G2TDpUGZyqTCoy1n16fbubHZjmVXSMtwDI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= @@ -23,6 +29,8 @@ github.com/aws/aws-sdk-go v1.44.328 h1:WBwlf8ym9SDQ/GTIBO9eXyvwappKJyOetWJKl4mT7 github.com/aws/aws-sdk-go v1.44.328/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.45.28 h1:p2ATcaK6ffSw4yZ2UAGzgRyRXwKyOJY6ZCiKqj5miJE= github.com/aws/aws-sdk-go v1.45.28/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= +github.com/aws/aws-sdk-go v1.48.11 h1:9YbiSbaF/jWi+qLRl+J5dEhr2mcbDYHmKg2V7RBcD5M= +github.com/aws/aws-sdk-go v1.48.11/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -44,6 +52,7 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -71,6 +80,8 @@ github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcP github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= +github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= +github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -81,12 +92,16 @@ github.com/go-playground/validator/v10 v10.15.1 h1:BSe8uhN+xQ4r5guV/ywQI4gO59C2r github.com/go-playground/validator/v10 v10.15.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= +github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= +github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -129,14 +144,20 @@ github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcg github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= +github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= +github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= @@ -154,12 +175,16 @@ github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= 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/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 h1:iBt4Ew4XEGLfh6/bPk4rSYmuZJGizr6/x/AEizP0CQc= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8/go.mod h1:aiJI+PIApBRQG7FZTEBx5GiiX+HbOHilUdNxUZi4eV0= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= @@ -167,6 +192,8 @@ github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0S github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= github.com/hashicorp/go-sockaddr v1.0.5 h1:dvk7TIXCZpmfOlM+9mlcrWmWjw/wlKT+VDq2wMvfPJU= github.com/hashicorp/go-sockaddr v1.0.5/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= +github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEyqO4u9I= +github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/vault/api v1.9.2 h1:YjkZLJ7K3inKgMZ0wzCU9OHqc+UqMQyXsPXnf3Cl2as= @@ -245,6 +272,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -275,9 +304,13 @@ golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230420155640-133eef4313cb h1:rhjz/8Mbfa8xROFiH+MQphmAmgqRM0bOMnytznhWEXk= golang.org/x/exp v0.0.0-20230420155640-133eef4313cb/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= +golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -302,12 +335,16 @@ golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -317,6 +354,8 @@ 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/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -339,6 +378,8 @@ golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -347,6 +388,8 @@ golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -359,10 +402,14 @@ golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= 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= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -377,6 +424,8 @@ google.golang.org/api v0.138.0 h1:K/tVp05MxNVbHShRw9m7e9VJGdagNeTdMzqPH7AUqr0= google.golang.org/api v0.138.0/go.mod h1:4xyob8CxC+0GChNBvEUAk8VBKNvYOTWM9T3v3UfRxuY= google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs= google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU= +google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY= +google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= @@ -391,14 +440,20 @@ google.golang.org/genproto v0.0.0-20230807174057-1744710a1577 h1:Tyk/35yqszRCvar google.golang.org/genproto v0.0.0-20230807174057-1744710a1577/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= +google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 h1:W12Pwm4urIbRdGhMEg2NM9O3TWKjNcxQhs46V0ypf/k= +google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= google.golang.org/genproto/googleapis/api v0.0.0-20230807174057-1744710a1577 h1:xv8KoglAClYGkprUSmDTKaILtzfD8XzG9NYVXMprjKo= google.golang.org/genproto/googleapis/api v0.0.0-20230807174057-1744710a1577/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= +google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= +google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk= google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= From 6c9fdc5d28314b22c377b845d22d43774e7e8c50 Mon Sep 17 00:00:00 2001 From: Eugene Zagidullin Date: Tue, 23 Jan 2024 22:02:28 +0200 Subject: [PATCH 2/5] gotez updated to v2.0 --- cmd/approve-list-svc/config.go | 8 +- cmd/approve-list-svc/server/server.go | 2 +- cmd/approve-list-svc/server/server_test.go | 2 +- cmd/commands/list_ops.go | 22 +- cmd/signatory-tools/authenticate.go | 4 +- cmd/signatory-tools/genkey.go | 2 +- go.mod | 14 +- go.sum | 186 ++------------ pkg/auth/auth.go | 4 +- pkg/auth/static.go | 4 +- pkg/config/config.go | 2 +- pkg/config/config_test.go | 4 +- pkg/crypt/bls.go | 109 -------- pkg/crypt/common.go | 277 --------------------- pkg/crypt/crypt_test.go | 161 ------------ pkg/crypt/ecdsa.go | 247 ------------------ pkg/crypt/ed25519.go | 119 --------- pkg/cryptoutils/pkcs.go | 2 +- pkg/cryptoutils/pkcs_test.go | 2 +- pkg/hashmap/hashmap.go | 2 +- pkg/hashmap/hashmap_test.go | 4 +- pkg/server/server.go | 4 +- pkg/server/server_test.go | 4 +- pkg/signatory/import.go | 4 +- pkg/signatory/policy_hook_test.go | 2 +- pkg/signatory/request/request.go | 69 +---- pkg/signatory/request/request_test.go | 80 +++--- pkg/signatory/request/watermark_test.go | 6 +- pkg/signatory/signatory.go | 37 ++- pkg/signatory/signatory_test.go | 2 +- pkg/signatory/utils.go | 8 +- pkg/signatory/utils_test.go | 2 +- pkg/signatory/watermark.go | 8 +- pkg/signatory/watermark_file.go | 9 +- pkg/signatory/watermark_mem.go | 13 +- pkg/signatory/watermark_migration.go | 4 +- pkg/signatory/watermark_test.go | 10 +- pkg/vault/aws/awskms.go | 2 +- pkg/vault/azure/azure.go | 2 +- pkg/vault/cloudkms/cloudkms.go | 2 +- pkg/vault/hashicorp/vault.go | 2 +- pkg/vault/ledger/mnemonic/mnemonic_test.go | 4 +- pkg/vault/ledger/scan.go | 2 +- pkg/vault/ledger/tezosapp/tezosapp.go | 2 +- pkg/vault/ledger/tools.go | 4 +- pkg/vault/ledger/vault.go | 2 +- pkg/vault/memory/vault.go | 4 +- pkg/vault/vault.go | 2 +- pkg/vault/yubi/yubi.go | 2 +- test/auth_test.go | 2 +- 50 files changed, 187 insertions(+), 1284 deletions(-) delete mode 100644 pkg/crypt/bls.go delete mode 100644 pkg/crypt/common.go delete mode 100644 pkg/crypt/crypt_test.go delete mode 100644 pkg/crypt/ecdsa.go delete mode 100644 pkg/crypt/ed25519.go diff --git a/cmd/approve-list-svc/config.go b/cmd/approve-list-svc/config.go index f9475e72..d0ea9689 100644 --- a/cmd/approve-list-svc/config.go +++ b/cmd/approve-list-svc/config.go @@ -4,10 +4,10 @@ import ( "encoding/pem" "errors" "fmt" - "io/ioutil" "net" + "os" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/cryptoutils" yaml "gopkg.in/yaml.v3" ) @@ -51,7 +51,7 @@ func (conf *Config) GetPrivateKey() (crypt.PrivateKey, error) { return nil, nil } var err error - if keyData, err = ioutil.ReadFile(conf.PrivateKeyFile); err != nil { + if keyData, err = os.ReadFile(conf.PrivateKeyFile); err != nil { return nil, err } } @@ -64,7 +64,7 @@ func (conf *Config) GetPrivateKey() (crypt.PrivateKey, error) { } func ReadConfig(file string) (*Config, error) { - yamlFile, err := ioutil.ReadFile(file) + yamlFile, err := os.ReadFile(file) if err != nil { return nil, err } diff --git a/cmd/approve-list-svc/server/server.go b/cmd/approve-list-svc/server/server.go index a69077cc..f9cc3a4b 100644 --- a/cmd/approve-list-svc/server/server.go +++ b/cmd/approve-list-svc/server/server.go @@ -6,7 +6,7 @@ import ( "net" "net/http" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/signatory" ) diff --git a/cmd/approve-list-svc/server/server_test.go b/cmd/approve-list-svc/server/server_test.go index fbceda3c..5c0b8726 100644 --- a/cmd/approve-list-svc/server/server_test.go +++ b/cmd/approve-list-svc/server/server_test.go @@ -9,10 +9,10 @@ import ( "net/http/httptest" "testing" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/cmd/approve-list-svc/server" "github.com/ecadlabs/signatory/pkg/auth" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/cmd/commands/list_ops.go b/cmd/commands/list_ops.go index 2895782f..ec2d28c4 100644 --- a/cmd/commands/list_ops.go +++ b/cmd/commands/list_ops.go @@ -5,9 +5,9 @@ import ( "sort" "text/template" - "github.com/ecadlabs/gotez/encoding" - "github.com/ecadlabs/gotez/protocol" - "github.com/ecadlabs/signatory/pkg/signatory/request" + "github.com/ecadlabs/gotez/v2/encoding" + "github.com/ecadlabs/gotez/v2/protocol" + "github.com/ecadlabs/gotez/v2/protocol/latest" "github.com/spf13/cobra" ) @@ -33,13 +33,9 @@ func NewListRequests(c *Context) *cobra.Command { Use: "list-requests", Short: "Print possible request types", RunE: func(cmd *cobra.Command, args []string) error { - kindsMap := make(map[string]struct{}) - encoding.ForEachInEnum(func(tag uint8, req request.SignRequest) { - kindsMap[req.RequestKind()] = struct{}{} - }) var kinds []string - for k := range kindsMap { - kinds = append(kinds, k) + for _, k := range encoding.ListVariants[protocol.SignRequest]() { + kinds = append(kinds, k.SignRequestKind()) } sort.Strings(kinds) return listReqTpl.Execute(os.Stdout, kinds) @@ -54,13 +50,9 @@ func NewListOps(c *Context) *cobra.Command { Use: "list-ops", Short: "Print possible operation types inside the `generic` request", RunE: func(cmd *cobra.Command, args []string) error { - opsMap := make(map[string]struct{}) - encoding.ForEachInEnum(func(tag uint8, req protocol.OperationContents) { - opsMap[req.OperationKind()] = struct{}{} - }) var ops []string - for k := range opsMap { - ops = append(ops, k) + for _, k := range encoding.ListVariants[latest.OperationContents]() { + ops = append(ops, k.OperationKind()) } sort.Strings(ops) return listOpsTpl.Execute(os.Stdout, ops) diff --git a/cmd/signatory-tools/authenticate.go b/cmd/signatory-tools/authenticate.go index 24c2ca31..57518882 100644 --- a/cmd/signatory-tools/authenticate.go +++ b/cmd/signatory-tools/authenticate.go @@ -4,8 +4,8 @@ import ( "encoding/hex" "fmt" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/signatory" "github.com/spf13/cobra" ) diff --git a/cmd/signatory-tools/genkey.go b/cmd/signatory-tools/genkey.go index de62cadc..2c81d25f 100644 --- a/cmd/signatory-tools/genkey.go +++ b/cmd/signatory-tools/genkey.go @@ -11,7 +11,7 @@ import ( "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/ecadlabs/goblst/minpk" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 2dc44e62..a023702c 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/certusone/yubihsm-go v0.3.0 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/ecadlabs/goblst v1.0.0 - github.com/ecadlabs/gotez v1.0.0 + github.com/ecadlabs/gotez/v2 v2.0.1 github.com/go-playground/validator/v10 v10.16.0 github.com/google/tink/go v1.7.0 github.com/google/uuid v1.4.0 @@ -20,7 +20,7 @@ require ( github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 - golang.org/x/crypto v0.16.0 + golang.org/x/crypto v0.18.0 golang.org/x/exp v0.0.0-20231127185646-65229373498e golang.org/x/oauth2 v0.15.0 google.golang.org/api v0.152.0 @@ -33,6 +33,7 @@ require ( cloud.google.com/go/iam v1.1.5 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/ecadlabs/pretty v0.0.0-20230412124801-f948fc689a04 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-jose/go-jose/v3 v3.0.1 // indirect github.com/google/s2a-go v0.1.7 // indirect @@ -51,6 +52,7 @@ require ( github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/ryanuber/go-glob v1.0.0 // indirect golang.org/x/sync v0.5.0 // indirect golang.org/x/time v0.5.0 // indirect @@ -70,11 +72,9 @@ require ( github.com/golang-jwt/jwt/v5 v5.2.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/go-cmp v0.6.0 // indirect github.com/googleapis/gax-go/v2 v2.12.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/leodido/go-urn v1.2.4 // indirect - github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect @@ -82,10 +82,12 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.opencensus.io v0.24.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/grpc v1.59.0 // indirect google.golang.org/protobuf v1.31.0 // indirect ) + +// replace github.com/ecadlabs/gotez/v2 => ../gotez diff --git a/go.sum b/go.sum index 044c5357..38859162 100644 --- a/go.sum +++ b/go.sum @@ -1,57 +1,31 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.110.7 h1:rJyC7nWRg2jWGZ4wSJ5nY65GTdYJkg0cd/uXb+ACI6o= -cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= -cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute v1.23.1 h1:V97tBoDaZHb6leicZ1G6DLK2BAaZLJ/7+9BB/En3hR0= -cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= +cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y= +cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic= cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk= cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.2 h1:gacbrBdWcoVmGLozRuStX45YKvJtzIjJdAolzUs1sm4= -cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= -cloud.google.com/go/iam v1.1.3 h1:18tKG7DzydKWUnLjonWcJO6wjSCAtzh4GcRKlH/Hrzc= -cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= -cloud.google.com/go/kms v1.15.1 h1:HUC3fAoepH3RpcQXiJhXWWYizjQ5r7YjI7SO9ZbHf9s= -cloud.google.com/go/kms v1.15.1/go.mod h1:c9J991h5DTl+kg7gi3MYomh12YEENGrf48ee/N/2CDM= -cloud.google.com/go/kms v1.15.3 h1:RYsbxTRmk91ydKCzekI2YjryO4c5Y2M80Zwcs9/D/cI= -cloud.google.com/go/kms v1.15.3/go.mod h1:AJdXqHxS2GlPyduM99s9iGqi2nwbviBbhV/hdmt4iOQ= cloud.google.com/go/kms v1.15.5 h1:pj1sRfut2eRbD9pFRjNnPNg/CzJPuQAzUujMIM1vVeM= cloud.google.com/go/kms v1.15.5/go.mod h1:cU2H5jnp6G2TDpUGZyqTCoy1n16fbubHZjmVXSMtwDI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.44.328 h1:WBwlf8ym9SDQ/GTIBO9eXyvwappKJyOetWJKl4mT7ZU= -github.com/aws/aws-sdk-go v1.44.328/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= -github.com/aws/aws-sdk-go v1.45.28 h1:p2ATcaK6ffSw4yZ2UAGzgRyRXwKyOJY6ZCiKqj5miJE= -github.com/aws/aws-sdk-go v1.45.28/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go v1.48.11 h1:9YbiSbaF/jWi+qLRl+J5dEhr2mcbDYHmKg2V7RBcD5M= github.com/aws/aws-sdk-go v1.48.11/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/certusone/yubihsm-go v0.3.0 h1:mB1m5ZDSqX88xR2Kwq25vGOQKa4SV/polPTRpIr6/6Q= github.com/certusone/yubihsm-go v0.3.0/go.mod h1:4TofNVV4saOz2gjxT0xJ1Bt7KuSgMRN5Frhw/OpAb94= -github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -61,24 +35,20 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/ecadlabs/goblst v1.0.0 h1:8/e3SQGwqbV0+ul+pg0aSNFfC3lgQcvEed3VdDBXSl8= github.com/ecadlabs/goblst v1.0.0/go.mod h1:s67gqaOol9o6fguh+evH75X5uQniOhv1HG/EU8xPLPY= -github.com/ecadlabs/gotez v1.0.0 h1:/+xAO6ZbwnENGs1IE4+raZk6Suy2E8SRJb6VD1b0+34= -github.com/ecadlabs/gotez v1.0.0/go.mod h1:M0wxvBFDo+xzUvwkdYt2ntEbu2IejGTz8F0XuEgaNEU= +github.com/ecadlabs/gotez/v2 v2.0.1 h1:wlVciaznehImI+eCgV5Vq7k1W8UTh9avFa0wP3apSUo= +github.com/ecadlabs/gotez/v2 v2.0.1/go.mod h1:QypK0m1eDPmB9R7Uvgmsfm+JS7Z5Y6dIbIq1tMVYayU= +github.com/ecadlabs/pretty v0.0.0-20230412124801-f948fc689a04 h1:7WdblGykGxtGGtchW4kzTaJJO8Fm+JKhLzhttOOWr9k= +github.com/ecadlabs/pretty v0.0.0-20230412124801-f948fc689a04/go.mod h1:VApUlocsLMpp4hUXHxTTIlosebnwo0BM6e1hy78qTPM= github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815 h1:D22EM5TeYZJp43hGDx6dUng8mvtyYbB9BnE3+BmJR1Q= github.com/enceve/crypto v0.0.0-20160707101852-34d48bb93815/go.mod h1:wYFFK4LYXbX7j+76mOq7aiC/EAw2S22CrzPHqgsisPw= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= -github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= -github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= @@ -88,18 +58,12 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= -github.com/go-playground/validator/v10 v10.15.1 h1:BSe8uhN+xQ4r5guV/ywQI4gO59C2raYcGffYWZEjZzM= -github.com/go-playground/validator/v10 v10.15.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw= github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -108,16 +72,13 @@ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -131,34 +92,21 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/s2a-go v0.1.5 h1:8IYp3w9nysqv3JH+NJgXJzGbDHzLOTj43BmSkp+O7qg= -github.com/google/s2a-go v0.1.5/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/tink/go v1.7.0 h1:6Eox8zONGebBFcCBqkVmt60LaWZa6xg1cl/DwAh/J1w= github.com/google/tink/go v1.7.0/go.mod h1:GAUOd+QE3pgj9q8VKIGTCP33c/B7eb4NhxLcgTJZStM= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.1 h1:KjJaJ9iWZ3jOFZIf1Lqf4laDRCasjl0BCmnEGxkdLb4= -github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.5 h1:UR4rDjcgpgEnqpIEvkiqTYKBCKLNmlge2eVjoZfySzM= -github.com/googleapis/enterprise-certificate-proxy v0.2.5/go.mod h1:RxW0N9901Cko1VOCW3SXCpWP+mlIEkk2tP7jnHy9a3w= -github.com/googleapis/enterprise-certificate-proxy v0.3.1 h1:SBWmZhjUDRorQxrN0nwzf+AHBxnbFjViHQS4P0yVpmQ= -github.com/googleapis/enterprise-certificate-proxy v0.3.1/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas= github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -171,37 +119,24 @@ github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= 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.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM= github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -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/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 h1:om4Al8Oy7kCm/B86rLCLah4Dt5Aa0Fr5rYBG60OzwHQ= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 h1:iBt4Ew4XEGLfh6/bPk4rSYmuZJGizr6/x/AEizP0CQc= github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8/go.mod h1:aiJI+PIApBRQG7FZTEBx5GiiX+HbOHilUdNxUZi4eV0= github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-sockaddr v1.0.5 h1:dvk7TIXCZpmfOlM+9mlcrWmWjw/wlKT+VDq2wMvfPJU= -github.com/hashicorp/go-sockaddr v1.0.5/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEyqO4u9I= github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.9.2 h1:YjkZLJ7K3inKgMZ0wzCU9OHqc+UqMQyXsPXnf3Cl2as= -github.com/hashicorp/vault/api v1.9.2/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= -github.com/hashicorp/vault/api/auth/approle v0.4.1 h1:NElpX7DZ2uaLGwY+leWXHUqw9tepsYkcHvIowgIZteI= -github.com/hashicorp/vault/api/auth/approle v0.4.1/go.mod h1:rlI2VbmuHkptRun7DngpxOSvRC+JuITqAs/Z09pUucU= github.com/hashicorp/vault/api/auth/approle v0.5.0 h1:a1TK6VGwYqSAfkmX4y4dJ4WBxMU5dStIZqScW4EPXR8= github.com/hashicorp/vault/api/auth/approle v0.5.0/go.mod h1:CHOQIA1AZACfjTzHggmyfiOZ+xCSKNRFqe48FTCzH0k= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= @@ -227,8 +162,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= -github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvlsiIGKtc+UG6U5vzxaoagmhXfyg= github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= @@ -238,30 +171,22 @@ github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUb github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= -github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.4.0 h1:5lQXD3cAg1OXBf4Wq03gTrXHeaV0TQvGfUooCfx1yqY= -github.com/prometheus/client_model v0.4.0/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.44.0 h1:+5BrQJwiBB9xsMygAB3TNvpQKOwlkc25LbISbrdOOfY= -github.com/prometheus/common v0.44.0/go.mod h1:ofAIvZbQ1e/nugmZGz4/qCb9Ap1VoSTIO7x0VV9VvuY= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= @@ -270,8 +195,6 @@ github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c github.com/segmentio/ksuid v1.0.4/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -280,7 +203,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -292,23 +214,15 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20230420155640-133eef4313cb h1:rhjz/8Mbfa8xROFiH+MQphmAmgqRM0bOMnytznhWEXk= -golang.org/x/exp v0.0.0-20230420155640-133eef4313cb/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No= golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -317,43 +231,24 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.11.0 h1:vPL4xzxBM4niKCW6g9whtaWVXTJf1U5e4aZxxFx/gbU= -golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= 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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/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/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -364,50 +259,28 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= -golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/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.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 h1:NusfzzA6yGQ+ua51ck7E3omNUX/JuqbFSaRGqU8CcLI= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -419,51 +292,26 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.138.0 h1:K/tVp05MxNVbHShRw9m7e9VJGdagNeTdMzqPH7AUqr0= -google.golang.org/api v0.138.0/go.mod h1:4xyob8CxC+0GChNBvEUAk8VBKNvYOTWM9T3v3UfRxuY= -google.golang.org/api v0.148.0 h1:HBq4TZlN4/1pNcu0geJZ/Q50vIwIXT532UIMYoo0vOs= -google.golang.org/api v0.148.0/go.mod h1:8/TBgwaKjfqTdacOJrOv2+2Q6fBDU1uHKK06oGSkxzU= google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY= google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20230807174057-1744710a1577 h1:Tyk/35yqszRCvaragTn5NnkY6IiKk/XvHzEWepo71N0= -google.golang.org/genproto v0.0.0-20230807174057-1744710a1577/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4 h1:W12Pwm4urIbRdGhMEg2NM9O3TWKjNcxQhs46V0ypf/k= google.golang.org/genproto v0.0.0-20231127180814-3a041ad873d4/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= -google.golang.org/genproto/googleapis/api v0.0.0-20230807174057-1744710a1577 h1:xv8KoglAClYGkprUSmDTKaILtzfD8XzG9NYVXMprjKo= -google.golang.org/genproto/googleapis/api v0.0.0-20230807174057-1744710a1577/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4 h1:ZcOkrmX74HbKFYnpPY8Qsw93fC29TbJXspYKaBkSXDQ= google.golang.org/genproto/googleapis/api v0.0.0-20231127180814-3a041ad873d4/go.mod h1:k2dtGpRrbsSyKcNPKKI5sstZkrNCZwpU/ns96JoHbGg= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4 h1:DC7wcm+i+P1rN3Ff07vL+OndGg5OhNddHyTA+ocPqYE= google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4/go.mod h1:eJVxU6o+4G1PSczBr85xmyvSNYAKvAYgkub40YGomFM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -482,8 +330,6 @@ google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index a1f027be..62d0da82 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -5,8 +5,8 @@ import ( stderr "errors" "net/http" - "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/errors" ) diff --git a/pkg/auth/static.go b/pkg/auth/static.go index 50b4702a..d730b1d6 100644 --- a/pkg/auth/static.go +++ b/pkg/auth/static.go @@ -3,8 +3,8 @@ package auth import ( "context" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" ) diff --git a/pkg/config/config.go b/pkg/config/config.go index 8bd7f77e..4ab1ed2b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -4,7 +4,7 @@ import ( "errors" "os" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/middlewares" "github.com/go-playground/validator/v10" diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index ccbba6ed..fe6bd8e0 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -3,8 +3,8 @@ package config import ( "testing" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" diff --git a/pkg/crypt/bls.go b/pkg/crypt/bls.go deleted file mode 100644 index 6facf0d9..00000000 --- a/pkg/crypt/bls.go +++ /dev/null @@ -1,109 +0,0 @@ -package crypt - -import ( - "crypto" - - bls "github.com/ecadlabs/goblst" - "github.com/ecadlabs/goblst/minpk" - tz "github.com/ecadlabs/gotez" -) - -type BLSPrivateKey minpk.PrivateKey - -func (priv *BLSPrivateKey) ToBase58() []byte { - return priv.ToProtocol().ToBase58() -} - -func (priv *BLSPrivateKey) String() string { - return priv.ToProtocol().String() -} - -func (priv *BLSPrivateKey) Public() PublicKey { - return (*BLSPublicKey)((*minpk.PrivateKey)(priv).Public().(*minpk.PublicKey)) -} - -func (priv *BLSPrivateKey) Sign(message []byte) (signature Signature, err error) { - sig := minpk.Sign((*minpk.PrivateKey)(priv), message, bls.Augmentation) - return (*BLSSignature)(sig), nil -} - -func (priv *BLSPrivateKey) ToProtocol() tz.PrivateKey { - return tz.NewBLSPrivateKey((*minpk.PrivateKey)(priv).Bytes()) -} - -func (priv *BLSPrivateKey) Equal(other PrivateKey) bool { - x, ok := other.(*BLSPrivateKey) - return ok && (*minpk.PrivateKey)(priv).Equal((*minpk.PrivateKey)(x)) -} - -func (priv *BLSPrivateKey) MarshalText() (text []byte, err error) { - return priv.ToProtocol().ToBase58(), nil -} - -func (priv *BLSPrivateKey) Unwrap() crypto.PrivateKey { - return (*minpk.PrivateKey)(priv) -} - -type BLSPublicKey minpk.PublicKey - -func (pub *BLSPublicKey) Hash() PublicKeyHash { - return pub.ToProtocol().Hash() -} - -func (pub *BLSPublicKey) ToBase58() []byte { - return pub.ToProtocol().ToBase58() -} - -func (pub *BLSPublicKey) String() string { - return pub.ToProtocol().String() -} - -func (pub *BLSPublicKey) ToProtocol() tz.PublicKey { - return tz.NewBLSPublicKey((*minpk.PublicKey)(pub).Bytes()) -} - -func (pub *BLSPublicKey) Equal(other PublicKey) bool { - x, ok := other.(*BLSPublicKey) - return ok && (*minpk.PublicKey)(pub).Equal((*minpk.PublicKey)(x)) -} - -func (pub *BLSPublicKey) VerifySignature(sig Signature, message []byte) bool { - switch sig := sig.(type) { - case *BLSSignature: - return minpk.Verify((*minpk.PublicKey)(pub), message, (*minpk.Signature)(sig), bls.Augmentation) == nil - default: - return false - } -} - -func (pub *BLSPublicKey) MarshalText() (text []byte, err error) { - return pub.ToProtocol().ToBase58(), nil -} - -func (pub *BLSPublicKey) Unwrap() crypto.PublicKey { - return (*minpk.PublicKey)(pub) -} - -type BLSSignature minpk.Signature - -func (sig *BLSSignature) ToBase58() []byte { - return sig.ToProtocol().ToBase58() -} - -func (sig *BLSSignature) String() string { - return sig.ToProtocol().String() -} - -func (sig *BLSSignature) Verify(pub PublicKey, message []byte) bool { - return pub.VerifySignature(sig, message) -} - -func (sig *BLSSignature) ToProtocol() tz.Signature { - return tz.NewBLSSignature((*minpk.Signature)(sig).Bytes()) -} - -func (sig *BLSSignature) MarshalText() (text []byte, err error) { - return sig.ToProtocol().ToBase58(), nil -} - -var _ PrivateKey = &BLSPrivateKey{} diff --git a/pkg/crypt/common.go b/pkg/crypt/common.go deleted file mode 100644 index a1fe5897..00000000 --- a/pkg/crypt/common.go +++ /dev/null @@ -1,277 +0,0 @@ -package crypt - -import ( - "crypto" - "crypto/ecdsa" - "crypto/ed25519" - "crypto/elliptic" - "errors" - "fmt" - "math/big" - - "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/ecadlabs/goblst/minpk" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/b58" - "golang.org/x/crypto/blake2b" - "golang.org/x/crypto/cryptobyte" - "golang.org/x/crypto/cryptobyte/asn1" -) - -func DigestFunc(data []byte) Digest { - return Digest(blake2b.Sum256(data)) -} - -type Digest [32]byte - -var ( - ErrUnsupportedKeyType = errors.New("crypt: unsupported key type") - ErrInvalidPublicKey = errors.New("crypt: invalid public key") - ErrInvalidPrivateKey = errors.New("crypt: invalid private key") -) - -type PublicKeyHash = tz.PublicKeyHash - -type PrivateKey interface { - tz.Base58Encoder - ToProtocol() tz.PrivateKey - Sign(message []byte) (signature Signature, err error) - Public() PublicKey - Equal(PrivateKey) bool - Unwrap() crypto.PrivateKey -} - -type PublicKey interface { - tz.Base58Encoder - ToProtocol() tz.PublicKey - VerifySignature(sig Signature, message []byte) bool - Hash() PublicKeyHash - Equal(PublicKey) bool - Unwrap() crypto.PublicKey -} - -type Signature interface { - tz.Base58Encoder - ToProtocol() tz.Signature - Verify(pub PublicKey, message []byte) bool -} - -func NewPrivateKey(priv tz.PrivateKey) (PrivateKey, error) { - switch key := priv.(type) { - case *tz.Ed25519PrivateKey: - if len(key) != ed25519.SeedSize { - panic("crypt: invalid Ed25519 private key length") // unlikely - } - return Ed25519PrivateKey(ed25519.NewKeyFromSeed(key[:])), nil - - case *tz.Secp256k1PrivateKey: - p, err := unmarshalPrivateKey(key[:], secp256k1.S256()) - if err != nil { - return nil, err - } - return (*ECDSAPrivateKey)(p), nil - - case *tz.P256PrivateKey: - p, err := unmarshalPrivateKey(key[:], elliptic.P256()) - if err != nil { - return nil, err - } - return (*ECDSAPrivateKey)(p), nil - - case *tz.BLSPrivateKey: - p, err := minpk.PrivateKeyFromBytes(key[:]) - if err != nil { - return nil, err - } - return (*BLSPrivateKey)(p), nil - - default: - return nil, fmt.Errorf("crypt: unknown private key type: %T", priv) - } -} - -func NewPublicKey(pub tz.PublicKey) (PublicKey, error) { - switch pub := pub.(type) { - case *tz.Ed25519PublicKey: - if len(pub) != ed25519.PublicKeySize { - panic("crypt: invalid ed25519 public key length") // unlikely - } - return Ed25519PublicKey(pub[:]), nil - - case *tz.Secp256k1PublicKey, *tz.P256PublicKey: - var ( - curve elliptic.Curve - data []byte - ) - switch key := pub.(type) { - case *tz.Secp256k1PublicKey: - curve = secp256k1.S256() - data = key[:] - case *tz.P256PublicKey: - curve = elliptic.P256() - data = key[:] - default: - panic("unreachable") - } - x, y, err := unmarshalCompressed(data, curve) - if err != nil { - return nil, err - } - return (*ECDSAPublicKey)(&ecdsa.PublicKey{ - Curve: curve, - X: x, - Y: y, - }), nil - - case *tz.BLSPublicKey: - p, err := minpk.PublicKeyFromBytes(pub[:]) - - if err != nil { - return nil, err - } - return (*BLSPublicKey)(p), nil - - default: - return nil, fmt.Errorf("crypt: unknown public key type: %T", pub) - } -} - -// NewPublicKeyFrom tries to make PublicKey from a raw one. -// It returns ErrUnsupportedKeyType if the key is of unsupported type -func NewPublicKeyFrom(pub crypto.PublicKey) (PublicKey, error) { - switch pub := pub.(type) { - case *ecdsa.PublicKey: - switch pub.Curve { - case secp256k1.S256(), elliptic.P256(): - return (*ECDSAPublicKey)(pub), nil - default: - return nil, ErrUnsupportedKeyType - } - case ed25519.PublicKey: - return Ed25519PublicKey(pub), nil - case *minpk.PublicKey: - return (*BLSPublicKey)(pub), nil - default: - return nil, ErrUnsupportedKeyType - } -} - -func NewSignature(sig tz.Signature) (Signature, error) { - switch sig := sig.(type) { - case *tz.GenericSignature: - return (*GenericSignature)(sig), nil - - case *tz.Ed25519Signature: - if len(sig) != ed25519.SignatureSize { - panic("crypt: invalid ed25519 signature length") // unlikely - } - return Ed25519Signature(sig[:]), nil - - case *tz.Secp256k1Signature: - r, s := sig.Point() - return &ECDSASignature{ - R: r, - S: s, - Curve: secp256k1.S256(), - }, nil - - case *tz.P256Signature: - r, s := sig.Point() - return &ECDSASignature{ - R: r, - S: s, - Curve: elliptic.P256(), - }, nil - - case *tz.BLSSignature: - s, err := minpk.SignatureFromBytes(sig[:]) - if err != nil { - return nil, err - } - return (*BLSSignature)(s), nil - - default: - return nil, fmt.Errorf("crypt: unknown signature type: %T", sig) - } -} - -// NewSignatureFromBytes tries to parse signature coming from a third party. -// It makes an assumption about signature type base on the public key. -// For ECDSA it expects the signature to be serialized to ASN.1 -func NewSignatureFromBytes(sig []byte, pub PublicKey) (Signature, error) { - switch pub := pub.(type) { - case *ECDSAPublicKey: - var ( - inner cryptobyte.String - r, s big.Int - ) - input := cryptobyte.String(sig) - if !input.ReadASN1(&inner, asn1.SEQUENCE) || - !input.Empty() || - !inner.ReadASN1Integer(&r) || - !inner.ReadASN1Integer(&s) || - !inner.Empty() { - return nil, errors.New("crypt: invalid ASN.1") - } - return &ECDSASignature{ - R: &r, - S: &s, - Curve: pub.Curve, - }, nil - - case Ed25519PublicKey: - return Ed25519Signature(sig), nil - - case *BLSPublicKey: - s, err := minpk.SignatureFromBytes(sig) - if err != nil { - return nil, err - } - return (*BLSSignature)(s), nil - - default: - return nil, fmt.Errorf("crypt: unknown public key type: %T", pub) - } -} - -func ParsePrivateKey(src []byte) (PrivateKey, error) { - priv, err := b58.ParsePrivateKey(src) - if err != nil { - return nil, err - } - return NewPrivateKey(priv) -} - -func ParsePublicKey(src []byte) (PublicKey, error) { - priv, err := b58.ParsePublicKey(src) - if err != nil { - return nil, err - } - return NewPublicKey(priv) -} - -func ParseSignature(src []byte) (Signature, error) { - sig, err := b58.ParseSignature(src) - if err != nil { - return nil, err - } - return NewSignature(sig) -} - -type GenericSignature tz.GenericSignature - -func (sig *GenericSignature) ToBase58() []byte { - return (*tz.GenericSignature)(sig).ToBase58() -} - -func (sig *GenericSignature) String() string { - return string(sig.ToBase58()) -} - -func (sig *GenericSignature) Verify(pub PublicKey, message []byte) bool { - return pub.VerifySignature(sig, message) -} - -func (sig *GenericSignature) ToProtocol() tz.Signature { - return (*tz.GenericSignature)(sig) -} diff --git a/pkg/crypt/crypt_test.go b/pkg/crypt/crypt_test.go deleted file mode 100644 index 36d7c702..00000000 --- a/pkg/crypt/crypt_test.go +++ /dev/null @@ -1,161 +0,0 @@ -package crypt - -import ( - "crypto/ecdsa" - "crypto/ed25519" - "crypto/elliptic" - "crypto/rand" - "sync" - "testing" - - "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/ecadlabs/goblst/minpk" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/b58" - "github.com/stretchr/testify/require" -) - -type testCase struct { - title string - genKey func() PrivateKey -} - -var cases = []testCase{ - { - title: "Ed25519", - genKey: func() PrivateKey { - _, k, _ := ed25519.GenerateKey(rand.Reader) - return Ed25519PrivateKey(k) - }, - }, - { - title: "Secp256k1", - genKey: func() PrivateKey { - k, _ := ecdsa.GenerateKey(secp256k1.S256(), rand.Reader) - return (*ECDSAPrivateKey)(k) - }, - }, - { - title: "P256", - genKey: func() PrivateKey { - k, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) - return (*ECDSAPrivateKey)(k) - }, - }, - { - title: "BLS", - genKey: func() PrivateKey { - k, _ := minpk.GenerateKey(rand.Reader) - return (*BLSPrivateKey)(k) - }, - }, -} - -func TestKey(t *testing.T) { - for _, c := range cases { - t.Run(c.title, func(t *testing.T) { - // generate key - priv := c.genKey() - // encode to internal roundtrip - tzPriv := priv.ToProtocol() - tmp, err := NewPrivateKey(tzPriv) - require.NoError(t, err) - require.True(t, priv.Equal(tmp)) - require.Equal(t, priv, tmp) - - // encode to base58 roundtrip - tmp2, err := ParsePrivateKey(priv.ToBase58()) - require.NoError(t, err) - require.True(t, priv.Equal(tmp2)) - - // encode to base58 roundtrip using encrypted type - tmp3, err := b58.ParsePrivateKey(tzPriv.ToBase58()) - require.NoError(t, err) - decrypted, err := tmp3.Decrypt(nil) - require.NoError(t, err) - require.Equal(t, tzPriv, decrypted) - - // get public - pub := priv.Public() - // encode to internal roundtrip - tzPub := pub.ToProtocol() - tmp4, err := NewPublicKey(tzPub) - require.NoError(t, err) - require.True(t, pub.Equal(tmp4)) - require.Equal(t, pub, tmp4) - - // encode to base58 roundtrip - tmp5, err := ParsePublicKey(pub.ToBase58()) - require.NoError(t, err) - require.True(t, pub.Equal(tmp5)) - }) - } -} - -func asGeneric(sig tz.Signature) tz.Signature { - switch sig := sig.(type) { - case *tz.Ed25519Signature: - return (*tz.GenericSignature)(sig) - case *tz.Secp256k1Signature: - return (*tz.GenericSignature)(sig) - case *tz.P256Signature: - return (*tz.GenericSignature)(sig) - case *tz.BLSSignature: - return nil - default: - panic("unknown") - } -} - -func TestSignature(t *testing.T) { - var message = []byte("message text") - - for _, c := range cases { - t.Run(c.title, func(t *testing.T) { - priv := c.genKey() - sig, err := priv.Sign(message) - require.NoError(t, err) - - sig1, err := NewSignature(sig.ToProtocol()) - require.NoError(t, err) - require.Equal(t, sig, sig1) - - sig2, err := ParseSignature(sig.ToBase58()) - require.NoError(t, err) - require.Equal(t, sig, sig2) - - require.True(t, sig.Verify(priv.Public(), message)) - - // via generic - if genSig := asGeneric(sig.ToProtocol()); genSig != nil { - sig, err := NewSignature(genSig) - require.NoError(t, err) - require.True(t, sig.Verify(priv.Public(), message)) - } - }) - } -} - -var wg sync.WaitGroup - -func MinpkGenkey(t *testing.T) { - defer wg.Done() - k, err := minpk.GenerateKey(rand.Reader) - require.NoError(t, err) - require.NotNil(t, k) -} - -func TestMinpkGenkey1kSerial(t *testing.T) { - wg.Add(1000) - for i := 0; i < 1000; i++ { - MinpkGenkey(t) - } -} - -func TestMinpkGenkey1kParallel(t *testing.T) { - wg.Add(1000) - for i := 0; i < 1000; i++ { - go MinpkGenkey(t) - } - wg.Wait() -} diff --git a/pkg/crypt/ecdsa.go b/pkg/crypt/ecdsa.go deleted file mode 100644 index 4fa60b8f..00000000 --- a/pkg/crypt/ecdsa.go +++ /dev/null @@ -1,247 +0,0 @@ -package crypt - -import ( - "crypto" - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" - "fmt" - "math/big" - - "github.com/decred/dcrd/dcrec/secp256k1/v4" - tz "github.com/ecadlabs/gotez" -) - -type ECDSAPrivateKey ecdsa.PrivateKey - -func (priv *ECDSAPrivateKey) ToBase58() []byte { - return priv.ToProtocol().ToBase58() -} - -func (priv *ECDSAPrivateKey) String() string { - return priv.ToProtocol().String() -} - -func (priv *ECDSAPrivateKey) Public() PublicKey { - return (*ECDSAPublicKey)((*ecdsa.PrivateKey)(priv).Public().(*ecdsa.PublicKey)) -} - -func (priv *ECDSAPrivateKey) Sign(message []byte) (signature Signature, err error) { - digest := DigestFunc(message) - r, s, err := ecdsa.Sign(rand.Reader, (*ecdsa.PrivateKey)(priv), digest[:]) - if err != nil { - return nil, err - } - sig := &ECDSASignature{ - R: r, - S: s, - Curve: (*ecdsa.PrivateKey)(priv).Curve, - } - return canonizeSignature(sig), nil -} - -func (priv *ECDSAPrivateKey) ToProtocol() tz.PrivateKey { - switch priv.Curve { - case elliptic.P256(): - return tz.NewP256PrivateKey(priv.D) - case secp256k1.S256(): - return tz.NewSecp256k1PrivateKey(priv.D) - default: - panic(fmt.Sprintf("crypt: unknown curve: %v", priv.Curve.Params())) - } -} - -func (priv *ECDSAPrivateKey) Equal(other PrivateKey) bool { - x, ok := other.(*ECDSAPrivateKey) - return ok && (*ecdsa.PrivateKey)(priv).Equal((*ecdsa.PrivateKey)(x)) -} - -func (priv *ECDSAPrivateKey) MarshalText() (text []byte, err error) { - return priv.ToProtocol().ToBase58(), nil -} - -func (priv *ECDSAPrivateKey) Unwrap() crypto.PrivateKey { - return (*ecdsa.PrivateKey)(priv) -} - -type ECDSAPublicKey ecdsa.PublicKey - -func (pub *ECDSAPublicKey) Hash() PublicKeyHash { - return pub.ToProtocol().Hash() -} - -func (pub *ECDSAPublicKey) ToBase58() []byte { - return pub.ToProtocol().ToBase58() -} - -func (pub *ECDSAPublicKey) String() string { - return pub.ToProtocol().String() -} - -func (pub *ECDSAPublicKey) VerifySignature(sig Signature, message []byte) bool { - digest := DigestFunc(message) - switch sig := sig.(type) { - case *ECDSASignature: - return ecdsa.Verify((*ecdsa.PublicKey)(pub), digest[:], sig.R, sig.S) - case *GenericSignature: - s, err := NewSignature((*tz.Secp256k1Signature)(sig)) // exact curve doesn't matter here - if err != nil { - return false - } - return s.Verify(pub, message) - default: - return false - } -} - -func (pub *ECDSAPublicKey) ToProtocol() tz.PublicKey { - switch pub.Curve { - case elliptic.P256(): - return tz.NewP256PublicKey(elliptic.MarshalCompressed(pub.Curve, pub.X, pub.Y)) - case secp256k1.S256(): - return tz.NewSecp256k1PublicKey(elliptic.MarshalCompressed(pub.Curve, pub.X, pub.Y)) - default: - panic(fmt.Sprintf("crypt: unknown curve: %v", pub.Curve.Params())) - } -} - -func (pub *ECDSAPublicKey) Equal(other PublicKey) bool { - x, ok := other.(*ECDSAPublicKey) - return ok && (*ecdsa.PublicKey)(pub).Equal((*ecdsa.PublicKey)(x)) -} - -func (pub *ECDSAPublicKey) MarshalText() (text []byte, err error) { - return pub.ToProtocol().ToBase58(), nil -} - -func (pub *ECDSAPublicKey) Unwrap() crypto.PublicKey { - return (*ecdsa.PublicKey)(pub) -} - -type ECDSASignature struct { - R *big.Int - S *big.Int - Curve elliptic.Curve -} - -func (sig *ECDSASignature) ToBase58() []byte { - return sig.ToProtocol().ToBase58() -} - -func (sig *ECDSASignature) String() string { - return sig.ToProtocol().String() -} - -func (sig *ECDSASignature) Verify(pub PublicKey, message []byte) bool { - return pub.VerifySignature(sig, message) -} - -func (sig *ECDSASignature) ToProtocol() tz.Signature { - var s tz.Signature - switch sig.Curve { - case secp256k1.S256(): - s = tz.NewSecp256k1Signature(sig.R, sig.S) - case elliptic.P256(): - s = tz.NewP256Signature(sig.R, sig.S) - default: - panic(fmt.Sprintf("crypt: unknown curve %v", sig.Curve.Params())) - } - return s -} - -func (sig *ECDSASignature) MarshalText() (text []byte, err error) { - return sig.ToProtocol().ToBase58(), nil -} - -func canonizeSignature(sig *ECDSASignature) *ECDSASignature { - r := new(big.Int).Set(sig.R) - s := new(big.Int).Set(sig.S) - - order := sig.Curve.Params().N - quo := new(big.Int).Quo(order, new(big.Int).SetInt64(2)) - if s.Cmp(quo) > 0 { - s = s.Sub(order, s) - } - - return &ECDSASignature{ - R: r, - S: s, - Curve: sig.Curve, - } -} - -// See https://github.com/golang/go/blob/master/src/crypto/elliptic/elliptic.go -func unmarshalCompressed(data []byte, curve elliptic.Curve) (x, y *big.Int, err error) { - byteLen := (curve.Params().BitSize + 7) / 8 - if len(data) != 1+byteLen { - return nil, nil, ErrInvalidPublicKey - } - if data[0] != 2 && data[0] != 3 { // compressed form - return nil, nil, ErrInvalidPublicKey - } - p := curve.Params().P - x = new(big.Int).SetBytes(data[1:]) - if x.Cmp(p) >= 0 { - return nil, nil, ErrInvalidPublicKey - } - - // secp256k1 polynomial: x³ + b - // P-* polynomial: x³ - 3x + b - y = new(big.Int).Mul(x, x) - y.Mul(y, x) - if curve != secp256k1.S256() { - x1 := new(big.Int).Lsh(x, 1) - x1.Add(x1, x) - y.Sub(y, x1) - } - y.Add(y, curve.Params().B) - y.Mod(y, curve.Params().P) - y.ModSqrt(y, p) - - if y == nil { - return nil, nil, ErrInvalidPublicKey - } - if byte(y.Bit(0)) != data[0]&1 { - y.Neg(y).Mod(y, p) - } - if !curve.IsOnCurve(x, y) { - return nil, nil, ErrInvalidPublicKey - } - return -} - -// see https://golang.org/src/crypto/x509/sec1.go -func unmarshalPrivateKey(b []byte, curve elliptic.Curve) (key *ecdsa.PrivateKey, err error) { - k := new(big.Int).SetBytes(b) - curveOrder := curve.Params().N - if k.Cmp(curveOrder) >= 0 { - return nil, ErrInvalidPrivateKey - } - - priv := ecdsa.PrivateKey{ - PublicKey: ecdsa.PublicKey{ - Curve: curve, - }, - D: k, - } - - privateKey := make([]byte, (curveOrder.BitLen()+7)/8) - // Some private keys have leading zero padding. This is invalid - // according to [SEC1], but this code will ignore it. - for len(b) > len(privateKey) { - if b[0] != 0 { - return nil, ErrInvalidPrivateKey - } - b = b[1:] - } - - // Some private keys remove all leading zeros, this is also invalid - // according to [SEC1] but since OpenSSL used to do this, we ignore - // this too. - copy(privateKey[len(privateKey)-len(b):], b) - priv.X, priv.Y = curve.ScalarBaseMult(privateKey) - - return &priv, nil -} - -var _ PrivateKey = &ECDSAPrivateKey{} diff --git a/pkg/crypt/ed25519.go b/pkg/crypt/ed25519.go deleted file mode 100644 index a2762c14..00000000 --- a/pkg/crypt/ed25519.go +++ /dev/null @@ -1,119 +0,0 @@ -package crypt - -import ( - "crypto" - "crypto/ed25519" - - tz "github.com/ecadlabs/gotez" -) - -type Ed25519PrivateKey ed25519.PrivateKey - -func (priv Ed25519PrivateKey) ToBase58() []byte { - return priv.ToProtocol().ToBase58() -} - -func (priv Ed25519PrivateKey) String() string { - return priv.ToProtocol().String() -} - -func (priv Ed25519PrivateKey) Public() PublicKey { - return Ed25519PublicKey(ed25519.PrivateKey(priv).Public().(ed25519.PublicKey)) -} - -func (priv Ed25519PrivateKey) Sign(message []byte) (signature Signature, err error) { - digest := DigestFunc(message) - return Ed25519Signature(ed25519.Sign(ed25519.PrivateKey(priv), digest[:])), nil -} - -func (priv Ed25519PrivateKey) ToProtocol() tz.PrivateKey { - return tz.NewEd25519PrivateKey(ed25519.PrivateKey(priv).Seed()) -} - -func (priv Ed25519PrivateKey) Equal(other PrivateKey) bool { - x, ok := other.(Ed25519PrivateKey) - return ok && ed25519.PrivateKey(priv).Equal(ed25519.PrivateKey(x)) -} - -func (priv Ed25519PrivateKey) MarshalText() (text []byte, err error) { - return priv.Public().ToBase58(), nil -} - -func (priv Ed25519PrivateKey) Unwrap() crypto.PrivateKey { - return ed25519.PrivateKey(priv) -} - -func (priv Ed25519PrivateKey) Seed() []byte { - return ed25519.PrivateKey(priv).Seed() -} - -type Ed25519PublicKey ed25519.PublicKey - -func (pub Ed25519PublicKey) Hash() PublicKeyHash { - return pub.ToProtocol().Hash() -} - -func (pub Ed25519PublicKey) ToBase58() []byte { - return pub.ToProtocol().ToBase58() -} - -func (pub Ed25519PublicKey) String() string { - return pub.ToProtocol().String() -} - -func (pub Ed25519PublicKey) ToProtocol() tz.PublicKey { - return tz.NewEd25519PublicKey(pub) -} - -func (pub Ed25519PublicKey) Equal(other PublicKey) bool { - x, ok := other.(Ed25519PublicKey) - return ok && ed25519.PublicKey(pub).Equal(ed25519.PublicKey(x)) -} - -func (pub Ed25519PublicKey) MarshalText() (text []byte, err error) { - return pub.ToProtocol().ToBase58(), nil -} - -func (pub Ed25519PublicKey) VerifySignature(sig Signature, message []byte) bool { - digest := DigestFunc(message) - switch sig := sig.(type) { - case Ed25519Signature: - return ed25519.Verify(ed25519.PublicKey(pub), digest[:], sig) - case *GenericSignature: - return ed25519.Verify(ed25519.PublicKey(pub), digest[:], sig[:]) - default: - return false - } -} - -func (pub Ed25519PublicKey) Unwrap() crypto.PublicKey { - return ed25519.PublicKey(pub) -} - -type Ed25519Signature []byte - -func NewEd25519Signature(sig *tz.Ed25519Signature) Ed25519Signature { - return Ed25519Signature(sig[:]) -} - -func (sig Ed25519Signature) ToBase58() []byte { - return sig.ToProtocol().ToBase58() -} - -func (sig Ed25519Signature) String() string { - return sig.ToProtocol().String() -} - -func (sig Ed25519Signature) Verify(pub PublicKey, message []byte) bool { - return pub.VerifySignature(sig, message) -} - -func (sig Ed25519Signature) ToProtocol() tz.Signature { - return tz.NewEd25519Signature(sig) -} - -func (sig Ed25519Signature) MarshalText() (text []byte, err error) { - return sig.ToProtocol().ToBase58(), nil -} - -var _ PrivateKey = Ed25519PrivateKey{} diff --git a/pkg/cryptoutils/pkcs.go b/pkg/cryptoutils/pkcs.go index 6c8ece18..402cb5f4 100644 --- a/pkg/cryptoutils/pkcs.go +++ b/pkg/cryptoutils/pkcs.go @@ -11,7 +11,7 @@ import ( "fmt" "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "golang.org/x/crypto/cryptobyte" ) diff --git a/pkg/cryptoutils/pkcs_test.go b/pkg/cryptoutils/pkcs_test.go index 7519c496..4dc8b260 100644 --- a/pkg/cryptoutils/pkcs_test.go +++ b/pkg/cryptoutils/pkcs_test.go @@ -7,7 +7,7 @@ import ( "crypto/x509" "testing" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/stretchr/testify/require" ) diff --git a/pkg/hashmap/hashmap.go b/pkg/hashmap/hashmap.go index a7423769..82ca43f8 100644 --- a/pkg/hashmap/hashmap.go +++ b/pkg/hashmap/hashmap.go @@ -2,7 +2,7 @@ // interface types like PublicKeyHash to be used as map keys package hashmap -import tz "github.com/ecadlabs/gotez" +import tz "github.com/ecadlabs/gotez/v2" type KV[K, V any] struct { Key K diff --git a/pkg/hashmap/hashmap_test.go b/pkg/hashmap/hashmap_test.go index 82fa3ecf..b6044d13 100644 --- a/pkg/hashmap/hashmap_test.go +++ b/pkg/hashmap/hashmap_test.go @@ -4,8 +4,8 @@ import ( "encoding/json" "testing" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/stretchr/testify/require" "gopkg.in/yaml.v3" diff --git a/pkg/server/server.go b/pkg/server/server.go index 38c6fbe0..d080e025 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -9,9 +9,9 @@ import ( "net" "net/http" - "github.com/ecadlabs/gotez/b58" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/auth" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/middlewares" "github.com/ecadlabs/signatory/pkg/signatory" diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index d9785732..9f37da42 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -9,8 +9,8 @@ import ( "strings" "testing" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/server" "github.com/ecadlabs/signatory/pkg/signatory" "github.com/stretchr/testify/require" diff --git a/pkg/signatory/import.go b/pkg/signatory/import.go index 7b589df0..a4e9a849 100644 --- a/pkg/signatory/import.go +++ b/pkg/signatory/import.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/utils" "github.com/ecadlabs/signatory/pkg/vault" log "github.com/sirupsen/logrus" diff --git a/pkg/signatory/policy_hook_test.go b/pkg/signatory/policy_hook_test.go index 014004d0..41a91cf9 100644 --- a/pkg/signatory/policy_hook_test.go +++ b/pkg/signatory/policy_hook_test.go @@ -12,9 +12,9 @@ import ( "net/http/httptest" "testing" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/auth" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/pkg/signatory/request/request.go b/pkg/signatory/request/request.go index 298f5d99..37f60524 100644 --- a/pkg/signatory/request/request.go +++ b/pkg/signatory/request/request.go @@ -1,68 +1,13 @@ package request import ( - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/encoding" - "github.com/ecadlabs/gotez/protocol" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/protocol" ) -type SignRequest interface { - RequestKind() string -} - -type BlockRequest struct { - Chain *tz.ChainID - BlockHeader protocol.TenderbakeBlockHeader -} - -func (*BlockRequest) RequestKind() string { return "block" } -func (r *BlockRequest) GetChainID() *tz.ChainID { return r.Chain } -func (r *BlockRequest) GetLevel() int32 { return r.BlockHeader.Level } -func (r *BlockRequest) GetRound() int32 { return r.BlockHeader.PayloadRound } - -type PreendorsementRequest struct { - Chain *tz.ChainID - Branch *tz.BlockHash - Operation protocol.InlinedPreendorsementContents -} - -func (*PreendorsementRequest) RequestKind() string { return "preendorsement" } -func (r *PreendorsementRequest) GetChainID() *tz.ChainID { return r.Chain } -func (r *PreendorsementRequest) GetLevel() int32 { return r.Operation.(*protocol.Preendorsement).Level } -func (r *PreendorsementRequest) GetRound() int32 { return r.Operation.(*protocol.Preendorsement).Round } - -type EndorsementRequest struct { - Chain *tz.ChainID - Branch *tz.BlockHash - Operation protocol.InlinedEndorsementContents -} - -func (*EndorsementRequest) RequestKind() string { return "endorsement" } -func (r *EndorsementRequest) GetChainID() *tz.ChainID { return r.Chain } -func (r *EndorsementRequest) GetLevel() int32 { return r.Operation.(*protocol.Endorsement).Level } -func (r *EndorsementRequest) GetRound() int32 { return r.Operation.(*protocol.Endorsement).Round } - -type GenericOperationRequest struct { - Branch *tz.BlockHash - Operations []protocol.OperationContents -} - -func (*GenericOperationRequest) RequestKind() string { return "generic" } - -func init() { - encoding.RegisterEnum(&encoding.Enum[SignRequest]{ - Variants: encoding.Variants[SignRequest]{ - 0x03: (*GenericOperationRequest)(nil), - 0x11: (*BlockRequest)(nil), - 0x12: (*PreendorsementRequest)(nil), - 0x13: (*EndorsementRequest)(nil), - }, - }) -} - type WithWatermark interface { - SignRequest + protocol.SignRequest GetChainID() *tz.ChainID GetLevel() int32 GetRound() int32 @@ -96,7 +41,7 @@ func (l *Watermark) Validate(stored *Watermark) bool { } var ( - _ WithWatermark = (*BlockRequest)(nil) - _ WithWatermark = (*PreendorsementRequest)(nil) - _ WithWatermark = (*EndorsementRequest)(nil) + _ WithWatermark = (*protocol.BlockSignRequest)(nil) + _ WithWatermark = (*protocol.PreendorsementSignRequest)(nil) + _ WithWatermark = (*protocol.EndorsementSignRequest)(nil) ) diff --git a/pkg/signatory/request/request_test.go b/pkg/signatory/request/request_test.go index 4b01cb6b..770f7328 100644 --- a/pkg/signatory/request/request_test.go +++ b/pkg/signatory/request/request_test.go @@ -6,10 +6,13 @@ import ( "encoding/hex" "testing" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/encoding" - proto "github.com/ecadlabs/gotez/protocol" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/encoding" + "github.com/ecadlabs/gotez/v2/protocol" + "github.com/ecadlabs/gotez/v2/protocol/core" + "github.com/ecadlabs/gotez/v2/protocol/core/expression" + proto "github.com/ecadlabs/gotez/v2/protocol/latest" "github.com/stretchr/testify/require" ) @@ -17,21 +20,21 @@ func TestSignRequest(t *testing.T) { type testCase struct { title string src string - expect SignRequest + expect protocol.SignRequest } testCases := []testCase{ { title: "preendorsement", src: "12ed9d217c2f50673bab6b20dfb0a88ca93b4a0c72a34c807af5dffbece2cba3d2b509835f14006000000002000000041f1ebb39759cc957216f88fb4d005abc206fb00a53f8d57ac01be00c084cba97", - expect: &PreendorsementRequest{ + expect: &protocol.PreattestationSignRequest{ Chain: &tz.ChainID{0xed, 0x9d, 0x21, 0x7c}, Branch: &tz.BlockHash{ 0x2f, 0x50, 0x67, 0x3b, 0xab, 0x6b, 0x20, 0xdf, 0xb0, 0xa8, 0x8c, 0xa9, 0x3b, 0x4a, 0xc, 0x72, 0xa3, 0x4c, 0x80, 0x7a, 0xf5, 0xdf, 0xfb, 0xec, 0xe2, 0xcb, 0xa3, 0xd2, 0xb5, 0x9, 0x83, 0x5f, }, - Operation: &proto.Preendorsement{ + Operation: &proto.Preattestation{ Slot: 96, Level: 2, Round: 4, @@ -46,14 +49,14 @@ func TestSignRequest(t *testing.T) { { title: "endorsement", src: "13ed9d217cfc81eee810737b04018acef4db74d056b79edc43e6be46cae7e4c217c22a82f01500120000518d0000000003e7ea1f67dbb0bb6cfa372cb092cd9cf786b4f1b5e5139da95b915fb95e698d", - expect: &EndorsementRequest{ + expect: &protocol.AttestationSignRequest{ Chain: &tz.ChainID{0xed, 0x9d, 0x21, 0x7c}, Branch: &tz.BlockHash{ 0xfc, 0x81, 0xee, 0xe8, 0x10, 0x73, 0x7b, 0x4, 0x1, 0x8a, 0xce, 0xf4, 0xdb, 0x74, 0xd0, 0x56, 0xb7, 0x9e, 0xdc, 0x43, 0xe6, 0xbe, 0x46, 0xca, 0xe7, 0xe4, 0xc2, 0x17, 0xc2, 0x2a, 0x82, 0xf0, }, - Operation: &proto.Endorsement{ + Operation: &proto.Attestation{ Slot: 18, Level: 20877, Round: 0, @@ -68,10 +71,10 @@ func TestSignRequest(t *testing.T) { { title: "block", src: "11ed9d217c0000518e0118425847ac255b6d7c30ce8fec23b8eaf13b741de7d18509ac2ef83c741209630000000061947af504805682ea5d089837764b3efcc90b91db24294ff9ddb66019f332ccba17cc4741000000210000000102000000040000518e0000000000000004ffffffff0000000400000000eb1320a71e8bf8b0162a3ec315461e9153a38b70d00d5dde2df85eb92748f8d068d776e356683a9e23c186ccfb72ddc6c9857bb1704487972922e7c89a7121f800000000a8e1dd3c000000000000", - expect: &BlockRequest{ + expect: &protocol.BlockSignRequest{ Chain: &tz.ChainID{0xed, 0x9d, 0x21, 0x7c}, - BlockHeader: proto.TenderbakeBlockHeader{ - ShellHeader: proto.ShellHeader{ + BlockHeader: proto.UnsignedBlockHeader{ + ShellHeader: core.ShellHeader{ Level: 20878, Proto: 1, Predecessor: &tz.BlockHash{ @@ -97,28 +100,29 @@ func TestSignRequest(t *testing.T) { 0x5e, 0xb9, 0x27, 0x48, 0xf8, 0xd0, }, }, - PayloadHash: &tz.BlockPayloadHash{ - 0x68, 0xd7, 0x76, 0xe3, 0x56, 0x68, 0x3a, 0x9e, 0x23, 0xc1, 0x86, 0xcc, 0xfb, 0x72, - 0xdd, 0xc6, 0xc9, 0x85, 0x7b, 0xb1, 0x70, 0x44, 0x87, 0x97, 0x29, 0x22, 0xe7, 0xc8, - 0x9a, 0x71, 0x21, 0xf8, + UnsignedProtocolBlockHeader: proto.UnsignedProtocolBlockHeader{ + PayloadHash: &tz.BlockPayloadHash{ + 0x68, 0xd7, 0x76, 0xe3, 0x56, 0x68, 0x3a, 0x9e, 0x23, 0xc1, 0x86, 0xcc, 0xfb, 0x72, + 0xdd, 0xc6, 0xc9, 0x85, 0x7b, 0xb1, 0x70, 0x44, 0x87, 0x97, 0x29, 0x22, 0xe7, 0xc8, + 0x9a, 0x71, 0x21, 0xf8, + }, + PayloadRound: 0, + ProofOfWorkNonce: &tz.Bytes8{0xa8, 0xe1, 0xdd, 0x3c, 0x0, 0x0, 0x0, 0x0}, + SeedNonceHash: tz.None[*tz.CycleNonceHash](), }, - PayloadRound: 0, - ProofOfWorkNonce: &[8]byte{0xa8, 0xe1, 0xdd, 0x3c, 0x0, 0x0, 0x0, 0x0}, - SeedNonceHash: tz.None[*tz.CycleNonceHash](), - LiquidityBakingToggleVote: 0, }, }, }, { title: "operation", src: "03a60703a9567bf69ec66b368c3d8562eba4cbf29278c2c10447a684e3aa1436856c00a0c7a9b0bcd6a48ee0c13094327f215ba2adeaa7d40dabc1af25e36fde02c096b10201f525eabd8b0eeace1494233ea0230d2c9ad6619b00ffff0b66756c66696c6c5f61736b0000000907070088f0f6010306", - expect: &GenericOperationRequest{ + expect: &protocol.GenericOperationSignRequest{ Branch: &tz.BlockHash{ 0xa6, 0x7, 0x3, 0xa9, 0x56, 0x7b, 0xf6, 0x9e, 0xc6, 0x6b, 0x36, 0x8c, 0x3d, 0x85, 0x62, 0xeb, 0xa4, 0xcb, 0xf2, 0x92, 0x78, 0xc2, 0xc1, 0x4, 0x47, 0xa6, 0x84, 0xe3, 0xaa, 0x14, 0x36, 0x85, }, - Operations: []proto.OperationContents{ + Contents: []proto.OperationContents{ &proto.Transaction{ ManagerOperation: proto.ManagerOperation{ Source: &tz.Ed25519PublicKeyHash{ @@ -131,16 +135,23 @@ func TestSignRequest(t *testing.T) { StorageLimit: tz.BigUint{0xde, 0x2}, }, Amount: tz.BigUint{0xc0, 0x96, 0xb1, 0x2}, - Destination: &tz.OriginatedContract{ + Destination: core.OriginatedContract{ ContractHash: &tz.ContractHash{ 0xf5, 0x25, 0xea, 0xbd, 0x8b, 0xe, 0xea, 0xce, 0x14, 0x94, 0x23, 0x3e, 0xa0, 0x23, 0xd, 0x2c, 0x9a, 0xd6, 0x61, 0x9b, }, - Padding: 0x0, }, Parameters: tz.Some(proto.Parameters{ Entrypoint: proto.EpNamed{String: "fulfill_ask"}, - Value: []byte{0x7, 0x7, 0x0, 0x88, 0xF0, 0xF6, 0x1, 0x3, 0x6}, + Value: &expression.Prim20{ + Prim: expression.Prim(7), + Args: [2]expression.Expression{ + expression.Int{ + Int: tz.BigInt{0x88, 0xf0, 0xf6, 0x01}, + }, + expression.Prim00(6), + }, + }, }), }, }, @@ -149,13 +160,13 @@ func TestSignRequest(t *testing.T) { { title: "multiple operations", src: "03a60703a9567bf69ec66b368c3d8562eba4cbf29278c2c10447a684e3aa1436856c00a0c7a9b0bcd6a48ee0c13094327f215ba2adeaa7d40dabc1af25e36fde02c096b10201f525eabd8b0eeace1494233ea0230d2c9ad6619b00ffff0b66756c66696c6c5f61736b0000000907070088f0f60103066e00e1ba5449f2938568ace14b5dd54f31936dc86722ba08e0eaa917f53800ff0002298c03ed7d454a101eb7022bc95f7e5f41ac78", - expect: &GenericOperationRequest{ + expect: &protocol.GenericOperationSignRequest{ Branch: &tz.BlockHash{ 0xa6, 0x7, 0x3, 0xa9, 0x56, 0x7b, 0xf6, 0x9e, 0xc6, 0x6b, 0x36, 0x8c, 0x3d, 0x85, 0x62, 0xeb, 0xa4, 0xcb, 0xf2, 0x92, 0x78, 0xc2, 0xc1, 0x4, 0x47, 0xa6, 0x84, 0xe3, 0xaa, 0x14, 0x36, 0x85, }, - Operations: []proto.OperationContents{ + Contents: []proto.OperationContents{ &proto.Transaction{ ManagerOperation: proto.ManagerOperation{ Source: &tz.Ed25519PublicKeyHash{ @@ -168,16 +179,23 @@ func TestSignRequest(t *testing.T) { StorageLimit: tz.BigUint{0xde, 0x2}, }, Amount: tz.BigUint{0xc0, 0x96, 0xb1, 0x2}, - Destination: &tz.OriginatedContract{ + Destination: core.OriginatedContract{ ContractHash: &tz.ContractHash{ 0xf5, 0x25, 0xea, 0xbd, 0x8b, 0xe, 0xea, 0xce, 0x14, 0x94, 0x23, 0x3e, 0xa0, 0x23, 0xd, 0x2c, 0x9a, 0xd6, 0x61, 0x9b, }, - Padding: 0x0, }, Parameters: tz.Some(proto.Parameters{ Entrypoint: proto.EpNamed{String: "fulfill_ask"}, - Value: []byte{0x7, 0x7, 0x0, 0x88, 0xF0, 0xF6, 0x1, 0x3, 0x6}, + Value: &expression.Prim20{ + Prim: expression.Prim(7), + Args: [2]expression.Expression{ + expression.Int{ + Int: tz.BigInt{0x88, 0xf0, 0xf6, 0x01}, + }, + expression.Prim00(6), + }, + }, }), }, &proto.Delegation{ @@ -200,7 +218,7 @@ func TestSignRequest(t *testing.T) { t.Run(test.title, func(t *testing.T) { buf, err := hex.DecodeString(test.src) require.NoError(t, err) - var req SignRequest + var req protocol.SignRequest _, err = encoding.Decode(buf, &req) require.NoError(t, err) require.Equal(t, test.expect, req) diff --git a/pkg/signatory/request/watermark_test.go b/pkg/signatory/request/watermark_test.go index 373cc322..94db5ca3 100644 --- a/pkg/signatory/request/watermark_test.go +++ b/pkg/signatory/request/watermark_test.go @@ -5,8 +5,8 @@ package request import ( "testing" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/stretchr/testify/require" ) @@ -15,7 +15,7 @@ type dummyMsg struct { round int32 } -func (r *dummyMsg) RequestKind() string { return "dummy" } +func (r *dummyMsg) SignRequestKind() string { return "dummy" } func (r *dummyMsg) GetChainID() *tz.ChainID { return &tz.ChainID{} } func (r *dummyMsg) GetLevel() int32 { return r.level } func (r *dummyMsg) GetRound() int32 { return r.round } diff --git a/pkg/signatory/signatory.go b/pkg/signatory/signatory.go index 2be7a33d..5480b839 100644 --- a/pkg/signatory/signatory.go +++ b/pkg/signatory/signatory.go @@ -14,11 +14,14 @@ import ( "strings" "sync" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/gotez/encoding" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/encoding" + "github.com/ecadlabs/gotez/v2/protocol" + "github.com/ecadlabs/gotez/v2/protocol/core" + "github.com/ecadlabs/gotez/v2/protocol/latest" "github.com/ecadlabs/signatory/pkg/auth" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory/request" @@ -154,7 +157,7 @@ func (s *Signatory) fetchPolicyOrDefault(keyHash crypt.PublicKeyHash) *PublicKey return &defaultPolicy } -func matchFilter(policy *PublicKeyPolicy, req *SignRequest, msg request.SignRequest) error { +func matchFilter(policy *PublicKeyPolicy, req *SignRequest, msg protocol.SignRequest) error { if policy.AuthorizedKeyHashes != nil { if req.ClientPublicKeyHash == nil { return errors.New("authentication required") @@ -174,7 +177,7 @@ func matchFilter(policy *PublicKeyPolicy, req *SignRequest, msg request.SignRequ } } - kind := msg.RequestKind() + kind := msg.SignRequestKind() var allowed bool for _, k := range policy.AllowedRequests { if kind == k { @@ -187,8 +190,8 @@ func matchFilter(policy *PublicKeyPolicy, req *SignRequest, msg request.SignRequ return fmt.Errorf("request kind `%s' is not allowed", kind) } - if ops, ok := msg.(*request.GenericOperationRequest); ok { - for _, op := range ops.Operations { + if ops, ok := msg.(*protocol.GenericOperationSignRequest); ok { + for _, op := range ops.Contents { kind := op.OperationKind() allowed = false for _, k := range policy.AllowedOps { @@ -339,23 +342,23 @@ func (s *Signatory) Sign(ctx context.Context, req *SignRequest) (crypt.Signature } } - var msg request.SignRequest + var msg protocol.SignRequest _, err := encoding.Decode(req.Message, &msg) if err != nil { l.WithField(logRaw, hex.EncodeToString(req.Message)).Error(strings.Replace(err.Error(), "\n", "", -1)) return nil, errors.Wrap(err, http.StatusBadRequest) } - l = l.WithField(logReq, msg.RequestKind()) + l = l.WithField(logReq, msg.SignRequestKind()) if m, ok := msg.(request.WithWatermark); ok { l = l.WithFields(log.Fields{logChainID: string(m.GetChainID().ToBase58()), logLevel: m.GetLevel()}) } var opStat operationsStat - if ops, ok := msg.(*request.GenericOperationRequest); ok { + if ops, ok := msg.(*protocol.GenericOperationSignRequest); ok { opStat = getOperationsStat(ops) - l = l.WithFields(log.Fields{logOps: opStat, logTotalOps: len(ops.Operations)}) + l = l.WithFields(log.Fields{logOps: opStat, logTotalOps: len(ops.Contents)}) } p, err := s.getPublicKey(ctx, req.PublicKeyHash) @@ -403,7 +406,7 @@ func (s *Signatory) Sign(ctx context.Context, req *SignRequest) (crypt.Signature err = s.config.Interceptor(&SignInterceptorOptions{ Address: req.PublicKeyHash, Vault: p.vault.Name(), - Req: msg.RequestKind(), + Req: msg.SignRequestKind(), Stat: opStat, }, func() (err error) { sig, err = signFunc(ctx, req.Message, p.key) @@ -418,7 +421,7 @@ func (s *Signatory) Sign(ctx context.Context, req *SignRequest) (crypt.Signature l.WithField("raw", sig).Debug("Signed bytes") l.Debugf("Encoded signature: %v", sig) - l.Infof("Signed %s successfully", msg.RequestKind()) + l.Infof("Signed %s successfully", msg.SignRequestKind()) return sig, nil } @@ -651,6 +654,14 @@ func PreparePolicy(src config.TezosConfig) (out Policy, err error) { pipe.Close() } + if core.CompareProtocols(&latest.Protocol, &core.Proto018Proxford) >= 0 { + for i, o := range pol.AllowedOps { + if o == "endorsement" { + pol.AllowedOps[i] = "attestation" + } + } + } + if v.AuthorizedKeys != nil { keys := v.AuthorizedKeys.List() pol.AuthorizedKeyHashes = make([]crypt.PublicKeyHash, len(keys)) diff --git a/pkg/signatory/signatory_test.go b/pkg/signatory/signatory_test.go index 2204a9f6..681bb467 100644 --- a/pkg/signatory/signatory_test.go +++ b/pkg/signatory/signatory_test.go @@ -8,8 +8,8 @@ import ( "fmt" "testing" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/pkg/signatory/utils.go b/pkg/signatory/utils.go index 0720a015..eae2efed 100644 --- a/pkg/signatory/utils.go +++ b/pkg/signatory/utils.go @@ -3,8 +3,8 @@ package signatory import ( "bytes" - "github.com/ecadlabs/gotez/encoding" - "github.com/ecadlabs/signatory/pkg/signatory/request" + "github.com/ecadlabs/gotez/v2/encoding" + "github.com/ecadlabs/gotez/v2/protocol" ) func AuthenticatedBytesToSign(req *SignRequest) ([]byte, error) { @@ -24,9 +24,9 @@ func AuthenticatedBytesToSign(req *SignRequest) ([]byte, error) { type operationsStat map[string]int // getOperationsStat returns statistics of operations -func getOperationsStat(u *request.GenericOperationRequest) operationsStat { +func getOperationsStat(u *protocol.GenericOperationSignRequest) operationsStat { ops := make(operationsStat) - for _, o := range u.Operations { + for _, o := range u.Contents { ops[o.OperationKind()]++ } return ops diff --git a/pkg/signatory/utils_test.go b/pkg/signatory/utils_test.go index 7356ce3c..b9fa9eda 100644 --- a/pkg/signatory/utils_test.go +++ b/pkg/signatory/utils_test.go @@ -5,7 +5,7 @@ package signatory_test import ( "context" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/vault" ) diff --git a/pkg/signatory/watermark.go b/pkg/signatory/watermark.go index eb216b3b..043ab247 100644 --- a/pkg/signatory/watermark.go +++ b/pkg/signatory/watermark.go @@ -1,20 +1,20 @@ package signatory import ( - "github.com/ecadlabs/signatory/pkg/crypt" - "github.com/ecadlabs/signatory/pkg/signatory/request" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/protocol" ) // Watermark tests level against stored high watermark type Watermark interface { - IsSafeToSign(pkh crypt.PublicKeyHash, req request.SignRequest, digest *crypt.Digest) error + IsSafeToSign(pkh crypt.PublicKeyHash, req protocol.SignRequest, digest *crypt.Digest) error } // IgnoreWatermark watermark that do not validation and return true type IgnoreWatermark struct{} // IsSafeToSign always return true -func (w IgnoreWatermark) IsSafeToSign(crypt.PublicKeyHash, request.SignRequest, *crypt.Digest) error { +func (w IgnoreWatermark) IsSafeToSign(crypt.PublicKeyHash, protocol.SignRequest, *crypt.Digest) error { return nil } diff --git a/pkg/signatory/watermark_file.go b/pkg/signatory/watermark_file.go index ab9d82aa..0a8def77 100644 --- a/pkg/signatory/watermark_file.go +++ b/pkg/signatory/watermark_file.go @@ -10,9 +10,10 @@ import ( "path/filepath" "strings" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/protocol" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory/request" log "github.com/sirupsen/logrus" @@ -146,7 +147,7 @@ func writeWatermarkData(baseDir string, data delegateMap, chain *tz.ChainID) err return w.Flush() } -func (f *FileWatermark) IsSafeToSign(pkh crypt.PublicKeyHash, req request.SignRequest, digest *crypt.Digest) error { +func (f *FileWatermark) IsSafeToSign(pkh crypt.PublicKeyHash, req protocol.SignRequest, digest *crypt.Digest) error { m, ok := req.(request.WithWatermark) if !ok { // watermark is not required diff --git a/pkg/signatory/watermark_mem.go b/pkg/signatory/watermark_mem.go index c2dd8578..8fa59187 100644 --- a/pkg/signatory/watermark_mem.go +++ b/pkg/signatory/watermark_mem.go @@ -3,8 +3,9 @@ package signatory import ( "sync" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/protocol" "github.com/ecadlabs/signatory/pkg/signatory/request" ) @@ -15,13 +16,13 @@ type InMemoryWatermark struct { } // IsSafeToSign return true if this msgID is safe to sign -func (w *InMemoryWatermark) IsSafeToSign(pkh crypt.PublicKeyHash, req request.SignRequest, digest *crypt.Digest) error { +func (w *InMemoryWatermark) IsSafeToSign(pkh crypt.PublicKeyHash, req protocol.SignRequest, digest *crypt.Digest) error { w.mtx.Lock() defer w.mtx.Unlock() return w.isSafeToSignUnlocked(pkh, req, digest) } -func (w *InMemoryWatermark) isSafeToSignUnlocked(pkh crypt.PublicKeyHash, req request.SignRequest, digest *crypt.Digest) error { +func (w *InMemoryWatermark) isSafeToSignUnlocked(pkh crypt.PublicKeyHash, req protocol.SignRequest, digest *crypt.Digest) error { m, ok := req.(request.WithWatermark) if !ok { // watermark is not required @@ -45,12 +46,12 @@ func (w *InMemoryWatermark) isSafeToSignUnlocked(pkh crypt.PublicKeyHash, req re } watermark := request.NewWatermark(m, digest) - if stored, ok := requests[req.RequestKind()]; ok { + if stored, ok := requests[req.SignRequestKind()]; ok { if !watermark.Validate(stored) { return ErrWatermark } } - requests[m.RequestKind()] = watermark + requests[m.SignRequestKind()] = watermark return nil } diff --git a/pkg/signatory/watermark_migration.go b/pkg/signatory/watermark_migration.go index 940db1d4..7d7329f1 100644 --- a/pkg/signatory/watermark_migration.go +++ b/pkg/signatory/watermark_migration.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/b58" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/b58" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/signatory/request" ) diff --git a/pkg/signatory/watermark_test.go b/pkg/signatory/watermark_test.go index 6e9a7697..e83a6475 100644 --- a/pkg/signatory/watermark_test.go +++ b/pkg/signatory/watermark_test.go @@ -7,9 +7,9 @@ import ( "os" "testing" - tz "github.com/ecadlabs/gotez" - "github.com/ecadlabs/signatory/pkg/crypt" - "github.com/ecadlabs/signatory/pkg/signatory/request" + tz "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/protocol" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -20,14 +20,14 @@ type dummyMsg struct { round int32 } -func (r *dummyMsg) RequestKind() string { return r.kind } +func (r *dummyMsg) SignRequestKind() string { return r.kind } func (r *dummyMsg) GetChainID() *tz.ChainID { return &tz.ChainID{} } func (r *dummyMsg) GetLevel() int32 { return r.level } func (r *dummyMsg) GetRound() int32 { return r.round } type testCase struct { pkh crypt.PublicKeyHash - req request.SignRequest + req protocol.SignRequest reqDigest crypt.Digest expectErr bool } diff --git a/pkg/vault/aws/awskms.go b/pkg/vault/aws/awskms.go index b0469c06..f7dae4ee 100644 --- a/pkg/vault/aws/awskms.go +++ b/pkg/vault/aws/awskms.go @@ -10,8 +10,8 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/kms" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/cryptoutils" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/pkg/vault/azure/azure.go b/pkg/vault/azure/azure.go index 5a536f94..060036ed 100644 --- a/pkg/vault/azure/azure.go +++ b/pkg/vault/azure/azure.go @@ -16,8 +16,8 @@ import ( "strings" "github.com/decred/dcrd/dcrec/secp256k1/v4" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/utils" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/pkg/vault/cloudkms/cloudkms.go b/pkg/vault/cloudkms/cloudkms.go index c838d950..bd9d2882 100644 --- a/pkg/vault/cloudkms/cloudkms.go +++ b/pkg/vault/cloudkms/cloudkms.go @@ -12,8 +12,8 @@ import ( kms "cloud.google.com/go/kms/apiv1" kmspb "cloud.google.com/go/kms/apiv1/kmspb" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/cryptoutils" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/utils" diff --git a/pkg/vault/hashicorp/vault.go b/pkg/vault/hashicorp/vault.go index ffb3a79e..8ea03e3e 100644 --- a/pkg/vault/hashicorp/vault.go +++ b/pkg/vault/hashicorp/vault.go @@ -8,8 +8,8 @@ import ( "fmt" "net/url" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/vault" "github.com/hashicorp/vault/api" auth "github.com/hashicorp/vault/api/auth/approle" diff --git a/pkg/vault/ledger/mnemonic/mnemonic_test.go b/pkg/vault/ledger/mnemonic/mnemonic_test.go index 567e06bf..3a4ad86e 100644 --- a/pkg/vault/ledger/mnemonic/mnemonic_test.go +++ b/pkg/vault/ledger/mnemonic/mnemonic_test.go @@ -6,8 +6,8 @@ import ( "crypto/x509" "testing" - "github.com/ecadlabs/gotez/encoding" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" + "github.com/ecadlabs/gotez/v2/encoding" "github.com/stretchr/testify/assert" ) diff --git a/pkg/vault/ledger/scan.go b/pkg/vault/ledger/scan.go index afaf9c62..aa235152 100644 --- a/pkg/vault/ledger/scan.go +++ b/pkg/vault/ledger/scan.go @@ -7,7 +7,7 @@ import ( "fmt" "sync" - "github.com/ecadlabs/gotez/encoding" + "github.com/ecadlabs/gotez/v2/encoding" "github.com/ecadlabs/signatory/pkg/vault/ledger/ledger" "github.com/ecadlabs/signatory/pkg/vault/ledger/mnemonic" "github.com/ecadlabs/signatory/pkg/vault/ledger/tezosapp" diff --git a/pkg/vault/ledger/tezosapp/tezosapp.go b/pkg/vault/ledger/tezosapp/tezosapp.go index bdf27c1a..cc2fd932 100644 --- a/pkg/vault/ledger/tezosapp/tezosapp.go +++ b/pkg/vault/ledger/tezosapp/tezosapp.go @@ -10,7 +10,7 @@ import ( "strings" "github.com/decred/dcrd/dcrec/secp256k1/v4" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/vault/ledger/ledger" ) diff --git a/pkg/vault/ledger/tools.go b/pkg/vault/ledger/tools.go index 414a9162..96a961d0 100644 --- a/pkg/vault/ledger/tools.go +++ b/pkg/vault/ledger/tools.go @@ -1,8 +1,8 @@ package ledger import ( - "github.com/ecadlabs/gotez" - "github.com/ecadlabs/gotez/b58" + "github.com/ecadlabs/gotez/v2" + "github.com/ecadlabs/gotez/v2/b58" "github.com/ecadlabs/signatory/pkg/vault/ledger/tezosapp" ) diff --git a/pkg/vault/ledger/vault.go b/pkg/vault/ledger/vault.go index 609cc2a6..1e637158 100644 --- a/pkg/vault/ledger/vault.go +++ b/pkg/vault/ledger/vault.go @@ -8,8 +8,8 @@ import ( "strings" "time" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/vault" "github.com/ecadlabs/signatory/pkg/vault/ledger/ledger" diff --git a/pkg/vault/memory/vault.go b/pkg/vault/memory/vault.go index 7a337e4a..619c1290 100644 --- a/pkg/vault/memory/vault.go +++ b/pkg/vault/memory/vault.go @@ -7,8 +7,8 @@ import ( "net/http" "sync" - "github.com/ecadlabs/gotez/b58" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/b58" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/utils" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/pkg/vault/vault.go b/pkg/vault/vault.go index 2973ed8f..1f770b5d 100644 --- a/pkg/vault/vault.go +++ b/pkg/vault/vault.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/ecadlabs/signatory/pkg/crypt" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/utils" "github.com/spf13/cobra" "gopkg.in/yaml.v3" diff --git a/pkg/vault/yubi/yubi.go b/pkg/vault/yubi/yubi.go index 114427fd..f3d2d604 100644 --- a/pkg/vault/yubi/yubi.go +++ b/pkg/vault/yubi/yubi.go @@ -17,8 +17,8 @@ import ( "github.com/certusone/yubihsm-go/commands" "github.com/certusone/yubihsm-go/connector" "github.com/decred/dcrd/dcrec/secp256k1/v4" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/errors" "github.com/ecadlabs/signatory/pkg/utils" "github.com/ecadlabs/signatory/pkg/vault" diff --git a/test/auth_test.go b/test/auth_test.go index 2c5c2339..7295ee45 100644 --- a/test/auth_test.go +++ b/test/auth_test.go @@ -11,9 +11,9 @@ import ( "strings" "testing" + "github.com/ecadlabs/gotez/v2/crypt" "github.com/ecadlabs/signatory/pkg/auth" "github.com/ecadlabs/signatory/pkg/config" - "github.com/ecadlabs/signatory/pkg/crypt" "github.com/ecadlabs/signatory/pkg/hashmap" "github.com/ecadlabs/signatory/pkg/server" "github.com/ecadlabs/signatory/pkg/signatory" From 5526a4564a1b5067d673f92d970ae554f6ecf1bc Mon Sep 17 00:00:00 2001 From: Eugene Zagidullin Date: Tue, 23 Jan 2024 22:21:03 +0200 Subject: [PATCH 3/5] rebuild go.sum --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index f19de634..38859162 100644 --- a/go.sum +++ b/go.sum @@ -52,8 +52,6 @@ github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcP github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= -github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA= -github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= From 415d3c533b7f06fbee7037cee6b9d17465b2a148 Mon Sep 17 00:00:00 2001 From: Eugene Zagidullin Date: Wed, 24 Jan 2024 19:22:14 +0200 Subject: [PATCH 4/5] more renamed ops --- pkg/signatory/signatory.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/signatory/signatory.go b/pkg/signatory/signatory.go index 5480b839..2d8d1175 100644 --- a/pkg/signatory/signatory.go +++ b/pkg/signatory/signatory.go @@ -656,10 +656,18 @@ func PreparePolicy(src config.TezosConfig) (out Policy, err error) { if core.CompareProtocols(&latest.Protocol, &core.Proto018Proxford) >= 0 { for i, o := range pol.AllowedOps { - if o == "endorsement" { + switch o { + case "endorsement": pol.AllowedOps[i] = "attestation" + case "preendorsement": + pol.AllowedOps[i] = "preattestation" + case "double_endorsement_evidence": + pol.AllowedOps[i] = "double_attestation_evidence" + case "double_preendorsement_evidence": + pol.AllowedOps[i] = "double_preattestation_evidence" } } + sort.Strings(pol.AllowedOps) } if v.AuthorizedKeys != nil { From 8ec38d60eb4c26363d65103ddcba59290898f43b Mon Sep 17 00:00:00 2001 From: Eugene Zagidullin Date: Wed, 24 Jan 2024 20:12:12 +0200 Subject: [PATCH 5/5] integration test updated --- integration_test/cli_test.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/integration_test/cli_test.go b/integration_test/cli_test.go index 7d522d08..799b157d 100644 --- a/integration_test/cli_test.go +++ b/integration_test/cli_test.go @@ -40,26 +40,40 @@ func TestCliListOps(t *testing.T) { assert.Nil(t, err) require.Contains(t, string(out), "Possible operation types:") require.Contains(t, string(out), "- activate_account") + require.Contains(t, string(out), "- attestation") require.Contains(t, string(out), "- ballot") + require.Contains(t, string(out), "- dal_attestation") + require.Contains(t, string(out), "- dal_publish_slot_header") require.Contains(t, string(out), "- delegation") + require.Contains(t, string(out), "- double_attestation_evidence") require.Contains(t, string(out), "- double_baking_evidence") - require.Contains(t, string(out), "- double_endorsement_evidence") - require.Contains(t, string(out), "- double_preendorsement_evidence") + require.Contains(t, string(out), "- double_preattestation_evidence") require.Contains(t, string(out), "- drain_delegate") - require.Contains(t, string(out), "- endorsement") - require.Contains(t, string(out), "- endorsement_with_slot") require.Contains(t, string(out), "- failing_noop") require.Contains(t, string(out), "- increase_paid_storage") require.Contains(t, string(out), "- origination") - require.Contains(t, string(out), "- preendorsement") + require.Contains(t, string(out), "- preattestation") require.Contains(t, string(out), "- proposals") require.Contains(t, string(out), "- register_global_constant") require.Contains(t, string(out), "- reveal") require.Contains(t, string(out), "- seed_nonce_revelation") require.Contains(t, string(out), "- set_deposits_limit") + require.Contains(t, string(out), "- signature_prefix") + require.Contains(t, string(out), "- smart_rollup_add_messages") + require.Contains(t, string(out), "- smart_rollup_cement") + require.Contains(t, string(out), "- smart_rollup_execute_outbox_message") + require.Contains(t, string(out), "- smart_rollup_originate") + require.Contains(t, string(out), "- smart_rollup_publish") + require.Contains(t, string(out), "- smart_rollup_recover_bond") + require.Contains(t, string(out), "- smart_rollup_refute") + require.Contains(t, string(out), "- smart_rollup_timeout") require.Contains(t, string(out), "- transaction") + require.Contains(t, string(out), "- transfer_ticket") require.Contains(t, string(out), "- update_consensus_key") require.Contains(t, string(out), "- vdf_revelation") + require.Contains(t, string(out), "- zk_rollup_origination") + require.Contains(t, string(out), "- zk_rollup_publish") + require.Contains(t, string(out), "- zk_rollup_update") } func TestCliListRequests(t *testing.T) { @@ -110,5 +124,6 @@ func TestCliVersion(t *testing.T) { require.Contains(t, string(v), "Release Version: ") require.Greater(t, len(v), len("Release Version: ")+4) version, err := SignatoryCli("version") + assert.Nil(t, err) require.Equal(t, v, version) }