From 514296a7910e6396b290ee2e16c945f2652959f3 Mon Sep 17 00:00:00 2001 From: Jan Larwig Date: Sat, 24 May 2025 17:05:33 +0200 Subject: [PATCH] resolve cipher deprecation and update mapstructures v2 Signed-off-by: Jan Larwig --- go.mod | 1 - go.sum | 2 -- pkg/apis/options/duration.go | 2 +- pkg/encryption/cipher.go | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a34d4d50..2fbfed82 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,6 @@ require ( github.com/gorilla/mux v1.8.1 github.com/justinas/alice v1.2.0 github.com/mbland/hmacauth v0.0.0-20170912233209-44256dfd4bfa - github.com/mitchellh/mapstructure v1.5.0 github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25 github.com/onsi/ginkgo/v2 v2.23.4 github.com/onsi/gomega v1.38.0 diff --git a/go.sum b/go.sum index c653cee5..8a0826d6 100644 --- a/go.sum +++ b/go.sum @@ -79,8 +79,6 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= github.com/mbland/hmacauth v0.0.0-20170912233209-44256dfd4bfa h1:hI1uC2A3vJFjwvBn0G0a7QBRdBUp6Y048BtLAHRTKPo= github.com/mbland/hmacauth v0.0.0-20170912233209-44256dfd4bfa/go.mod h1:8vxFeeg++MqgCHwehSuwTlYCF0ALyDJbYJ1JsKi7v6s= -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/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25 h1:9bCMuD3TcnjeqjPT2gSlha4asp8NvgcFRYExCaikCxk= diff --git a/pkg/apis/options/duration.go b/pkg/apis/options/duration.go index da13d96e..15f8776d 100644 --- a/pkg/apis/options/duration.go +++ b/pkg/apis/options/duration.go @@ -4,7 +4,7 @@ import ( "reflect" "time" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) // Duration is an alias for time.Duration so that we can ensure the marshalling diff --git a/pkg/encryption/cipher.go b/pkg/encryption/cipher.go index 300bba3a..ae5b50a3 100644 --- a/pkg/encryption/cipher.go +++ b/pkg/encryption/cipher.go @@ -79,7 +79,7 @@ func (c *cfbCipher) Decrypt(ciphertext []byte) ([]byte, error) { iv, ciphertext := ciphertext[:aes.BlockSize], ciphertext[aes.BlockSize:] plaintext := make([]byte, len(ciphertext)) - stream := cipher.NewCFBDecrypter(c.Block, iv) //nolint:staticcheck + stream := cipher.NewCFBEncrypter(c.Block, iv) //nolint:staticcheck stream.XORKeyStream(plaintext, ciphertext) return plaintext, nil