diff --git a/Makefile b/Makefile index 2a87d5fc..9a302e2f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PROJECT := github.com/juju/utils/v3 +PROJECT := github.com/juju/utils/v4 .PHONY: check-licence check-go check diff --git a/arch/arch_test.go b/arch/arch_test.go index b16c2f15..a73590b2 100644 --- a/arch/arch_test.go +++ b/arch/arch_test.go @@ -7,7 +7,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/arch" + "github.com/juju/utils/v4/arch" ) type archSuite struct { diff --git a/attempt_test.go b/attempt_test.go index 17f5dbb7..5371f8ef 100644 --- a/attempt_test.go +++ b/attempt_test.go @@ -8,7 +8,7 @@ import ( gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) func doSomething() (int, error) { return 0, nil } diff --git a/bzr/bzr_test.go b/bzr/bzr_test.go index 42bcd9cc..cd1773c3 100644 --- a/bzr/bzr_test.go +++ b/bzr/bzr_test.go @@ -15,7 +15,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/bzr" + "github.com/juju/utils/v4/bzr" ) func Test(t *stdtesting.T) { diff --git a/cache/cache_test.go b/cache/cache_test.go index a1a05111..3619dc01 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -11,7 +11,7 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/errgo.v1" - "github.com/juju/utils/v3/cache" + "github.com/juju/utils/v4/cache" ) type suite struct{} diff --git a/cert/cert.go b/cert/cert.go index 277f531f..dde55c71 100644 --- a/cert/cert.go +++ b/cert/cert.go @@ -5,9 +5,11 @@ package cert import ( + "crypto" + "crypto/ed25519" "crypto/rand" - "crypto/rsa" "crypto/sha1" + "crypto/sha512" "crypto/tls" "crypto/x509" "crypto/x509/pkix" @@ -48,7 +50,6 @@ type Config struct { IsCA bool // IsCA if we want to generate new a CA cert Hostnames []string // Hostnames , list of hostnames for the certificate ExtKeyUsage []x509.ExtKeyUsage // ExtKeyUsage extra flags for special usage of the cert - KeyBits int // KeyBits is used to set the lenght of the RSA key, default value 2048 bytes Client bool // generate client certificate for certificate authentication } @@ -58,7 +59,7 @@ type Config struct { func NewLeaf(cfg *Config) (certPEM, keyPEM string, err error) { var ( caCert *x509.Certificate - caKey *rsa.PrivateKey + caKey ed25519.PrivateKey ) if cfg.CA != nil && cfg.CAKey != nil && !cfg.IsCA { @@ -78,19 +79,14 @@ func NewLeaf(cfg *Config) (certPEM, keyPEM string, err error) { return "", "", errors.Errorf("CA certificate is not a valid CA") } var ok bool - caKey, ok = tlsCert.PrivateKey.(*rsa.PrivateKey) + caKey, ok = tlsCert.PrivateKey.(ed25519.PrivateKey) if !ok { return "", "", errors.Errorf("CA private key has unexpected type %T", tlsCert.PrivateKey) } } - // if none assign default - if cfg.KeyBits == 0 { - cfg.KeyBits = 2048 - } - // generate private key - key, err := rsa.GenerateKey(rand.Reader, cfg.KeyBits) + _, key, err := ed25519.GenerateKey(rand.Reader) if err != nil { return "", "", errors.Errorf("cannot generate key: %v", err) } @@ -121,7 +117,7 @@ func NewLeaf(cfg *Config) (certPEM, keyPEM string, err error) { NotBefore: now.UTC().AddDate(0, 0, -7), Version: 2, NotAfter: cfg.Expiry.UTC(), - SubjectKeyId: bigIntHash(key.N), + SubjectKeyId: sha512.New384().Sum(key), KeyUsage: x509.KeyUsageKeyEncipherment | x509.KeyUsageDigitalSignature | x509.KeyUsageKeyAgreement, ExtKeyUsage: cfg.ExtKeyUsage, } @@ -161,9 +157,13 @@ func NewLeaf(cfg *Config) (certPEM, keyPEM string, err error) { Bytes: certDER, }) + keyData, err := x509.MarshalPKCS8PrivateKey(key) + if err != nil { + return "", "", err + } keyPEMData := pem.EncodeToMemory(&pem.Block{ - Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(key), + Type: "PRIVATE KEY", + Bytes: keyData, }) return string(certPEMData), string(keyPEMData), nil } @@ -185,7 +185,6 @@ func NewCA(commonName, UUID string, expiry time.Time, keyBits int) (certPEM, key UUID: UUID, Expiry: expiry, IsCA: true, - KeyBits: keyBits, }) if err != nil { return "", "", errors.Annotatef(err, "cannot generate ca certificate") @@ -194,13 +193,12 @@ func NewCA(commonName, UUID string, expiry time.Time, keyBits int) (certPEM, key } // NewClientCert generates a x509 client certificate used for https authentication sessions. -func NewClientCert(commonName, UUID string, expiry time.Time, keyBits int) (certPEM string, keyPEM string, err error) { +func NewClientCert(commonName, UUID string, expiry time.Time) (certPEM string, keyPEM string, err error) { certPEM, keyPEM, err = NewLeaf(&Config{ CommonName: commonName, UUID: UUID, Expiry: expiry, ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth}, - KeyBits: keyBits, Client: true, }) if err != nil { @@ -249,7 +247,7 @@ func newSerialNumber() (*big.Int, error) { // this will return nil if the key is not RSA type func getPublicKey(p interface{}) interface{} { switch t := p.(type) { - case *rsa.PrivateKey: + case ed25519.PrivateKey: return t.Public() default: return nil @@ -275,7 +273,7 @@ func ParseCert(certPEM string) (*x509.Certificate, error) { // ParseCertAndKey parses the given PEM-formatted X509 certificate // and RSA private key. -func ParseCertAndKey(certPEM, keyPEM string) (*x509.Certificate, *rsa.PrivateKey, error) { +func ParseCertAndKey(certPEM, keyPEM string) (*x509.Certificate, crypto.Signer, error) { tlsCert, err := tls.X509KeyPair([]byte(certPEM), []byte(keyPEM)) if err != nil { return nil, nil, err @@ -286,9 +284,9 @@ func ParseCertAndKey(certPEM, keyPEM string) (*x509.Certificate, *rsa.PrivateKey return nil, nil, err } - key, ok := tlsCert.PrivateKey.(*rsa.PrivateKey) + key, ok := tlsCert.PrivateKey.(crypto.Signer) if !ok { - return nil, nil, fmt.Errorf("private key with unexpected type %T", key) + return nil, nil, fmt.Errorf("private key with unexpected type %T", tlsCert.PrivateKey) } return cert, key, nil } diff --git a/cert/cert_test.go b/cert/cert_test.go index 10f2638f..346092fb 100644 --- a/cert/cert_test.go +++ b/cert/cert_test.go @@ -5,7 +5,7 @@ package cert_test import ( - "crypto/rsa" + "crypto/ed25519" "crypto/x509" "crypto/x509/pkix" "fmt" @@ -13,8 +13,9 @@ import ( "time" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3/cert" gc "gopkg.in/check.v1" + + "github.com/juju/utils/v4/cert" ) func TestAll(t *testing.T) { @@ -58,7 +59,7 @@ func (certSuite) TestParseCertAndKey(c *gc.C) { c.Assert(xcert.Subject.CommonName, gc.Equals, `juju-generated CA for model "juju testing"`) c.Assert(key, gc.NotNil) - c.Assert(xcert.PublicKey.(*rsa.PublicKey), gc.DeepEquals, &key.PublicKey) + c.Assert(xcert.PublicKey, gc.DeepEquals, key.Public()) } func (certSuite) TestNewCA(c *gc.C) { @@ -73,7 +74,7 @@ func (certSuite) TestNewCA(c *gc.C) { caCert, caKey, err := cert.ParseCertAndKey(caCertPEM, caKeyPEM) c.Assert(err, jc.ErrorIsNil) - c.Check(caKey, gc.FitsTypeOf, (*rsa.PrivateKey)(nil)) + c.Check(caKey, gc.FitsTypeOf, (ed25519.PrivateKey)(nil)) c.Check(caCert.Subject.CommonName, gc.Equals, `juju-generated CA for model foo`) checkNotBefore(c, caCert, now) checkNotAfter(c, caCert, expiry) @@ -87,43 +88,38 @@ func roundTime(t time.Time) time.Time { return t.Add(time.Duration(-t.Nanosecond())) } -var rsaByteSizes = []int{512, 1024, 2048, 4096} - -func (certSuite) TestNewClientCertRSASize(c *gc.C) { - for _, size := range rsaByteSizes { - now := time.Now() - expiry := roundTime(now.AddDate(0, 0, 1)) - certPem, privPem, err := cert.NewClientCert( - fmt.Sprintf("juju-generated CA for model %s", "foo"), "1", expiry, size) - - c.Assert(err, jc.ErrorIsNil) - c.Assert(certPem, gc.NotNil) - c.Assert(privPem, gc.NotNil) - - caCert, caKey, err := cert.ParseCertAndKey(certPem, privPem) - c.Assert(err, jc.ErrorIsNil) - c.Check(caCert.Subject.CommonName, gc.Equals, "juju-generated CA for model foo") - c.Check(caCert.Subject.Organization, gc.DeepEquals, []string{"juju"}) - c.Check(caCert.Subject.SerialNumber, gc.DeepEquals, "1") - - c.Check(caKey, gc.FitsTypeOf, (*rsa.PrivateKey)(nil)) - c.Check(caCert.Version, gc.Equals, 3) - - value, err := cert.CertGetUPNExtenstionValue(caCert.Subject) - c.Assert(err, jc.ErrorIsNil) - c.Assert(value, gc.Not(gc.IsNil)) - - c.Assert(caCert.Extensions[len(caCert.Extensions)-1], jc.DeepEquals, pkix.Extension{ - Id: cert.CertSubjAltName, - Value: value, - Critical: false, - }) - c.Assert(caCert.PublicKeyAlgorithm, gc.Equals, x509.RSA) - c.Assert(caCert.ExtKeyUsage[0], gc.Equals, x509.ExtKeyUsageClientAuth) - checkNotBefore(c, caCert, now) - checkNotAfter(c, caCert, expiry) - - } +func (certSuite) TestNewClientCert(c *gc.C) { + now := time.Now() + expiry := roundTime(now.AddDate(0, 0, 1)) + certPem, privPem, err := cert.NewClientCert( + fmt.Sprintf("juju-generated CA for model %s", "foo"), "1", expiry) + + c.Assert(err, jc.ErrorIsNil) + c.Assert(certPem, gc.NotNil) + c.Assert(privPem, gc.NotNil) + + caCert, caKey, err := cert.ParseCertAndKey(certPem, privPem) + c.Assert(err, jc.ErrorIsNil) + c.Check(caCert.Subject.CommonName, gc.Equals, "juju-generated CA for model foo") + c.Check(caCert.Subject.Organization, gc.DeepEquals, []string{"juju"}) + c.Check(caCert.Subject.SerialNumber, gc.DeepEquals, "1") + + c.Check(caKey, gc.FitsTypeOf, (ed25519.PrivateKey)(nil)) + c.Check(caCert.Version, gc.Equals, 3) + + value, err := cert.CertGetUPNExtenstionValue(caCert.Subject) + c.Assert(err, jc.ErrorIsNil) + c.Assert(value, gc.Not(gc.IsNil)) + + c.Assert(caCert.Extensions[len(caCert.Extensions)-1], jc.DeepEquals, pkix.Extension{ + Id: cert.CertSubjAltName, + Value: value, + Critical: false, + }) + c.Assert(caCert.PublicKeyAlgorithm, gc.Equals, x509.Ed25519) + c.Assert(caCert.ExtKeyUsage[0], gc.Equals, x509.ExtKeyUsageClientAuth) + checkNotBefore(c, caCert, now) + checkNotAfter(c, caCert, expiry) } var ( diff --git a/command_test.go b/command_test.go index 4504642f..ef8698d6 100644 --- a/command_test.go +++ b/command_test.go @@ -11,7 +11,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type EnvironmentPatcher interface { diff --git a/context_test.go b/context_test.go index fcb1a13b..e28f188d 100644 --- a/context_test.go +++ b/context_test.go @@ -13,7 +13,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type contextSuite struct{} diff --git a/errors.go b/errors.go new file mode 100644 index 00000000..45561f7f --- /dev/null +++ b/errors.go @@ -0,0 +1,32 @@ +// Copyright 2024 Canonical Ltd. +// Licensed under the LGPLv3, see LICENCE file for details. + +package utils + +import ( + "fmt" +) + +// RcPassthroughError indicates that a Juju plugin command exited with a +// non-zero exit code. This error is used to exit with the return code. +type RcPassthroughError struct { + Code int +} + +// Error implements error. +func (e *RcPassthroughError) Error() string { + return fmt.Sprintf("subprocess encountered error code %v", e.Code) +} + +// IsRcPassthroughError returns whether the error is an RcPassthroughError. +func IsRcPassthroughError(err error) bool { + _, ok := err.(*RcPassthroughError) + return ok +} + +// NewRcPassthroughError creates an error that will have the code used at the +// return code from the cmd.Main function rather than the default of 1 if +// there is an error. +func NewRcPassthroughError(code int) error { + return &RcPassthroughError{code} +} diff --git a/exec/exec.go b/exec/exec.go index e19bab64..3e2d9db1 100644 --- a/exec/exec.go +++ b/exec/exec.go @@ -18,7 +18,7 @@ import ( "github.com/juju/clock" "github.com/juju/errors" - "github.com/juju/loggo" + "github.com/juju/loggo/v2" ) var logger = loggo.GetLogger("juju.util.exec") diff --git a/exec/exec_linux_test.go b/exec/exec_linux_test.go index 8bdcba9d..9d413133 100644 --- a/exec/exec_linux_test.go +++ b/exec/exec_linux_test.go @@ -7,7 +7,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/exec" + "github.com/juju/utils/v4/exec" ) // 0 is thrown by linux because RunParams.Wait diff --git a/exec/exec_test.go b/exec/exec_test.go index 78b05baa..22eb3a2e 100644 --- a/exec/exec_test.go +++ b/exec/exec_test.go @@ -14,7 +14,7 @@ import ( gc "gopkg.in/check.v1" "github.com/juju/clock" - "github.com/juju/utils/v3/exec" + "github.com/juju/utils/v4/exec" ) type execSuite struct { diff --git a/exec/exec_windows_test.go b/exec/exec_windows_test.go index 49adf9c2..483022cc 100644 --- a/exec/exec_windows_test.go +++ b/exec/exec_windows_test.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/exec" + "github.com/juju/utils/v4/exec" ) // 1 is thrown by powershell after the a command is cancelled diff --git a/file_test.go b/file_test.go index 081c37c2..7d4a352f 100644 --- a/file_test.go +++ b/file_test.go @@ -14,7 +14,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type fileSuite struct { diff --git a/file_unix_test.go b/file_unix_test.go index 12dbf41b..64b5b1a4 100644 --- a/file_unix_test.go +++ b/file_unix_test.go @@ -15,7 +15,8 @@ import ( gc "gopkg.in/check.v1" "github.com/juju/errors" - "github.com/juju/utils/v3" + + "github.com/juju/utils/v4" ) type unixFileSuite struct { diff --git a/file_windows_test.go b/file_windows_test.go index d35f8c35..64449f4d 100644 --- a/file_windows_test.go +++ b/file_windows_test.go @@ -10,7 +10,7 @@ package utils_test import ( gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type windowsFileSuite struct { diff --git a/filepath/common_test.go b/filepath/common_test.go index 383ef6c0..fabaadfc 100644 --- a/filepath/common_test.go +++ b/filepath/common_test.go @@ -7,7 +7,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) var _ = gc.Suite(&commonSuite{}) diff --git a/filepath/filepath.go b/filepath/filepath.go index a34bf6bd..de7378ff 100644 --- a/filepath/filepath.go +++ b/filepath/filepath.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/juju/errors" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) // Renderer provides methods for the different functions in diff --git a/filepath/filepath_test.go b/filepath/filepath_test.go index 9431d8ca..be4881c0 100644 --- a/filepath/filepath_test.go +++ b/filepath/filepath_test.go @@ -9,10 +9,10 @@ import ( "github.com/juju/errors" "github.com/juju/testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) type filepathSuite struct { diff --git a/filepath/stdlib_test.go b/filepath/stdlib_test.go index b7e6df4c..1e757ac6 100644 --- a/filepath/stdlib_test.go +++ b/filepath/stdlib_test.go @@ -12,7 +12,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) // The tests here are mostly just sanity checks against the behavior diff --git a/filepath/unix_test.go b/filepath/unix_test.go index 0659341f..4b13f8a3 100644 --- a/filepath/unix_test.go +++ b/filepath/unix_test.go @@ -10,7 +10,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) var _ = gc.Suite(&unixSuite{}) diff --git a/filepath/win_test.go b/filepath/win_test.go index 2ddfa38b..ec1054da 100644 --- a/filepath/win_test.go +++ b/filepath/win_test.go @@ -10,7 +10,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) var _ = gc.Suite(&windowsSuite{}) diff --git a/filestorage/fakes_test.go b/filestorage/fakes_test.go index db1c1759..dd954c49 100644 --- a/filestorage/fakes_test.go +++ b/filestorage/fakes_test.go @@ -10,7 +10,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filestorage" + "github.com/juju/utils/v4/filestorage" ) // FakeMetadataStorage is used as a DocStorage and MetadataStorage for diff --git a/filestorage/metadata_test.go b/filestorage/metadata_test.go index bd7ddde1..74ec2951 100644 --- a/filestorage/metadata_test.go +++ b/filestorage/metadata_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filestorage" + "github.com/juju/utils/v4/filestorage" ) var ( diff --git a/filestorage/wrapper_test.go b/filestorage/wrapper_test.go index 9adcc0dc..d9df5e1c 100644 --- a/filestorage/wrapper_test.go +++ b/filestorage/wrapper_test.go @@ -13,7 +13,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/filestorage" + "github.com/juju/utils/v4/filestorage" ) var _ = gc.Suite(&WrapperSuite{}) diff --git a/fs/copy_test.go b/fs/copy_test.go index 809dac93..780d2b9e 100644 --- a/fs/copy_test.go +++ b/fs/copy_test.go @@ -10,7 +10,7 @@ import ( ft "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/fs" + "github.com/juju/utils/v4/fs" ) type copySuite struct{} diff --git a/go.mod b/go.mod index 1698dcfa..a26db0d3 100644 --- a/go.mod +++ b/go.mod @@ -1,47 +1,46 @@ -module github.com/juju/utils/v3 +module github.com/juju/utils/v4 -go 1.17 +go 1.21 require ( - github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a - github.com/juju/cmd/v3 v3.0.0-20220202061353-b1cc80b193b0 - github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a - github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 - github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 - github.com/juju/mutex/v2 v2.0.0-20220203023141-11eeddb42c6c - github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 - github.com/masterzen/winrm v0.0.0-20211231115050-232efb40349e - golang.org/x/crypto v0.1.0 - golang.org/x/net v0.7.0 - golang.org/x/text v0.7.0 + github.com/juju/clock v1.0.3 + github.com/juju/collections v1.0.4 + github.com/juju/errors v1.0.0 + github.com/juju/loggo/v2 v2.0.0 + github.com/juju/mutex/v2 v2.0.0 + github.com/juju/testing v1.2.0 + github.com/masterzen/winrm v0.0.0-20231227165926-e811dad5ac77 + golang.org/x/crypto v0.19.0 + golang.org/x/net v0.21.0 + golang.org/x/text v0.14.0 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c - gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5 + gopkg.in/errgo.v1 v1.0.1 gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 gopkg.in/yaml.v2 v2.4.0 ) require ( - github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e // indirect + github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 // indirect - github.com/gofrs/uuid v4.2.0+incompatible // indirect - github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/bodgit/ntlmssp v0.0.0-20231122144230-2b2bca29f22b // indirect + github.com/bodgit/windows v1.0.1 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/gofrs/uuid v4.4.0+incompatible // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect - github.com/jcmturner/gofork v1.0.0 // indirect + github.com/jcmturner/gofork v1.7.6 // indirect github.com/jcmturner/goidentity/v6 v6.0.1 // indirect - github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.4 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect - github.com/juju/ansiterm v0.0.0-20210706145210-9283cdf370b5 // indirect - github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d // indirect - github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 // indirect - github.com/juju/retry v0.0.0-20180821225755-9058e192b216 // indirect - github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/juju/loggo v1.0.0 // indirect + github.com/juju/utils/v3 v3.1.0 // indirect + github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/lunixbochs/vtclean v1.0.0 // indirect github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 // indirect - github.com/mattn/go-colorable v0.1.8 // indirect - github.com/mattn/go-isatty v0.0.13 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/term v0.5.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect + github.com/tidwall/transform v0.0.0-20201103190739-32f242e2dbde // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 9b402733..dec34a95 100644 --- a/go.sum +++ b/go.sum @@ -1,205 +1,150 @@ -github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e h1:ZU22z/2YRFLyf/P4ZwUYSdNCWsMEI0VeyrFoI2rAhJQ= -github.com/Azure/go-ntlmssp v0.0.0-20211209120228-48547f28849e/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8= +github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6 h1:w0E0fgc1YafGEh5cROhlROMWXiNoZqApk2PDN0M1+Ns= github.com/ChrisTrenkamp/goxpath v0.0.0-20210404020558-97928f7e12b6/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= +github.com/bodgit/ntlmssp v0.0.0-20231122144230-2b2bca29f22b h1:/rxp4dz0wtk+sumWvQpaUft0yM+YqPegRgKxqU3MXBE= +github.com/bodgit/ntlmssp v0.0.0-20231122144230-2b2bca29f22b/go.mod h1:t46HDKvw4bCyAsVTayprrRiC9UItu18q9Zo29vTGN10= +github.com/bodgit/windows v1.0.1 h1:tF7K6KOluPYygXa3Z2594zxlkbKPAOvqr97etrGNIz4= +github.com/bodgit/windows v1.0.1/go.mod h1:a6JLwrB4KrTR5hBpp8FI9/9W9jJfeQ2h4XDXU74ZCdM= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/frankban/quicktest v1.2.2 h1:xfmOhhoH5fGPgbEAlhLpJH9p0z/0Qizio9osmvn9IUY= +github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= -github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +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/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1 h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= -github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= -github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= -github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/gofork v1.7.6 h1:QH0l3hzAU1tfT3rZCnW5zXl+orbkNMMRGJfdJjHVETg= +github.com/jcmturner/gofork v1.7.6/go.mod h1:1622LH6i/EZqLloHfE7IeZ0uEJwMSUyQ/nDd82IeqRo= github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= -github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= -github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/gokrb5/v8 v8.4.4 h1:x1Sv4HaTpepFkXbt2IkL29DXRf8sOfZXo8eRKh687T8= +github.com/jcmturner/gokrb5/v8 v8.4.4/go.mod h1:1btQEpgT6k+unzCwX1KdWMEwPPkkgBtP+F6aCACiMrs= github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= -github.com/juju/ansiterm v0.0.0-20160907234532-b99631de12cf/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/ansiterm v0.0.0-20210706145210-9283cdf370b5 h1:Q5klzs6BL5FkassBX65t+KkG0XjYcjxEm+GNcQAsuaw= -github.com/juju/ansiterm v0.0.0-20210706145210-9283cdf370b5/go.mod h1:UJSiEoRfvx3hP73CvoARgeLjaIOjybY9vj8PUPPFGeU= -github.com/juju/clock v0.0.0-20190205081909-9c5c9712527c/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/clock v0.0.0-20220202072423-1b0f830854c4/go.mod h1:zDZCPSgCJQINeZtQwHx2/cFk4seaBC8Yiqe8V82xiP0= -github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a h1:Az/6CM/P5guGHNy7r6TkOCctv3lDmN3W1uhku7QMupk= -github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a/go.mod h1:GZ/FY8Cqw3KHG6DwRVPUKbSPTAwyrU28xFi5cqZnLsc= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0 h1:kMNSBOBQHgDocCDaItn5Gw/nR6P1RwqB/QyLtINvAMY= -github.com/juju/cmd v0.0.0-20171107070456-e74f39857ca0/go.mod h1:yWJQHl73rdSX4DHVKGqkAip+huBslxRwS8m9CrOLq18= -github.com/juju/cmd/v3 v3.0.0-20220202061353-b1cc80b193b0 h1:DZ0mfFDpt4SXi+krwruQw3y9wbUn3tM5Jyp2bS9iRDg= -github.com/juju/cmd/v3 v3.0.0-20220202061353-b1cc80b193b0/go.mod h1:EoGJiEG+vbMwO9l+Es0SDTlaQPjH6nLcnnc4NfZB3cY= -github.com/juju/collections v0.0.0-20200605021417-0d0ec82b7271/go.mod h1:5XgO71dV1JClcOJE+4dzdn4HrI5LiyKd7PlVG6eZYhY= -github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a h1:d7eZO8OS/ZXxdP0uq3E8CdoA1qNFaecAv90UxrxaY2k= -github.com/juju/collections v0.0.0-20220203020748-febd7cad8a7a/go.mod h1:JWeZdyttIEbkR51z2S13+J+aCuHVe0F6meRy+P0YGDo= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20200330140219-3fe23663418f/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff/go.mod h1:i1eL7XREII6aHpQ2gApI/v6FkVUDEBremNkcBCKYAcY= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9 h1:EJHbsNpQyupmMeWTq7inn+5L/WZ7JfzCVPJ+DP9McCQ= -github.com/juju/errors v0.0.0-20220203013757-bd733f3c86b9/go.mod h1:TRm7EVGA3mQOqSVcBySRY7a9Y1/gyVhh/WTCnc5sD4U= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d h1:c93kUJDtVAXFEhsCh5jSxyOJmFHuzcihnslQiX8Urwo= -github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= -github.com/juju/httpprof v0.0.0-20141217160036-14bf14c30767/go.mod h1:+MaLYz4PumRkkyHYeXJ2G5g5cIW0sli2bOfpmbaMV/g= -github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20200526014432-9ce3a2e09b5e/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 h1:NO5tuyw++EGLnz56Q8KMyDZRwJwWO8jQnj285J3FOmY= -github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208 h1:/WiCm+Vpj87e4QWuWwPD/bNE9kDrWCLvPBHOQNcG2+A= -github.com/juju/mgo/v2 v2.0.0-20210302023703-70d5d206e208/go.mod h1:0OChplkvPTZ174D2FYZXg4IB9hbEwyHkD+zT+/eK+Fg= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a h1:fFpWkIPzpzxd3CC+qfU5adsawpG371Ie4TmRkhxwyNU= -github.com/juju/mutex v0.0.0-20171110020013-1fe2a4bf0a3a/go.mod h1:Y3oOzHH8CQ0Ppt0oCKJ2JFO81/EsWenH5AEqigLH+yY= -github.com/juju/mutex/v2 v2.0.0-20220128011612-57176ebdcfa3/go.mod h1:TTCG9BJD9rCC4DZFz3jA0QvCqFDHw8Eqz0jstwY7RTQ= -github.com/juju/mutex/v2 v2.0.0-20220203023141-11eeddb42c6c h1:+wSxXZCFPw3Bs5ij3ZMV0njIKGVwl4+Ftb5vb0ij+7Y= -github.com/juju/mutex/v2 v2.0.0-20220203023141-11eeddb42c6c/go.mod h1:jwCfBs/smYDaeZLqeaCi8CB8M+tOes4yf827HoOEoqk= -github.com/juju/retry v0.0.0-20151029024821-62c620325291/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216 h1:/eQL7EJQKFHByJe3DeE8Z36yqManj9UY5zppDoQi4FU= -github.com/juju/retry v0.0.0-20180821225755-9058e192b216/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= -github.com/juju/testing v0.0.0-20180402130637-44801989f0f7/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20180517134105-72703b1e95eb/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= -github.com/juju/testing v0.0.0-20210302031854-2c7ee8570c07/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/testing v0.0.0-20210324180055-18c50b0c2098/go.mod h1:7lxZW0B50+xdGFkvhAb8bwAGt6IU87JB1H9w4t8MNVM= -github.com/juju/testing v0.0.0-20220202055744-1ad0816210a6/go.mod h1:QgWc2UdIPJ8t3rnvv95tFNOsQDfpXYEZDbP281o3b2c= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494 h1:XEDzpuZb8Ma7vLja3+5hzUqVTvAqm5Y+ygvnDs5iTMM= -github.com/juju/testing v0.0.0-20220203020004-a0ff61f03494/go.mod h1:rUquetT0ALL48LHZhyRGvjjBH8xZaZ8dFClulKK5wK4= -github.com/juju/utils v0.0.0-20180424094159-2000ea4ff043/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647 h1:wQpkHVbIIpz1PCcLYku9KFWsJ7aEMQXHBBmLy3tRBTk= -github.com/juju/utils v0.0.0-20200116185830-d40c2fe10647/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/utils/v2 v2.0.0-20200923005554-4646bfea2ef1/go.mod h1:fdlDtQlzundleLLz/ggoYinEt/LmnrpNKcNTABQATNI= -github.com/juju/utils/v3 v3.0.0-20220130232349-cd7ecef0e94a/go.mod h1:LzwbbEN7buYjySp4nqnti6c6olSqRXUk6RkbSUUP1n8= -github.com/juju/utils/v3 v3.0.0-20220202114721-338bb0530e89/go.mod h1:wf5w+8jyTh2IYnSX0sHnMJo4ZPwwuiBWn+xN3DkQg4k= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20180108022336-b64dbd566305/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6 h1:nrqc9b4YKpKV4lPI3GPPFbo5FUuxkWxgZE2Z8O4lgaw= -github.com/juju/version v0.0.0-20191219164919-81c1be00b9a6/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23 h1:wtEPbidt1VyHlb8RSztU6ySQj29FLsOQiI9XiJhXDM4= -github.com/juju/version/v2 v2.0.0-20211007103408-2e8da085dc23/go.mod h1:Ljlbryh9sYaUSGXucslAEDf0A2XUSGvDbHJgW8ps6nc= -github.com/julienschmidt/httprouter v1.1.1-0.20151013225520-77a895ad01eb/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/juju/clock v1.0.3 h1:yJHIsWXeU8j3QcBdiess09SzfiXRRrsjKPn2whnMeds= +github.com/juju/clock v1.0.3/go.mod h1:HIBvJ8kiV/n7UHwKuCkdYL4l/MDECztHR2sAvWDxxf0= +github.com/juju/collections v1.0.4 h1:GjL+aN512m2rVDqhPII7P6qB0e+iYFubz8sqBhZaZtk= +github.com/juju/collections v1.0.4/go.mod h1:hVrdB0Zwq9wIU1Fl6ItD2+UETeNeOEs+nGvJufVe+0c= +github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM= +github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8= +github.com/juju/loggo v1.0.0 h1:Y6ZMQOGR9Aj3BGkiWx7HBbIx6zNwNkxhVNOHU2i1bl0= +github.com/juju/loggo v1.0.0/go.mod h1:NIXFioti1SmKAlKNuUwbMenNdef59IF52+ZzuOmHYkg= +github.com/juju/loggo/v2 v2.0.0 h1:PzyVIn+NgoZ22QUtPgKF/lh+6SnaCOEXhcP+sE4FhOk= +github.com/juju/loggo/v2 v2.0.0/go.mod h1:647d6WvXBLj5lvka2qBvccr7vMIvF2KFkEH+0ZuFOUM= +github.com/juju/mutex/v2 v2.0.0 h1:rVmJdOaXGWF8rjcFHBNd4x57/1tks5CgXHx55O55SB0= +github.com/juju/mutex/v2 v2.0.0/go.mod h1:jwCfBs/smYDaeZLqeaCi8CB8M+tOes4yf827HoOEoqk= +github.com/juju/testing v1.2.0 h1:Q0wxjaxx4XPVEN+SgzxKr3d82pjmSBcuM3WndAU391c= +github.com/juju/testing v1.2.0/go.mod h1:lqZVzNwBKAbylGZidK77ts6kIdoOkmD52+4m0ysetPo= +github.com/juju/utils/v3 v3.1.0 h1:NrNo73oVtfr7kLP17/BDpubXwa7YEW16+Ult6z9kpHI= +github.com/juju/utils/v3 v3.1.0/go.mod h1:nAj3sHtdYfAkvnkqttTy3Xzm2HzkD9Hfgnc+upOW2Z8= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/lunixbochs/vtclean v0.0.0-20160125035106-4fbf7632a2c6/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/masterzen/azure-sdk-for-go v3.2.0-beta.0.20161014135628-ee4f0065d00c+incompatible/go.mod h1:mf8fjOu33zCqxUjuiU3I8S1lJMyEAlH+0F2+M5xl3hE= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786 h1:2ZKn+w/BJeL43sCxI2jhPLRv73oVVOjEKZjKkflyqxg= github.com/masterzen/simplexml v0.0.0-20190410153822-31eea3082786/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20161014151040-7a535cd943fc/go.mod h1:CfZSN7zwz5gJiFhZJz49Uzk7mEBHIceWmbFmYx7Hf7E= -github.com/masterzen/winrm v0.0.0-20211231115050-232efb40349e h1:au+BndCo30p6G49xKTj1ZigvPn/ekiO2Gt+V+pbujfQ= -github.com/masterzen/winrm v0.0.0-20211231115050-232efb40349e/go.mod h1:Iju3u6NzoTAvjuhsGCZc+7fReNnr/Bd6DsWj3WTokIU= -github.com/masterzen/xmlpath v0.0.0-20140218185901-13f4951698ad/go.mod h1:A0zPC53iKKKcXYxr4ROjpQRQ5FgJXtelNdSmHHuq/tY= +github.com/masterzen/winrm v0.0.0-20231227165926-e811dad5ac77 h1:psY7rHKhnfqjTEgkleIYpF1vVxVfYsUYFTO/cL5Z6xM= +github.com/masterzen/winrm v0.0.0-20231227165926-e811dad5ac77/go.mod h1:otHfftEJdo9JWGoq9GcJRaeNLp/uhqNq8JOk5lL+8Ks= github.com/mattn/go-colorable v0.0.6/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.0-20160806122752-66b8e73f3f5c/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA= -github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +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/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +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.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/tidwall/transform v0.0.0-20201103190739-32f242e2dbde h1:AMNpJRc7P+GTwVbl8DkK2I9I8BBUzNiHuH/tlxrpan0= +github.com/tidwall/transform v0.0.0-20201103190739-32f242e2dbde/go.mod h1:MvrEmduDUz4ST5pGZ7CABCnOU5f3ZiOAZzT6b1A6nX8= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/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.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +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.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= 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/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-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-20210806184541-e5e7981a1069/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-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 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.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 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= +golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 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.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 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-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/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/errgo.v1 v1.0.0-20161222125816-442357a80af5 h1:C61FEf19ZFrkIbSSCWRHvzrtgrcRh/kiH4HZ5VIIqe8= -gopkg.in/errgo.v1 v1.0.0-20161222125816-442357a80af5/go.mod h1:u0ALmqvLRxLI95fkdCEWrE6mhWYZW1aMOJHp5YXLHTg= -gopkg.in/httprequest.v1 v1.1.1/go.mod h1:/CkavNL+g3qLOrpFHVrEx4NKepeqR4XTZWNj4sGGjz0= -gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= -gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= +gopkg.in/errgo.v1 v1.0.1 h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso= +gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637/go.mod h1:BHsqpu/nsuzkT5BpiH1EMZPLyqSMM8JbIavyFACoFNk= -gopkg.in/yaml.v2 v2.0.0-20170712054546-1be3d31502d6/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/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= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087 h1:Izowp2XBH6Ya6rv+hqbceQyw/gSGoXfH/UPoTGduL54= -launchpad.net/gocheck v0.0.0-20140225173054-000000000087/go.mod h1:hj7XX3B/0A+80Vse0e+BUHsHMTEhd0O4cpUHr/e/BUM= -launchpad.net/xmlpath v0.0.0-20130614043138-000000000004/go.mod h1:vqyExLOM3qBx7mvYRkoxjSCF945s0mbe7YynlKYXtsA= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/gomaxprocs_test.go b/gomaxprocs_test.go index 6490237e..43372d93 100644 --- a/gomaxprocs_test.go +++ b/gomaxprocs_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type gomaxprocsSuite struct { diff --git a/hash/fingerprint_test.go b/hash/fingerprint_test.go index 232c2c79..0d38d7d4 100644 --- a/hash/fingerprint_test.go +++ b/hash/fingerprint_test.go @@ -14,7 +14,7 @@ import ( "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/hash" + "github.com/juju/utils/v4/hash" ) var _ = gc.Suite(&FingerprintSuite{}) diff --git a/hash/hash.go b/hash/hash.go index 9333eafb..34e5a135 100644 --- a/hash/hash.go +++ b/hash/hash.go @@ -10,8 +10,8 @@ // // Here are some hash-related recipes that bring it all together: // -// * Extract the SHA384 hash while writing to elsewhere, then get the -// raw checksum: +// - Extract the SHA384 hash while writing to elsewhere, then get the +// raw checksum: // // newHash, _ := hash.SHA384() // h := newHash() @@ -20,8 +20,8 @@ // fp := hash.NewValidFingerprint(h) // checksum := fp.Bytes() // -// * Extract the SHA384 hash while reading from elsewhere, then get the -// hex-encoded checksum to send over the wire: +// - Extract the SHA384 hash while reading from elsewhere, then get the +// hex-encoded checksum to send over the wire: // // newHash, _ := hash.SHA384() // h := newHash() @@ -33,16 +33,16 @@ // // * Turn a checksum sent over the wire back into a fingerprint: // -// _, validate := hash.SHA384() -// hexSum := req.Header.Get("Content-Sha384") -// var fp hash.Fingerprint -// if len(hexSum) != 0 { -// fp, err = hash.ParseHexFingerprint(hexSum, validate) -// ... -// } -// if fp.IsZero() { -// ... -// } +// _, validate := hash.SHA384() +// hexSum := req.Header.Get("Content-Sha384") +// var fp hash.Fingerprint +// if len(hexSum) != 0 { +// fp, err = hash.ParseHexFingerprint(hexSum, validate) +// ... +// } +// if fp.IsZero() { +// ... +// } package hash import ( @@ -50,11 +50,8 @@ import ( "hash" "github.com/juju/errors" - "github.com/juju/loggo" ) -var logger = loggo.GetLogger("utils.hash") - // SHA384 returns the newHash and validate functions for use // with SHA384 hashes. SHA384 is used in several key places in Juju. func SHA384() (newHash func() hash.Hash, validate func([]byte) error) { diff --git a/hash/hash_test.go b/hash/hash_test.go index 55cd8c34..8250a7f8 100644 --- a/hash/hash_test.go +++ b/hash/hash_test.go @@ -14,7 +14,7 @@ import ( "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/hash" + "github.com/juju/utils/v4/hash" ) var _ = gc.Suite(&HashSuite{}) diff --git a/hash/writer_test.go b/hash/writer_test.go index 69d55c3c..05c86418 100644 --- a/hash/writer_test.go +++ b/hash/writer_test.go @@ -12,7 +12,7 @@ import ( "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/hash" + "github.com/juju/utils/v4/hash" ) var _ = gc.Suite(&WriterSuite{}) diff --git a/home_unix_test.go b/home_unix_test.go index 5e4fa9fa..82ad56b2 100644 --- a/home_unix_test.go +++ b/home_unix_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type homeSuite struct { diff --git a/home_windows_test.go b/home_windows_test.go index 31f7ea6f..dcc32553 100644 --- a/home_windows_test.go +++ b/home_windows_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type homeSuite struct { diff --git a/isubuntu_test.go b/isubuntu_test.go index a2741243..9392f859 100644 --- a/isubuntu_test.go +++ b/isubuntu_test.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type IsUbuntuSuite struct { diff --git a/jsonhttp/jsonhttp_test.go b/jsonhttp/jsonhttp_test.go index 9c0451b5..d62cfbd5 100644 --- a/jsonhttp/jsonhttp_test.go +++ b/jsonhttp/jsonhttp_test.go @@ -12,7 +12,7 @@ import ( gc "gopkg.in/check.v1" "gopkg.in/errgo.v1" - "github.com/juju/utils/v3/jsonhttp" + "github.com/juju/utils/v4/jsonhttp" ) type suite struct{} diff --git a/keyvalues/keyvalues_test.go b/keyvalues/keyvalues_test.go index a9af381e..95de84d9 100644 --- a/keyvalues/keyvalues_test.go +++ b/keyvalues/keyvalues_test.go @@ -6,7 +6,7 @@ package keyvalues_test import ( gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/keyvalues" + "github.com/juju/utils/v4/keyvalues" ) type keyValuesSuite struct{} diff --git a/limiter_test.go b/limiter_test.go index 84fbcd6e..55d68362 100644 --- a/limiter_test.go +++ b/limiter_test.go @@ -12,7 +12,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) const longWait = 10 * time.Second diff --git a/multireader_test.go b/multireader_test.go index 9f99933c..a2034e90 100644 --- a/multireader_test.go +++ b/multireader_test.go @@ -10,7 +10,7 @@ import ( "testing/iotest" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" gc "gopkg.in/check.v1" ) diff --git a/naturalsort_test.go b/naturalsort_test.go index 2e66ff52..c3d66b94 100644 --- a/naturalsort_test.go +++ b/naturalsort_test.go @@ -9,7 +9,7 @@ import ( gc "gopkg.in/check.v1" "github.com/juju/testing" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type naturalSortSuite struct { diff --git a/network.go b/network.go index f673c2c9..242edfeb 100644 --- a/network.go +++ b/network.go @@ -7,7 +7,7 @@ import ( "fmt" "net" - "github.com/juju/loggo" + "github.com/juju/loggo/v2" ) var logger = loggo.GetLogger("juju.utils") diff --git a/network_test.go b/network_test.go index bfb77c8f..e5146f38 100644 --- a/network_test.go +++ b/network_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type networkSuite struct { diff --git a/os_test.go b/os_test.go index 59dc4c9e..58c8fd9f 100644 --- a/os_test.go +++ b/os_test.go @@ -8,7 +8,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) var _ = gc.Suite(&osSuite{}) diff --git a/parallel/parallel_test.go b/parallel/parallel_test.go index dc6690f8..5f93c21c 100644 --- a/parallel/parallel_test.go +++ b/parallel/parallel_test.go @@ -13,7 +13,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/parallel" + "github.com/juju/utils/v4/parallel" ) type parallelSuite struct { diff --git a/parallel/try_test.go b/parallel/try_test.go index c9190230..6a316241 100644 --- a/parallel/try_test.go +++ b/parallel/try_test.go @@ -15,7 +15,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/parallel" + "github.com/juju/utils/v4/parallel" ) const ( diff --git a/password_test.go b/password_test.go index 5ac7f2a7..c6b824e1 100644 --- a/password_test.go +++ b/password_test.go @@ -8,7 +8,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type passwordSuite struct { diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go index a77abfa9..3bedd7d3 100644 --- a/proxy/proxy_test.go +++ b/proxy/proxy_test.go @@ -9,7 +9,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/proxy" + "github.com/juju/utils/v4/proxy" ) type proxySuite struct { diff --git a/randomstring_test.go b/randomstring_test.go index 45f0f3e3..19f7e57d 100644 --- a/randomstring_test.go +++ b/randomstring_test.go @@ -7,7 +7,7 @@ package utils_test import ( "github.com/juju/testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" gc "gopkg.in/check.v1" ) diff --git a/registry/registry_test.go b/registry/registry_test.go index 376358d4..2f219fe2 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/registry" + "github.com/juju/utils/v4/registry" ) type registrySuite struct { diff --git a/relativeurl_test.go b/relativeurl_test.go index 4b1c3d08..72ef644c 100644 --- a/relativeurl_test.go +++ b/relativeurl_test.go @@ -9,7 +9,7 @@ import ( jujutesting "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type relativeURLSuite struct { diff --git a/setenv_test.go b/setenv_test.go index 75908a1c..6d03acd4 100644 --- a/setenv_test.go +++ b/setenv_test.go @@ -6,7 +6,7 @@ package utils_test import ( gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type SetenvSuite struct{} diff --git a/shell/bash_test.go b/shell/bash_test.go index 0bcf9bb0..d9584430 100644 --- a/shell/bash_test.go +++ b/shell/bash_test.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/shell" + "github.com/juju/utils/v4/shell" ) type bashSuite struct { diff --git a/shell/powershell.go b/shell/powershell.go index c10dc799..66c13069 100644 --- a/shell/powershell.go +++ b/shell/powershell.go @@ -11,7 +11,8 @@ import ( "golang.org/x/text/encoding/unicode" "github.com/juju/errors" - "github.com/juju/utils/v3" + + "github.com/juju/utils/v4" ) // PowershellRenderer is a shell renderer for Windows Powershell. @@ -59,9 +60,10 @@ func (pr *PowershellRenderer) ScriptFilename(name, dirname string) string { // By default, winrm executes command usind cmd. Prefix the command we send over WinRM with powershell.exe. // the powershell.exe it's a program that will execute the "%s" encoded command. // A breakdown of the parameters: -// -NonInteractive - prevent any prompts from stopping the execution of the scrips -// -ExecutionPolicy - sets the execution policy for the current command, regardless of the default ExecutionPolicy on the system. -// -EncodedCommand - allows us to run a base64 encoded script. This spares us from having to quote/escape shell special characters. +// +// -NonInteractive - prevent any prompts from stopping the execution of the scrips +// -ExecutionPolicy - sets the execution policy for the current command, regardless of the default ExecutionPolicy on the system. +// -EncodedCommand - allows us to run a base64 encoded script. This spares us from having to quote/escape shell special characters. const psRemoteWrapper = "powershell.exe -Sta -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand %s" // newEncodedPSScript returns a UTF16-LE, base64 encoded script. diff --git a/shell/powershell_test.go b/shell/powershell_test.go index 14a4e5e3..3402b554 100644 --- a/shell/powershell_test.go +++ b/shell/powershell_test.go @@ -8,7 +8,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/shell" + "github.com/juju/utils/v4/shell" ) var _ = gc.Suite(&powershellSuite{}) diff --git a/shell/renderer.go b/shell/renderer.go index b41cb968..f4fce026 100644 --- a/shell/renderer.go +++ b/shell/renderer.go @@ -8,8 +8,9 @@ import ( "strings" "github.com/juju/errors" - "github.com/juju/utils/v3" - "github.com/juju/utils/v3/filepath" + + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/filepath" ) // A PathRenderer generates paths that are appropriate for a given diff --git a/shell/renderer_test.go b/shell/renderer_test.go index ecde08e0..4b5b5149 100644 --- a/shell/renderer_test.go +++ b/shell/renderer_test.go @@ -9,10 +9,10 @@ import ( "github.com/juju/errors" "github.com/juju/testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/shell" + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/shell" ) type rendererSuite struct { diff --git a/shell/script.go b/shell/script.go index 4ab7860a..7dff0419 100644 --- a/shell/script.go +++ b/shell/script.go @@ -7,7 +7,7 @@ import ( "fmt" "os" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) // DumpFileOnErrorScript returns a bash script that diff --git a/shell/script_test.go b/shell/script_test.go index 8384d9b8..55949090 100644 --- a/shell/script_test.go +++ b/shell/script_test.go @@ -15,7 +15,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/shell" + "github.com/juju/utils/v4/shell" ) type scriptSuite struct { diff --git a/shell/unix.go b/shell/unix.go index 9a41e483..f3a3f9ab 100644 --- a/shell/unix.go +++ b/shell/unix.go @@ -8,8 +8,8 @@ import ( "os" "time" - "github.com/juju/utils/v3" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/filepath" ) // unixRenderer is the base shell renderer for "unix" shells. diff --git a/shell/win.go b/shell/win.go index 7483a2e1..5b780c4d 100644 --- a/shell/win.go +++ b/shell/win.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/juju/utils/v3/filepath" + "github.com/juju/utils/v4/filepath" ) // windowsRenderer is the base implementation for Windows shells. diff --git a/shell/wincmd.go b/shell/wincmd.go index c280fa3a..dcdb6336 100644 --- a/shell/wincmd.go +++ b/shell/wincmd.go @@ -8,7 +8,7 @@ import ( "fmt" "os" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) // WinCmdRenderer is a shell renderer for Windows cmd.exe. diff --git a/shell/wincmd_test.go b/shell/wincmd_test.go index 4bcbfbc4..1cf0680d 100644 --- a/shell/wincmd_test.go +++ b/shell/wincmd_test.go @@ -8,7 +8,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/shell" + "github.com/juju/utils/v4/shell" ) var _ = gc.Suite(&winCmdSuite{}) diff --git a/size_test.go b/size_test.go index 51fb16fd..129361d5 100644 --- a/size_test.go +++ b/size_test.go @@ -12,7 +12,7 @@ import ( "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) var _ = gc.Suite(&sizeSuite{}) diff --git a/ssh/authorisedkeys.go b/ssh/authorisedkeys.go index 460c5e46..3946898c 100644 --- a/ssh/authorisedkeys.go +++ b/ssh/authorisedkeys.go @@ -15,9 +15,10 @@ import ( "sync" "github.com/juju/errors" - "github.com/juju/loggo" - "github.com/juju/utils/v3" + "github.com/juju/loggo/v2" "golang.org/x/crypto/ssh" + + "github.com/juju/utils/v4" ) var logger = loggo.GetLogger("juju.utils.ssh") diff --git a/ssh/authorisedkeys_test.go b/ssh/authorisedkeys_test.go index 052c018d..71a4c971 100644 --- a/ssh/authorisedkeys_test.go +++ b/ssh/authorisedkeys_test.go @@ -11,8 +11,8 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" - sshtesting "github.com/juju/utils/v3/ssh/testing" + "github.com/juju/utils/v4/ssh" + sshtesting "github.com/juju/utils/v4/ssh/testing" ) type AuthorisedKeysKeysSuite struct { diff --git a/ssh/clientkeys.go b/ssh/clientkeys.go index bd1b9cdf..c4aef1f9 100644 --- a/ssh/clientkeys.go +++ b/ssh/clientkeys.go @@ -12,8 +12,9 @@ import ( "sync" "github.com/juju/collections/set" - "github.com/juju/utils/v3" "golang.org/x/crypto/ssh" + + "github.com/juju/utils/v4" ) const clientKeyName = "juju_id_rsa" diff --git a/ssh/clientkeys_test.go b/ssh/clientkeys_test.go index 8addd505..bca37086 100644 --- a/ssh/clientkeys_test.go +++ b/ssh/clientkeys_test.go @@ -9,8 +9,8 @@ import ( gitjujutesting "github.com/juju/testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/ssh" gc "gopkg.in/check.v1" ) diff --git a/ssh/export_test.go b/ssh/export_test.go index 1568734b..7a26f819 100644 --- a/ssh/export_test.go +++ b/ssh/export_test.go @@ -17,7 +17,7 @@ var ( InitDefaultClient = initDefaultClient DefaultIdentities = &defaultIdentities SSHDial = &sshDial - RSAGenerateKey = &rsaGenerateKey + ED25519GenerateKey = &ed25519GenerateKey TestCopyReader = copyReader TestNewCmd = newCmd ) diff --git a/ssh/fakes_test.go b/ssh/fakes_test.go index 1208617b..3358cf5a 100644 --- a/ssh/fakes_test.go +++ b/ssh/fakes_test.go @@ -11,7 +11,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4/ssh" ) type fakeClient struct { diff --git a/ssh/fingerprint_test.go b/ssh/fingerprint_test.go index 96b3bb04..e75a6bea 100644 --- a/ssh/fingerprint_test.go +++ b/ssh/fingerprint_test.go @@ -8,8 +8,8 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" - sshtesting "github.com/juju/utils/v3/ssh/testing" + "github.com/juju/utils/v4/ssh" + sshtesting "github.com/juju/utils/v4/ssh/testing" ) type FingerprintSuite struct { diff --git a/ssh/generate.go b/ssh/generate.go index 26756d26..280158fd 100644 --- a/ssh/generate.go +++ b/ssh/generate.go @@ -4,8 +4,8 @@ package ssh import ( + "crypto/ed25519" "crypto/rand" - "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" @@ -15,28 +15,27 @@ import ( "golang.org/x/crypto/ssh" ) -// rsaGenerateKey allows for tests to patch out rsa key generation -var rsaGenerateKey = rsa.GenerateKey +// ed25519GenerateKey allows for tests to patch out ed25519 key generation +var ed25519GenerateKey = ed25519.GenerateKey -// KeyBits is used to determine the number of bits to use for the RSA keys -// created using the GenerateKey function. -var KeyBits = 4096 - -// GenerateKey makes a 4096 bit RSA no-passphrase SSH capable key. The bit -// size is actually controlled by the KeyBits var. The private key returned is -// encoded to ASCII using the PKCS1 encoding. The public key is suitable to -// be added into an authorized_keys file, and has the comment passed in as the -// comment part of the key. +// GenerateKey makes a ED25519 no-passphrase SSH capable key. +// The private key returned is encoded to ASCII using the PKCS1 encoding. +// The public key is suitable to be added into an authorized_keys file, +// and has the comment passed in as the comment part of the key. func GenerateKey(comment string) (private, public string, err error) { - key, err := rsaGenerateKey(rand.Reader, KeyBits) + _, privateKey, err := ed25519GenerateKey(rand.Reader) if err != nil { return "", "", errors.Trace(err) } + keyData, err := x509.MarshalPKCS8PrivateKey(privateKey) + if err != nil { + return "", "", errors.Trace(err) + } identity := pem.EncodeToMemory( &pem.Block{ - Type: "RSA PRIVATE KEY", - Bytes: x509.MarshalPKCS1PrivateKey(key), + Type: "PRIVATE KEY", + Bytes: keyData, }) public, err = PublicKey(identity, comment) diff --git a/ssh/generate_test.go b/ssh/generate_test.go index b415a5e9..4fae71e1 100644 --- a/ssh/generate_test.go +++ b/ssh/generate_test.go @@ -5,14 +5,14 @@ package ssh_test import ( "crypto/dsa" - "crypto/rsa" + "crypto/ed25519" "io" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4/ssh" ) type GenerateSuite struct { @@ -22,35 +22,33 @@ type GenerateSuite struct { var _ = gc.Suite(&GenerateSuite{}) var ( - pregeneratedKey *rsa.PrivateKey - alternativeRSAKey *rsa.PrivateKey + pregeneratedKey ed25519.PrivateKey ) // overrideGenerateKey patches out rsa.GenerateKey to create a single testing // key which is saved and used between tests to save computation time. func overrideGenerateKey(c *gc.C) testing.Restorer { - restorer := testing.PatchValue(ssh.RSAGenerateKey, func(random io.Reader, bits int) (*rsa.PrivateKey, error) { + restorer := testing.PatchValue(ssh.ED25519GenerateKey, func(random io.Reader) (ed25519.PublicKey, ed25519.PrivateKey, error) { if pregeneratedKey != nil { - return pregeneratedKey, nil + return ed25519.PublicKey{}, pregeneratedKey, nil } - key, err := generateRSAKey(random) + public, private, err := generateED25519Key(random) if err != nil { - return nil, err + return nil, nil, err } - pregeneratedKey = key - return key, nil + pregeneratedKey = private + return public, private, nil }) return restorer } -func generateRSAKey(random io.Reader) (*rsa.PrivateKey, error) { +func generateED25519Key(random io.Reader) (ed25519.PublicKey, ed25519.PrivateKey, error) { // Ignore requested bits and just use 512 bits for speed - key, err := rsa.GenerateKey(random, 512) + public, private, err := ed25519.GenerateKey(random) if err != nil { - return nil, err + return nil, nil, err } - key.Precompute() - return key, nil + return public, private, nil } func generateDSAKey(random io.Reader) (*dsa.PrivateKey, error) { @@ -67,10 +65,9 @@ func generateDSAKey(random io.Reader) (*dsa.PrivateKey, error) { func (s *GenerateSuite) TestGenerate(c *gc.C) { defer overrideGenerateKey(c).Restore() private, public, err := ssh.GenerateKey("some-comment") - c.Check(err, jc.ErrorIsNil) - c.Check(private, jc.HasPrefix, "-----BEGIN RSA PRIVATE KEY-----\n") - c.Check(private, jc.HasSuffix, "-----END RSA PRIVATE KEY-----\n") - c.Check(public, jc.HasPrefix, "ssh-rsa ") + c.Check(private, jc.HasPrefix, "-----BEGIN PRIVATE KEY-----\n") + c.Check(private, jc.HasSuffix, "-----END PRIVATE KEY-----\n") + c.Check(public, jc.HasPrefix, "ssh-ed25519 ") c.Check(public, jc.HasSuffix, " some-comment\n") } diff --git a/ssh/run.go b/ssh/run.go index 36cc91aa..1fc136ba 100644 --- a/ssh/run.go +++ b/ssh/run.go @@ -12,7 +12,8 @@ import ( "github.com/juju/clock" "github.com/juju/errors" - utilexec "github.com/juju/utils/v3/exec" + + utilexec "github.com/juju/utils/v4/exec" ) // ExecParams are used for the parameters for ExecuteCommandOnMachine. diff --git a/ssh/run_test.go b/ssh/run_test.go index 48ed6c3a..7830b0d5 100644 --- a/ssh/run_test.go +++ b/ssh/run_test.go @@ -14,7 +14,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4/ssh" ) const ( diff --git a/ssh/ssh.go b/ssh/ssh.go index d0b940c7..935e8b0f 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -4,7 +4,6 @@ // Package ssh contains utilities for dealing with SSH connections, // key management, and so on. All SSH-based command executions in // Juju should use the Command/ScpCommand functions in this package. -// package ssh import ( @@ -13,8 +12,9 @@ import ( "os/exec" "syscall" - "github.com/juju/cmd/v3" "github.com/juju/errors" + + "github.com/juju/utils/v4" ) // StrictHostChecksOption defines the possible values taken by @@ -202,7 +202,7 @@ func (c *Cmd) Run() error { if exitError, ok := err.(*exec.ExitError); ok && exitError != nil { status := exitError.ProcessState.Sys().(syscall.WaitStatus) if status.Exited() { - return cmd.NewRcPassthroughError(status.ExitStatus()) + return utils.NewRcPassthroughError(status.ExitStatus()) } } return err diff --git a/ssh/ssh_gocrypto.go b/ssh/ssh_gocrypto.go index 9810f646..96c4a106 100644 --- a/ssh/ssh_gocrypto.go +++ b/ssh/ssh_gocrypto.go @@ -24,7 +24,7 @@ import ( "golang.org/x/crypto/ssh/knownhosts" "golang.org/x/crypto/ssh/terminal" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) const sshDefaultPort = 22 diff --git a/ssh/ssh_gocrypto_test.go b/ssh/ssh_gocrypto_test.go index 2c8dc3a2..344a6d4e 100644 --- a/ssh/ssh_gocrypto_test.go +++ b/ssh/ssh_gocrypto_test.go @@ -17,6 +17,7 @@ import ( "path/filepath" "regexp" "sync" + "time" "github.com/juju/testing" jc "github.com/juju/testing/checkers" @@ -24,7 +25,7 @@ import ( "golang.org/x/crypto/ssh/testdata" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4/ssh" ) var ( @@ -38,26 +39,42 @@ type sshServer struct { client *cryptossh.Client } -func (s *sshServer) run(c *gc.C) { +func (s *sshServer) run(errorCh chan error, done chan bool) { netconn, err := s.listener.Accept() - c.Assert(err, jc.ErrorIsNil) + if err != nil { + errorCh <- fmt.Errorf("accepting connection: %w", err) + return + } defer netconn.Close() conn, chans, reqs, err := cryptossh.NewServerConn(netconn, s.cfg) - c.Assert(err, jc.ErrorIsNil) + if err != nil { + errorCh <- fmt.Errorf("getting ssh server connection: %w", err) + return + } s.client = cryptossh.NewClient(conn, chans, reqs) var wg sync.WaitGroup - defer wg.Wait() + defer func() { + wg.Wait() + close(errorCh) + }() sessionChannels := s.client.HandleChannelOpen("session") - c.Assert(sessionChannels, gc.NotNil) - for newChannel := range sessionChannels { - c.Assert(newChannel.ChannelType(), gc.Equals, "session") + select { + case <-done: + return + case newChannel := <-sessionChannels: + if sCh := newChannel.ChannelType(); sCh != "session" { + errorCh <- fmt.Errorf("unexpected session channel %q", sCh) + return + } channel, reqs, err := newChannel.Accept() - - c.Assert(err, jc.ErrorIsNil) + if err != nil { + errorCh <- fmt.Errorf("accepting session connection: %w", err) + return + } wg.Add(1) go func() { @@ -67,18 +84,30 @@ func (s *sshServer) run(c *gc.C) { for req := range reqs { switch req.Type { case "exec": - c.Assert(req.WantReply, jc.IsTrue) + if !req.WantReply { + errorCh <- fmt.Errorf("no reply wanted for request %+v", req) + return + } n := binary.BigEndian.Uint32(req.Payload[:4]) command := string(req.Payload[4 : n+4]) - c.Assert(command, gc.Equals, testCommandFlat) - req.Reply(true, nil) + if command != testCommandFlat { + errorCh <- fmt.Errorf("unexpected request command: %q", command) + return + } + err = req.Reply(true, nil) + if err != nil { + errorCh <- fmt.Errorf("error sending reply: %w", err) + return + } channel.Write([]byte("abc value\n")) _, err := channel.SendRequest("exit-status", false, cryptossh.Marshal(&struct{ n uint32 }{0})) - c.Check(err, jc.ErrorIsNil) + if err != nil { + errorCh <- fmt.Errorf("error sending request: %w", err) + } return default: - c.Errorf("Unexpected request type: %v", req.Type) + errorCh <- fmt.Errorf("unexpected request type: %q", req.Type) return } } @@ -135,13 +164,13 @@ func (s *SSHGoCryptoCommandSuite) SetUpSuite(c *gc.C) { ValidBefore: cryptossh.CertTimeInfinity, // The end of currently representable time. Reserved: []byte{}, // To pass reflect.DeepEqual after marshal & parse, this must be non-nil Key: s.testPublicKeys["ecdsa"], - SignatureKey: s.testPublicKeys["rsa"], + SignatureKey: s.testPublicKeys["ed25519"], Permissions: cryptossh.Permissions{ CriticalOptions: map[string]string{}, Extensions: map[string]string{}, }, } - err = testCert.SignCert(rand.Reader, s.testSigners["rsa"]) + err = testCert.SignCert(rand.Reader, s.testSigners["ed25519"]) c.Assert(err, jc.ErrorIsNil) s.testPrivateKeys["cert"] = s.testPrivateKeys["ecdsa"] s.testSigners["cert"], err = cryptossh.NewCertSigner(testCert, s.testSigners["ecdsa"]) @@ -164,13 +193,13 @@ func (s *SSHGoCryptoCommandSuite) SetUpTest(c *gc.C) { func (s *SSHGoCryptoCommandSuite) newServer(c *gc.C, serverConfig cryptossh.ServerConfig) (*sshServer, cryptossh.PublicKey) { server := &sshServer{cfg: &serverConfig} - server.cfg.AddHostKey(s.testSigners["rsa"]) + server.cfg.AddHostKey(s.testSigners["ed25519"]) var err error server.listener, err = net.Listen("tcp", "127.0.0.1:0") c.Assert(err, jc.ErrorIsNil) c.Logf("Server listening on %s", server.listener.Addr().String()) - return server, s.testPublicKeys["rsa"] + return server, s.testPublicKeys["ed25519"] } func (s *SSHGoCryptoCommandSuite) TestNewGoCryptoClient(c *gc.C) { @@ -206,6 +235,16 @@ func (s *SSHGoCryptoCommandSuite) TestClientNoKeys(c *gc.C) { c.Assert(err, gc.ErrorMatches, "ssh.Dial failed") } +func waitForServer(c *gc.C, errorCh chan error) error { + select { + case err, _ := <-errorCh: + return err + case <-time.After(testing.LongWait): + c.Fatal("timed out waiting for ssh server") + return nil + } +} + func (s *SSHGoCryptoCommandSuite) TestCommand(c *gc.C) { client, clientKey := newClient(c) server, serverKey := s.newServer(c, cryptossh.ServerConfig{}) @@ -220,7 +259,11 @@ func (s *SSHGoCryptoCommandSuite) TestCommand(c *gc.C) { checkedKey = true return nil, nil } - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) + out, err := cmd.Output() c.Assert(err, jc.ErrorIsNil) c.Assert(string(out), gc.Equals, "abc value\n") @@ -233,6 +276,7 @@ func (s *SSHGoCryptoCommandSuite) TestCommand(c *gc.C) { serverPort, cryptossh.MarshalAuthorizedKey(serverKey)), ) + c.Assert(waitForServer(c, errorCh), jc.ErrorIsNil) } func (s *SSHGoCryptoCommandSuite) TestCopy(c *gc.C) { @@ -262,7 +306,11 @@ func (s *SSHGoCryptoCommandSuite) TestProxyCommand(c *gc.C) { server.cfg.PublicKeyCallback = func(_ cryptossh.ConnMetadata, pubkey cryptossh.PublicKey) (*cryptossh.Permissions, error) { return nil, nil } - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) + out, err := cmd.Output() c.Assert(err, jc.ErrorIsNil) c.Assert(string(out), gc.Equals, "abc value\n") @@ -270,12 +318,16 @@ func (s *SSHGoCryptoCommandSuite) TestProxyCommand(c *gc.C) { data, err := ioutil.ReadFile(netcat + ".args") c.Assert(err, jc.ErrorIsNil) c.Assert(string(data), gc.Equals, fmt.Sprintf("%s -q0 127.0.0.1 %v\n", netcat, port)) + c.Assert(waitForServer(c, errorCh), jc.ErrorIsNil) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksYes(c *gc.C) { server, _ := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) var opts ssh.Options opts.SetPort(serverPort) @@ -284,17 +336,21 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksYes(c *gc.C) { cmd := client.Command("127.0.0.1", testCommand, &opts) _, err := cmd.Output() c.Assert(err, gc.ErrorMatches, fmt.Sprintf( - "ssh: handshake failed: no ssh-rsa host key is known for 127.0.0.1:%d and you have requested strict checking", + "ssh: handshake failed: no ssh-ed25519 host key is known for 127.0.0.1:%d and you have requested strict checking", serverPort, )) _, err = os.Stat(s.knownHostsFile) c.Assert(err, jc.Satisfies, os.IsNotExist) + _ = waitForServer(c, errorCh) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskNonTerminal(c *gc.C) { server, _ := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) var opts ssh.Options opts.SetPort(serverPort) @@ -305,6 +361,7 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskNonTerminal(c *gc.C) { c.Assert(err, gc.ErrorMatches, "ssh: handshake failed: not running in a terminal, cannot prompt for verification") _, err = os.Stat(s.knownHostsFile) c.Assert(err, jc.Satisfies, os.IsNotExist) + _ = waitForServer(c, errorCh) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalYes(c *gc.C) { @@ -315,7 +372,10 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalYes(c *gc.C) { server, serverKey := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) var opts ssh.Options opts.SetPort(serverPort) @@ -335,9 +395,10 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalYes(c *gc.C) { c.Assert(readLineWriter.written.String(), gc.Equals, fmt.Sprintf(` The authenticity of host '127.0.0.1:%[1]d (127.0.0.1:%[1]d)' can't be established. -ssh-rsa key fingerprint is %[2]s. +ssh-ed25519 key fingerprint is %[2]s. Are you sure you want to continue connecting (yes/no)? Please type 'yes' or 'no': `[1:], serverPort, cryptossh.FingerprintSHA256(serverKey))) + c.Assert(waitForServer(c, errorCh), jc.ErrorIsNil) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalNo(c *gc.C) { @@ -347,7 +408,10 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalNo(c *gc.C) { server, serverKey := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) var opts ssh.Options opts.SetPort(serverPort) @@ -362,9 +426,10 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksAskTerminalNo(c *gc.C) { c.Assert(readLineWriter.written.String(), gc.Equals, fmt.Sprintf(` The authenticity of host '127.0.0.1:%[1]d (127.0.0.1:%[1]d)' can't be established. -ssh-rsa key fingerprint is %[2]s. +ssh-ed25519 key fingerprint is %[2]s. Are you sure you want to continue connecting (yes/no)? `[1:], serverPort, cryptossh.FingerprintSHA256(serverKey))) + _ = waitForServer(c, errorCh) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksNoMismatch(c *gc.C) { @@ -373,14 +438,17 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksNoMismatch(c *gc.C) { server, serverKey := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) // Write a mismatching key to the known_hosts file. Even with // StrictHostChecksNo, we should be verifying against an existing // host key. - alternativeRSAKey, err := generateRSAKey(rand.Reader) + _, alternativeKey, err := generateED25519Key(rand.Reader) c.Assert(err, jc.ErrorIsNil) - alternativePublicKey, err := cryptossh.NewPublicKey(alternativeRSAKey.Public()) + alternativePublicKey, err := cryptossh.NewPublicKey(alternativeKey.Public()) c.Assert(err, jc.ErrorIsNil) err = ioutil.WriteFile(s.knownHostsFile, []byte(fmt.Sprintf( "[127.0.0.1]:%d %s", @@ -404,12 +472,13 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksNoMismatch(c *gc.C) { IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now \(man-in-the-middle attack\)! It is also possible that a host key has just been changed. -The fingerprint for the ssh-rsa key sent by the remote host is +The fingerprint for the ssh-ed25519 key sent by the remote host is %s. Please contact your system administrator. Add correct host key in .*/known_hosts to get rid of this message. -Offending ssh-rsa key in .*/known_hosts:1 +Offending ssh-ed25519 key in .*/known_hosts:1 `[1:], regexp.QuoteMeta(cryptossh.FingerprintSHA256(serverKey)))) + _ = waitForServer(c, errorCh) } func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksDifferentKeyTypes(c *gc.C) { @@ -418,7 +487,10 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksDifferentKeyTypes(c *gc.C) server, serverKey := s.newServer(c, cryptossh.ServerConfig{NoClientAuth: true}) serverPort := server.listener.Addr().(*net.TCPAddr).Port - go server.run(c) + errorCh := make(chan error, 1) + done := make(chan bool) + defer close(done) + go server.run(errorCh, done) // Write a mismatching key to the known_hosts file with a different // key type. Even with StrictHostChecksNo, we should be verifying @@ -450,13 +522,14 @@ func (s *SSHGoCryptoCommandSuite) TestStrictHostChecksDifferentKeyTypes(c *gc.C) IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now \(man-in-the-middle attack\)! It is also possible that a host key has just been changed. -The fingerprint for the ssh-rsa key sent by the remote host is +The fingerprint for the ssh-ed25519 key sent by the remote host is %s. Please contact your system administrator. Add correct host key in .*/known_hosts to get rid of this message. Host was previously using different host key algorithms: - ssh-dss key in .*/known_hosts:1 `[1:], regexp.QuoteMeta(cryptossh.FingerprintSHA256(serverKey)))) + _ = waitForServer(c, errorCh) } type mockReadLineWriter struct { diff --git a/ssh/ssh_openssh.go b/ssh/ssh_openssh.go index cdaf5840..556cadad 100644 --- a/ssh/ssh_openssh.go +++ b/ssh/ssh_openssh.go @@ -12,7 +12,7 @@ import ( "strings" "github.com/juju/errors" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) // default identities will not be attempted if diff --git a/ssh/ssh_test.go b/ssh/ssh_test.go index 6f2678a6..10bf6520 100644 --- a/ssh/ssh_test.go +++ b/ssh/ssh_test.go @@ -14,12 +14,12 @@ import ( "path/filepath" "strings" - "github.com/juju/cmd/v3" "github.com/juju/testing" jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/ssh" ) const ( @@ -225,7 +225,7 @@ func (s *SSHCommandSuite) TestCommandError(c *gc.C) { c.Assert(err, jc.ErrorIsNil) command := s.client.Command("ignored", []string{echoCommand, "foo"}, &opts) err = command.Run() - c.Assert(cmd.IsRcPassthroughError(err), jc.IsTrue) + c.Assert(utils.IsRcPassthroughError(err), jc.IsTrue) } func (s *SSHCommandSuite) TestCommandDefaultIdentities(c *gc.C) { diff --git a/ssh/stream_test.go b/ssh/stream_test.go index 6e0d5ec2..6d0b4a27 100644 --- a/ssh/stream_test.go +++ b/ssh/stream_test.go @@ -12,7 +12,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/ssh" + "github.com/juju/utils/v4/ssh" ) type SSHStreamSuite struct { diff --git a/symlink/symlink.go b/symlink/symlink.go index 8a8213c6..ef237272 100644 --- a/symlink/symlink.go +++ b/symlink/symlink.go @@ -8,7 +8,7 @@ import ( "os" "path/filepath" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) // Replace will do an atomic replacement of a symlink to a new path diff --git a/symlink/symlink_test.go b/symlink/symlink_test.go index b6d6b9c8..09ed1e44 100644 --- a/symlink/symlink_test.go +++ b/symlink/symlink_test.go @@ -12,8 +12,8 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" - "github.com/juju/utils/v3/symlink" + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/symlink" ) type SymlinkSuite struct{} diff --git a/symlink/symlink_windows_test.go b/symlink/symlink_windows_test.go index 0224f3bb..f9bb36d8 100644 --- a/symlink/symlink_windows_test.go +++ b/symlink/symlink_windows_test.go @@ -11,7 +11,7 @@ import ( gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/symlink" + "github.com/juju/utils/v4/symlink" ) func (*SymlinkSuite) TestLongPath(c *gc.C) { diff --git a/tailer/tailer_test.go b/tailer/tailer_test.go index fb594fb0..1c458224 100644 --- a/tailer/tailer_test.go +++ b/tailer/tailer_test.go @@ -14,7 +14,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/tailer" + "github.com/juju/utils/v4/tailer" ) type tailerSuite struct { diff --git a/tar/tar.go b/tar/tar.go index 9f493484..6d4d300a 100644 --- a/tar/tar.go +++ b/tar/tar.go @@ -19,7 +19,7 @@ import ( "github.com/juju/errors" "github.com/juju/collections/set" - "github.com/juju/utils/v3/symlink" + "github.com/juju/utils/v4/symlink" ) // FindFile returns the header and ReadCloser for the entry in the diff --git a/timer_test.go b/timer_test.go index 1cb73203..237d4d1e 100644 --- a/timer_test.go +++ b/timer_test.go @@ -13,7 +13,7 @@ import ( "github.com/juju/clock" "github.com/juju/testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type TestStdTimer struct { diff --git a/trivial_test.go b/trivial_test.go index cbc898f8..f67235d3 100644 --- a/trivial_test.go +++ b/trivial_test.go @@ -13,7 +13,7 @@ import ( "github.com/juju/testing" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type utilsSuite struct { diff --git a/username_test.go b/username_test.go index 6c34096b..40f08bd1 100644 --- a/username_test.go +++ b/username_test.go @@ -9,7 +9,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) var _ = gc.Suite(&usernameSuite{}) diff --git a/uuid_test.go b/uuid_test.go index f79c9bb2..5a5c4b8e 100644 --- a/uuid_test.go +++ b/uuid_test.go @@ -8,7 +8,7 @@ import ( jc "github.com/juju/testing/checkers" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3" + "github.com/juju/utils/v4" ) type uuidSuite struct { diff --git a/winrm/winrm.go b/winrm/winrm.go index 1fdb63ba..6d9acf66 100644 --- a/winrm/winrm.go +++ b/winrm/winrm.go @@ -14,7 +14,7 @@ import ( "time" "github.com/juju/errors" - "github.com/juju/loggo" + "github.com/juju/loggo/v2" "github.com/masterzen/winrm" "golang.org/x/crypto/ssh/terminal" ) diff --git a/winrm/winrm_test.go b/winrm/winrm_test.go index c7c7a0fc..8e54dc82 100644 --- a/winrm/winrm_test.go +++ b/winrm/winrm_test.go @@ -9,7 +9,7 @@ import ( "testing" jc "github.com/juju/testing/checkers" - "github.com/juju/utils/v3/winrm" + "github.com/juju/utils/v4/winrm" gc "gopkg.in/check.v1" ) diff --git a/winrm/x509.go b/winrm/x509.go index aba2ab7a..52cbf71d 100644 --- a/winrm/x509.go +++ b/winrm/x509.go @@ -14,8 +14,9 @@ import ( "time" "github.com/juju/errors" - "github.com/juju/utils/v3" - "github.com/juju/utils/v3/cert" + + "github.com/juju/utils/v4" + "github.com/juju/utils/v4/cert" ) // List of exported internal errors @@ -170,7 +171,7 @@ func newCredentials() ([]byte, []byte, error) { expiry := now.AddDate(10, 0, 0) // 10 years is enough cert, key, err := cert.NewClientCert( fmt.Sprintf("juju-generated client cert for model %s", "Administrator"), - "", expiry, 2048) + "", expiry) return []byte(cert), []byte(key), err } diff --git a/winrm/x509_test.go b/winrm/x509_test.go index 4eae1ea8..583b3285 100644 --- a/winrm/x509_test.go +++ b/winrm/x509_test.go @@ -9,7 +9,7 @@ import ( "os" "path" - "github.com/juju/utils/v3/winrm" + "github.com/juju/utils/v4/winrm" gc "gopkg.in/check.v1" ) diff --git a/zip/zip_test.go b/zip/zip_test.go index b942e268..04500b03 100644 --- a/zip/zip_test.go +++ b/zip/zip_test.go @@ -18,7 +18,7 @@ import ( ft "github.com/juju/testing/filetesting" gc "gopkg.in/check.v1" - "github.com/juju/utils/v3/zip" + "github.com/juju/utils/v4/zip" ) type ZipSuite struct {