Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: jwt v5 (#9961)
Danny Xuedf6d8f5172b
diff --git a/backend/api/auth/auth.go b/backend/api/auth/auth.goindex ae5ba86e1b..342ca2b868 100644--- a/backend/api/auth/auth.go+++ b/backend/api/auth/auth.go@@ -15,7 +15,7 @@ import ("google.golang.org/grpc/metadata""google.golang.org/grpc/status"- "github.com/golang-jwt/jwt/v4"+ "github.com/golang-jwt/jwt/v5"errs "github.com/pkg/errors""github.com/bytebase/bytebase/backend/common"@@ -148,8 +148,7 @@ func (in *APIAuthInterceptor) authenticate(ctx context.Context, accessTokenStr s}return nil, status.Errorf(codes.Unauthenticated, "unexpected access token kid=%v", t.Header["kid"])}); err != nil {- var ve *jwt.ValidationError- if errors.As(err, &ve) && ve.Errors == jwt.ValidationErrorExpired {+ if errors.Is(err, jwt.ErrTokenExpired) {return 0, status.Errorf(codes.Unauthenticated, "access token expired")}return 0, status.Errorf(codes.Unauthenticated, "failed to parse claim")diff --git a/go.mod b/go.modindex 3b726d46bf..1d8abfc54b 100644--- a/go.mod+++ b/go.mod@@ -26,6 +26,7 @@ require (github.com/go-sql-driver/mysql v1.7.1github.com/golang-jwt/jwt v3.2.2+incompatiblegithub.com/golang-jwt/jwt/v4 v4.5.0+ github.com/golang-jwt/jwt/v5 v5.2.0github.com/google/cel-go v0.18.2github.com/google/go-cmp v0.6.0github.com/google/uuid v1.5.0@@ -111,7 +112,6 @@ require (github.com/go-logr/logr v1.3.0 // indirectgithub.com/go-logr/stdr v1.2.2 // indirectgithub.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect- github.com/golang-jwt/jwt/v5 v5.2.0 // indirectgithub.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirectgithub.com/golang-sql/sqlexp v0.1.0 // indirectgithub.com/golang/glog v1.2.0 // indirect