diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/auth/auth_code.go | 2 | ||||
-rw-r--r-- | internal/auth/auth_code_test.go | 8 | ||||
-rw-r--r-- | internal/source/gitlab/client/client.go | 2 | ||||
-rw-r--r-- | internal/source/gitlab/client/client_test.go | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/internal/auth/auth_code.go b/internal/auth/auth_code.go index ffbd5734..f53aec9d 100644 --- a/internal/auth/auth_code.go +++ b/internal/auth/auth_code.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/gorilla/securecookie" "golang.org/x/crypto/hkdf" ) diff --git a/internal/auth/auth_code_test.go b/internal/auth/auth_code_test.go index 5a496066..cdff4c35 100644 --- a/internal/auth/auth_code_test.go +++ b/internal/auth/auth_code_test.go @@ -56,7 +56,7 @@ func TestEncryptAndDecryptSignedCode(t *testing.T) { encDomain: "domain", code: "code", decDomain: "domain", - expectedDecErrMsg: "Token is expired", + expectedDecErrMsg: "token is expired", }, } @@ -74,7 +74,8 @@ func TestEncryptAndDecryptSignedCode(t *testing.T) { decCode, err := test.auth.DecryptCode(encCode, test.decDomain) if test.expectedDecErrMsg != "" { - require.EqualError(t, err, test.expectedDecErrMsg) + require.Error(t, err) + require.Contains(t, err.Error(), test.expectedDecErrMsg) require.Empty(t, decCode) return } @@ -94,6 +95,7 @@ func TestDecryptCodeWithInvalidJWT(t *testing.T) { require.NoError(t, err) decCode, err := auth2.DecryptCode(encCode, "domain") - require.EqualError(t, err, "signature is invalid") + require.Error(t, err) + require.Contains(t, err.Error(), "signature is invalid") require.Empty(t, decCode) } diff --git a/internal/source/gitlab/client/client.go b/internal/source/gitlab/client/client.go index 4b6ea98d..a876c734 100644 --- a/internal/source/gitlab/client/client.go +++ b/internal/source/gitlab/client/client.go @@ -10,7 +10,7 @@ import ( "path" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "gitlab.com/gitlab-org/labkit/correlation" "gitlab.com/gitlab-org/labkit/log" diff --git a/internal/source/gitlab/client/client_test.go b/internal/source/gitlab/client/client_test.go index 1a6572db..ca7b21fb 100644 --- a/internal/source/gitlab/client/client_test.go +++ b/internal/source/gitlab/client/client_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitlab-pages/internal/domain" |