Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2023-11-06 18:33:03 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2023-11-06 18:33:03 +0300
commitfdb24f8053fae1a4caff72097a4b2e80cb40bb1e (patch)
treed4ab9fd04d6c156a5bc7f2d0c8efc499d98cefca /internal
parent27c081fad0bc2a29f0392dad809e00faa4a5a618 (diff)
Update module github.com/golang-jwt/jwt/v4 to v5
Diffstat (limited to 'internal')
-rw-r--r--internal/auth/auth_code.go2
-rw-r--r--internal/auth/auth_code_test.go8
-rw-r--r--internal/source/gitlab/client/client.go2
-rw-r--r--internal/source/gitlab/client/client_test.go2
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"