Skip to content

Commit

Permalink
refactor: migrate to yaml.v3
Browse files Browse the repository at this point in the history
ghodss/yaml is used only in config loading, and the yaml.v3 unmarshaling
appears to be a drop-in replacement; the ghodss/yaml feature of reusing
`json` struct tags for YAML is not used there.

For other uses in the tree, yaml.v3 looks like a drop in replacement for
yaml.v2, too.
  • Loading branch information
scop committed Oct 30, 2023
1 parent 13e30d2 commit 9c1427b
Show file tree
Hide file tree
Showing 30 changed files with 5 additions and 11,026 deletions.
2 changes: 1 addition & 1 deletion cmd/ssh-inscribe/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"

"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

_ "github.com/aakso/ssh-inscribe/internal/auth/backend/all"
"github.com/aakso/ssh-inscribe/internal/config"
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/blang/semver/v4 v4.0.0
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/ghodss/yaml v1.0.0
github.com/gobwas/glob v0.2.3
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/labstack/echo-jwt/v4 v4.2.0
Expand All @@ -28,7 +27,7 @@ require (
gopkg.in/ldap.v2 v2.5.1
gopkg.in/resty.v1 v1.12.0
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
Expand Down Expand Up @@ -56,5 +55,4 @@ require (
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ 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/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a h1:saTgr5tMLFnmy/yg3qDTft4rE5DY2uJ/cCxCe3q0XTU=
github.com/dchest/bcrypt_pbkdf v0.0.0-20150205184540-83f37f9c154a/go.mod h1:Bw9BbhOJVNR+t0jCqx2GC6zv0TGBsShs56Y3gfSCvl0=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
Expand Down Expand Up @@ -142,8 +140,6 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/yaml.v2 v2.2.2/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/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
2 changes: 1 addition & 1 deletion internal/auth/backend/authfile/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bytes"
"os"

yaml "gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

"golang.org/x/crypto/bcrypt"

Expand Down
3 changes: 2 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"os"
"strings"

"github.com/ghodss/yaml"
"github.com/mitchellh/copystructure"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"

"gopkg.in/yaml.v3"
)

var globalConfig map[string]interface{} = make(map[string]interface{})
Expand Down
20 changes: 0 additions & 20 deletions vendor/github.com/ghodss/yaml/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions vendor/github.com/ghodss/yaml/.travis.yml

This file was deleted.

50 changes: 0 additions & 50 deletions vendor/github.com/ghodss/yaml/LICENSE

This file was deleted.

121 changes: 0 additions & 121 deletions vendor/github.com/ghodss/yaml/README.md

This file was deleted.

Loading

0 comments on commit 9c1427b

Please sign in to comment.