diff --git a/configutil/go.mod b/configutil/go.mod index 0869f7d..54532a6 100644 --- a/configutil/go.mod +++ b/configutil/go.mod @@ -31,6 +31,7 @@ require ( github.com/bgentry/speakeasy v0.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fatih/color v1.16.0 // indirect + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.1 // indirect github.com/hashicorp/cli v1.1.6 // indirect @@ -49,7 +50,6 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/copystructure v1.0.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.0 // indirect github.com/oklog/run v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/configutil/go.sum b/configutil/go.sum index 101871a..ffe7174 100644 --- a/configutil/go.sum +++ b/configutil/go.sum @@ -15,6 +15,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -81,8 +83,6 @@ github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMK github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= diff --git a/kv-builder/builder.go b/kv-builder/builder.go index 9bb12f4..00e3adc 100644 --- a/kv-builder/builder.go +++ b/kv-builder/builder.go @@ -12,7 +12,7 @@ import ( "os" "strings" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // Builder is a struct to build a key/value mapping based on a list diff --git a/kv-builder/go.mod b/kv-builder/go.mod index 35f9de6..f132238 100644 --- a/kv-builder/go.mod +++ b/kv-builder/go.mod @@ -2,4 +2,4 @@ module github.com/hashicorp/go-secure-stdlib/kv-builder go 1.16 -require github.com/mitchellh/mapstructure v1.4.1 +require github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 diff --git a/kv-builder/go.sum b/kv-builder/go.sum index 07a9ee1..aa92006 100644 --- a/kv-builder/go.sum +++ b/kv-builder/go.sum @@ -1,2 +1,2 @@ -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= diff --git a/parseutil/go.mod b/parseutil/go.mod index 2a811cf..8bff713 100644 --- a/parseutil/go.mod +++ b/parseutil/go.mod @@ -3,9 +3,9 @@ module github.com/hashicorp/go-secure-stdlib/parseutil go 1.20 require ( + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 github.com/hashicorp/go-sockaddr v1.0.6 - github.com/mitchellh/mapstructure v1.5.0 github.com/stretchr/testify v1.8.4 ) diff --git a/parseutil/go.sum b/parseutil/go.sum index cfdfc19..b78ffcd 100644 --- a/parseutil/go.sum +++ b/parseutil/go.sum @@ -1,11 +1,11 @@ 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/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= github.com/hashicorp/go-sockaddr v1.0.6 h1:RSG8rKU28VTUTvEKghe5gIhIQpv8evvNpnDEyqO4u9I= github.com/hashicorp/go-sockaddr v1.0.6/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= diff --git a/parseutil/parseutil.go b/parseutil/parseutil.go index eb3c0a5..ca5cfed 100644 --- a/parseutil/parseutil.go +++ b/parseutil/parseutil.go @@ -13,9 +13,9 @@ import ( "strings" "time" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/go-secure-stdlib/strutil" sockaddr "github.com/hashicorp/go-sockaddr" - "github.com/mitchellh/mapstructure" ) var validCapacityString = regexp.MustCompile("^[\t ]*([0-9]+)[\t ]?([kmgtKMGT][iI]?[bB])?[\t ]*$") diff --git a/random/go.mod b/random/go.mod index f170825..ffd9355 100644 --- a/random/go.mod +++ b/random/go.mod @@ -3,9 +3,9 @@ module github.com/hashicorp/go-secure-stdlib/random go 1.22.1 require ( + github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/hcl v1.0.1-vault-5 - github.com/mitchellh/mapstructure v1.5.0 ) require ( diff --git a/random/go.sum b/random/go.sum index aa8c111..b242196 100644 --- a/random/go.sum +++ b/random/go.sum @@ -1,6 +1,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 h1:TQcrn6Wq+sKGkpyPvppOz99zsMBaUOKXq6HSv655U1c= +github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -8,5 +10,3 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/hcl v1.0.1-vault-5 h1:kI3hhbbyzr4dldA8UdTb7ZlVVlI2DACdCfz31RPDgJM= github.com/hashicorp/hcl v1.0.1-vault-5/go.mod h1:XYhtn6ijBSAj6n4YqAaf7RBPS4I06AItNorpy+MoQNM= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= diff --git a/random/parser.go b/random/parser.go index c5e82c8..fcecc88 100644 --- a/random/parser.go +++ b/random/parser.go @@ -8,8 +8,8 @@ import ( "reflect" "unicode/utf8" + "github.com/go-viper/mapstructure/v2" "github.com/hashicorp/hcl" - "github.com/mitchellh/mapstructure" ) // ParsePolicy is a convenience function for parsing HCL into a StringGenerator. diff --git a/random/registry_test.go b/random/registry_test.go index 21297aa..079ff9b 100644 --- a/random/registry_test.go +++ b/random/registry_test.go @@ -8,7 +8,7 @@ import ( "reflect" "testing" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) type testCharsetRule struct { diff --git a/random/rules.go b/random/rules.go index 05cc800..a99eee0 100644 --- a/random/rules.go +++ b/random/rules.go @@ -6,7 +6,7 @@ package random import ( "fmt" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // Rule to assert on string values. diff --git a/random/serializing.go b/random/serializing.go index 5b68d32..65983fd 100644 --- a/random/serializing.go +++ b/random/serializing.go @@ -7,7 +7,7 @@ import ( "encoding/json" "fmt" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // serializableRules is a slice of rules that can be marshalled to JSON in an HCL format