From cb594ed2e0f60707b09433405d339c1d155f4217 Mon Sep 17 00:00:00 2001 From: max furman Date: Mon, 17 Aug 2020 13:46:30 -0700 Subject: [PATCH] go mod tidy and golang 1.15.0 cleanup ... - cs.NegotiatedProtocolIsMutual has been deprecated but we still build in travis with 1.14 so for now we'll ignore this linting error - string(int) was resolving to string of a single rune rather than string of digits -> use fmt.Sprint --- .golangci.yml | 1 + authority/tls.go | 3 ++- authority/tls_test.go | 2 +- go.mod | 6 ++++-- go.sum | 7 +++++++ 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0aed855d..1bab3ba3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,6 +64,7 @@ issues: - should have a package comment, unless it's in another file for this package - error strings should not be capitalized or end with punctuation or a newline - Wrapf call needs 1 arg but has 2 args + - cs.NegotiatedProtocolIsMutual is deprecated # golangci.com configuration # https://github.com/golangci/golangci/wiki/Configuration service: diff --git a/authority/tls.go b/authority/tls.go index 76edf360..79f962f4 100644 --- a/authority/tls.go +++ b/authority/tls.go @@ -8,6 +8,7 @@ import ( "encoding/asn1" "encoding/base64" "encoding/pem" + "fmt" "net/http" "strings" "time" @@ -294,7 +295,7 @@ func (a *Authority) Revoke(ctx context.Context, revokeOpts *RevokeOptions) error errs.WithKeyVal("reason", revokeOpts.Reason), errs.WithKeyVal("passiveOnly", revokeOpts.PassiveOnly), errs.WithKeyVal("MTLS", revokeOpts.MTLS), - errs.WithKeyVal("context", string(provisioner.MethodFromContext(ctx))), + errs.WithKeyVal("context", fmt.Sprint(provisioner.MethodFromContext(ctx))), } if revokeOpts.MTLS { opts = append(opts, errs.WithKeyVal("certificate", base64.StdEncoding.EncodeToString(revokeOpts.Crt.Raw))) diff --git a/authority/tls_test.go b/authority/tls_test.go index 90dc7075..50e618e8 100644 --- a/authority/tls_test.go +++ b/authority/tls_test.go @@ -1179,7 +1179,7 @@ func TestAuthority_Revoke(t *testing.T) { assert.Equals(t, ctxErr.Details["reasonCode"], tc.opts.ReasonCode) assert.Equals(t, ctxErr.Details["reason"], tc.opts.Reason) assert.Equals(t, ctxErr.Details["MTLS"], tc.opts.MTLS) - assert.Equals(t, ctxErr.Details["context"], string(provisioner.RevokeMethod)) + assert.Equals(t, ctxErr.Details["context"], fmt.Sprint(provisioner.RevokeMethod)) if tc.checkErrDetails != nil { tc.checkErrDetails(ctxErr) diff --git a/go.mod b/go.mod index 9095c677..3ba579a9 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,8 @@ require ( github.com/go-chi/chi v4.0.2+incompatible github.com/go-piv/piv-go v1.5.0 github.com/googleapis/gax-go/v2 v2.0.5 + github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a // indirect + github.com/lunixbochs/vtclean v1.0.0 // indirect github.com/newrelic/go-agent v2.15.0+incompatible github.com/pkg/errors v0.9.1 github.com/rs/xid v1.2.1 @@ -17,8 +19,8 @@ require ( github.com/smallstep/cli v0.15.0 github.com/smallstep/nosql v0.3.0 github.com/urfave/cli v1.22.2 - go.step.sm/crypto v0.0.0-20200805202904-ec18b6df3cf0 - golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 + go.step.sm/crypto v0.1.1 + golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 golang.org/x/net v0.0.0-20200202094626-16171245cfb2 google.golang.org/api v0.15.0 google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb diff --git a/go.sum b/go.sum index 4a29e13f..564c831c 100644 --- a/go.sum +++ b/go.sum @@ -479,10 +479,13 @@ github.com/smallstep/assert v0.0.0-20200103212524-b99dc1097b15/go.mod h1:MyOHs9P github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY= github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262/go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc= github.com/smallstep/certificates v0.14.5/go.mod h1:zzpB8wMz967gL8FmK6zvCNB4pDVwFDKjPg1diTVc1h8= +github.com/smallstep/certificates v0.15.0/go.mod h1:awyVXYIVn4J9ANSSnDuA3FjKia7+QixaqorGW8CKGq8= github.com/smallstep/certinfo v1.3.0/go.mod h1:1gQJekdPwPvUwFWGTi7bZELmQT09cxC9wJ0VBkBNiwU= github.com/smallstep/cli v0.14.5/go.mod h1:mRFuqC3cGwQESBGJvog4o76jZZZ7bMjkE+hAnq2QyR8= github.com/smallstep/cli v0.14.7-rc.1.0.20200727165646-eb4e97335f2d h1:bDnvzyEXzAMO5in8QHRrQCEUopiXjFVKHiR8c0m7Iww= github.com/smallstep/cli v0.14.7-rc.1.0.20200727165646-eb4e97335f2d/go.mod h1:7aWHk7WwJMpEP4PYyav86FMpaI9vuA0uJRliUAqCwxg= +github.com/smallstep/cli v0.15.0 h1:ZBU1o4vm4FvcOFnfiT09jxuE/OsZX1BsZl5E/l2gv/c= +github.com/smallstep/cli v0.15.0/go.mod h1:trYpP49s+XF4fROcNgmPi4yO1EIKfqsc/eEck6SosO4= github.com/smallstep/nosql v0.3.0 h1:V1X5vfDsDt89499h3jZFUlR4VnnsYYs5tXaQZ0w8z5U= github.com/smallstep/nosql v0.3.0/go.mod h1:QG7gNOpidifn99MjZaiNbm7HPesIyBd97F/OfacNz8Q= github.com/smallstep/truststore v0.9.3/go.mod h1:PRSkpRIhAYBK/KLWkHNgRdYgzWMEy45bN7PSJCfKKGE= @@ -561,6 +564,8 @@ go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.step.sm/crypto v0.0.0-20200805202904-ec18b6df3cf0 h1:FymMl8TrXGxFf80BWpO0CnkSfLnw0BkDdRrhbMGf5zE= go.step.sm/crypto v0.0.0-20200805202904-ec18b6df3cf0/go.mod h1:8VYxmvSKt5yOTBx3MGsD2Gk4F1Es/3FIxrjnfeYWE8U= +go.step.sm/crypto v0.1.1 h1:xg3kUS30hEnwgbxtKwq9a4MJaeiU616HSug60LU9B2E= +go.step.sm/crypto v0.1.1/go.mod h1:cIoSWTfTQ5xqvwTeZH9ZXZzi6jdMepjK4A/TDWMUvw8= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.5.1/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -583,6 +588,8 @@ golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904 h1:bXoxMPcSLOq08zI3/c5dEBT6lE4eh+jOh886GHrn6V8= golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= +golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=