From 2bd95acf60d9558efb1f5bdc6f53dcfd83487962 Mon Sep 17 00:00:00 2001 From: Michael Primeaux Date: Sat, 7 Dec 2024 15:42:31 -0600 Subject: [PATCH] debt: Upgraded all Go dependencies. (#8) --- CHANGELOG/CHANGELOG-1.x.md | 16 ++++++- go.mod | 6 +-- go.sum | 12 +++--- vendor/github.com/sixafter/nanoid/README.md | 3 ++ vendor/github.com/sixafter/nanoid/config.go | 14 +++--- vendor/github.com/sixafter/nanoid/nanoid.go | 47 +++++++++++---------- vendor/modules.txt | 6 +-- 7 files changed, 61 insertions(+), 43 deletions(-) diff --git a/CHANGELOG/CHANGELOG-1.x.md b/CHANGELOG/CHANGELOG-1.x.md index a84a0ff..c6915bc 100644 --- a/CHANGELOG/CHANGELOG-1.x.md +++ b/CHANGELOG/CHANGELOG-1.x.md @@ -17,6 +17,19 @@ Date format: `YYYY-MM-DD` ### Fixed ### Security +--- +## [1.5.0] - 2024-12-07 + +### Added +### Changed +- **DEBT:** Upgraded to [sixafter/nanoid@v1.21.0](https://github.com/sixafter/nanoid/releases/tag/v1.21.0). +- **DEBT:** Upgraded all Go dependencies to the latest versions. + +### Deprecated +### Removed +### Fixed +### Security + --- ## [1.4.1] - 2024-11-24 @@ -113,7 +126,8 @@ Date format: `YYYY-MM-DD` ### Fixed ### Security -[Unreleased]: https://github.com/sixafter/nanoid-cli/compare/v1.4.1...HEAD +[Unreleased]: https://github.com/sixafter/nanoid-cli/compare/v1.5.0...HEAD +[1.5.0]: https://github.com/sixafter/nanoid-cli/compare/v1.4.1...v1.5.0 [1.4.1]: https://github.com/sixafter/nanoid-cli/compare/v1.4.0...v1.4.1 [1.4.0]: https://github.com/sixafter/nanoid-cli/compare/v1.3.0...v1.4.0 [1.3.0]: https://github.com/sixafter/nanoid-cli/compare/v1.2.0...v1.3.0 diff --git a/go.mod b/go.mod index f164d3c..5574f10 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.23 require ( github.com/blang/semver/v4 v4.0.0 - github.com/sixafter/nanoid v1.20.1 + github.com/sixafter/nanoid v1.21.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 ) @@ -14,7 +14,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/crypto v0.29.0 // indirect - golang.org/x/sys v0.27.0 // indirect + golang.org/x/crypto v0.30.0 // indirect + golang.org/x/sys v0.28.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 02b6ac7..f5a8a7a 100644 --- a/go.sum +++ b/go.sum @@ -8,20 +8,20 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf 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/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sixafter/nanoid v1.20.1 h1:xVQSi9vKOVHHBChNmoJ3tYdvAT+Yh9glTkRZyZWajJI= -github.com/sixafter/nanoid v1.20.1/go.mod h1:RVA56eFCa0Oo/DTYqbfCpDlE1Uda2ebGzPo02xbpq+U= +github.com/sixafter/nanoid v1.21.0 h1:SSl8NMiHCnejWxHvoZ89KsrxZ+4oMdeK3is8eHMg1YU= +github.com/sixafter/nanoid v1.21.0/go.mod h1:7OQCO1l/zTwaxG42OJjzeu+RWOLKyB+I07Oc4sA8f6A= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= -golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= +golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= +golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f h1:XdNn9LlyWAhLVp6P/i8QYBW+hlyhrhei9uErw2B5GJo= golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:D5SMRVC3C2/4+F/DB1wZsLRnSNimn2Sp/NPsCrsv8ak= -golang.org/x/sys v0.27.0 h1:wBqf8DvsY9Y/2P8gAfPDEYNuS30J4lPHJxXSb/nJZ+s= -golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/vendor/github.com/sixafter/nanoid/README.md b/vendor/github.com/sixafter/nanoid/README.md index f49cfd6..226ebcd 100644 --- a/vendor/github.com/sixafter/nanoid/README.md +++ b/vendor/github.com/sixafter/nanoid/README.md @@ -65,6 +65,7 @@ package main import ( "fmt" + "github.com/sixafter/nanoid" ) @@ -92,6 +93,7 @@ package main import ( "fmt" + "github.com/sixafter/nanoid" ) @@ -120,6 +122,7 @@ package main import ( "fmt" "io" + "github.com/sixafter/nanoid" ) diff --git a/vendor/github.com/sixafter/nanoid/config.go b/vendor/github.com/sixafter/nanoid/config.go index 333985f..9e0a63b 100644 --- a/vendor/github.com/sixafter/nanoid/config.go +++ b/vendor/github.com/sixafter/nanoid/config.go @@ -13,7 +13,7 @@ import ( "unicode/utf8" ) -// ConfigOptions holds the configurable options for the Generator. +// ConfigOptions holds the configurable options for the Interface. // It is used with the Function Options pattern. type ConfigOptions struct { // RandReader is the source of randomness used for generating IDs. @@ -134,12 +134,12 @@ type Configuration interface { Config() Config } -// Option defines a function type for configuring the Generator. +// Option defines a function type for configuring the Interface. // It allows for flexible and extensible configuration by applying -// various settings to the ConfigOptions during Generator initialization. +// various settings to the ConfigOptions during Interface initialization. type Option func(*ConfigOptions) -// WithAlphabet sets a custom alphabet for the Generator. +// WithAlphabet sets a custom alphabet for the Interface. // The provided alphabet string defines the set of characters that will be // used to generate Nano IDs. This allows users to customize the character set // according to their specific requirements, such as using only alphanumeric @@ -160,8 +160,8 @@ func WithAlphabet(alphabet string) Option { } } -// WithRandReader sets a custom random reader for the Generator. -// By default, the Generator uses a cryptographically secure random number +// WithRandReader sets a custom random reader for the Interface. +// By default, the Interface uses a cryptographically secure random number // generator (e.g., crypto/rand.Reader). However, in some cases, users might // want to provide their own source of randomness, such as for testing purposes // or to integrate with a different entropy source. @@ -184,7 +184,7 @@ func WithRandReader(reader io.Reader) Option { } // WithLengthHint sets the hint of the intended length of the IDs to be generated. -// Providing a length hint allows the Generator to optimize internal configurations, +// Providing a length hint allows the Interface to optimize internal configurations, // such as buffer sizes and scaling factors, based on the expected ID length. This // can enhance performance and efficiency, especially when generating a large number // of IDs with similar lengths. diff --git a/vendor/github.com/sixafter/nanoid/nanoid.go b/vendor/github.com/sixafter/nanoid/nanoid.go index 96e83d8..ca0b663 100644 --- a/vendor/github.com/sixafter/nanoid/nanoid.go +++ b/vendor/github.com/sixafter/nanoid/nanoid.go @@ -14,11 +14,11 @@ import ( ) var ( - // DefaultGenerator is a global, shared instance of a Nano ID generator. It is safe for concurrent use. - DefaultGenerator Generator + // Generator is a global, shared instance of a Nano ID generator. It is safe for concurrent use. + Generator Interface - // DefaultRandReader is the default random number generator used for generating IDs. - DefaultRandReader = prng.Reader + // RandReader is the default random number generator used for generating IDs. + RandReader = prng.Reader ) const ( @@ -60,16 +60,17 @@ const ( func init() { var err error - DefaultGenerator, err = NewGenerator() + Generator, err = NewGenerator() if err != nil { - panic(fmt.Sprintf("failed to initialize DefaultGenerator: %v", err)) + panic(fmt.Sprintf("failed to initialize Generator: %v", err)) } } -// Generator defines the interface for generating Nano IDs. +// Interface defines the contract for generating Nano IDs. +// // Implementations of this interface provide methods to create new IDs // and to read random data, supporting both ID generation and direct random byte access. -type Generator interface { +type Interface interface { // New generates and returns a new Nano ID as a string with the specified length. // The 'length' parameter determines the number of characters in the generated ID. // Returns an error if the ID generation fails due to issues like insufficient randomness. @@ -85,7 +86,7 @@ type Generator interface { // Read fills the provided byte slice 'p' with random data, reading up to len(p) bytes. // Returns the number of bytes read and any error encountered during the read operation. // - // Implements the io.Reader interface, allowing the Generator to be used wherever an io.Reader is accepted. + // Implements the io.Reader interface, allowing the Interface to be used wherever an io.Reader is accepted. // This can be useful for directly obtaining random bytes or integrating with other components that consume random data. // // Usage: @@ -95,7 +96,7 @@ type Generator interface { // // handle error // } // fmt.Printf("Read %d random bytes\n", n) - Read(p []byte) (n int, err error) + Read(b []byte) (n int, err error) } type generator struct { @@ -132,7 +133,7 @@ func New() (ID, error) { // } // fmt.Println("Generated ID:", id) func NewWithLength(length int) (ID, error) { - return DefaultGenerator.New(length) + return Generator.New(length) } // Must generates a new Nano ID using the default length specified by `DefaultLength`. @@ -201,22 +202,22 @@ func MustWithLength(length int) ID { // nothing happened; in particular it does not indicate EOF. // // Implementations must not retain p. -func Read(p []byte) (n int, err error) { - return DefaultGenerator.Read(p) +func Read(b []byte) (n int, err error) { + return Generator.Read(b) } -// NewGenerator creates a new Generator with buffer pooling enabled. -// It accepts variadic Option parameters to configure the Generator's behavior. +// NewGenerator creates a new Interface with buffer pooling enabled. +// It accepts variadic Option parameters to configure the Interface's behavior. // The function initializes the configuration with default values, applies any provided options, // validates the configuration, constructs the runtime configuration, initializes buffer pools, -// and returns a configured Generator or an error if the configuration is invalid. +// and returns a configured Interface or an error if the configuration is invalid. // // Parameters: -// - options ...Option: A variadic list of Option functions to customize the Generator's configuration. +// - options ...Option: A variadic list of Option functions to customize the Interface's configuration. // // Returns: -// - Generator: An instance of the Generator interface configured with the specified options. -// - error: An error object if the Generator could not be created due to invalid configuration. +// - Interface: An instance of the Interface interface configured with the specified options. +// - error: An error object if the Interface could not be created due to invalid configuration. // // Error Conditions: // - ErrInvalidLength: Returned if the provided LengthHint is less than 1. @@ -224,13 +225,13 @@ func Read(p []byte) (n int, err error) { // - ErrInvalidAlphabet: Returned if the alphabet is invalid or contains invalid UTF-8 characters. // - ErrNonUTF8Alphabet: Returned if the alphabet contains non-UTF-8 characters. // - ErrDuplicateCharacters: Returned if the alphabet contains duplicate characters. -func NewGenerator(options ...Option) (Generator, error) { +func NewGenerator(options ...Option) (Interface, error) { // Initialize ConfigOptions with default values. // These defaults include the default alphabet, the default random reader, // and the default length hint for ID generation. configOpts := &ConfigOptions{ Alphabet: DefaultAlphabet, - RandReader: DefaultRandReader, + RandReader: RandReader, LengthHint: DefaultLength, } @@ -286,7 +287,7 @@ func NewGenerator(options ...Option) (Generator, error) { } } - // Return the configured Generator instance. + // Return the configured Interface instance. // The generator holds references to the runtime configuration and buffer pools, // facilitating efficient and thread-safe ID generation. return &generator{ @@ -313,7 +314,7 @@ func NewGenerator(options ...Option) (Generator, error) { // // Usage Example: // -// id, err := DefaultGenerator.New(21) +// id, err := Generator.New(21) // if err != nil { // // handle error // } diff --git a/vendor/modules.txt b/vendor/modules.txt index d5b511a..44476f6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,7 +10,7 @@ github.com/inconshreveable/mousetrap # github.com/pmezard/go-difflib v1.0.0 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/sixafter/nanoid v1.20.1 +# github.com/sixafter/nanoid v1.21.0 ## explicit; go 1.23 github.com/sixafter/nanoid github.com/sixafter/nanoid/x/crypto/prng @@ -26,11 +26,11 @@ github.com/spf13/pflag ## explicit; go 1.17 github.com/stretchr/testify/assert github.com/stretchr/testify/assert/yaml -# golang.org/x/crypto v0.29.0 +# golang.org/x/crypto v0.30.0 ## explicit; go 1.20 golang.org/x/crypto/chacha20 golang.org/x/crypto/internal/alias -# golang.org/x/sys v0.27.0 +# golang.org/x/sys v0.28.0 ## explicit; go 1.18 golang.org/x/sys/cpu # gopkg.in/yaml.v3 v3.0.1