Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

NOISSUE - Update jwt package to v5 and refactor claims usage#124

Merged
dborovcanin merged 2 commits into
absmach:mainfrom
SammyOina:jwt-dep
Jun 12, 2025
Merged

NOISSUE - Update jwt package to v5 and refactor claims usage#124
dborovcanin merged 2 commits into
absmach:mainfrom
SammyOina:jwt-dep

Conversation

@SammyOina

Copy link
Copy Markdown
Contributor

What type of PR is this?

This is a security fix of https://github.com/absmach/certs/security/dependabot/7

What does this do?

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Did you document any new/modified features?

Notes

Signed-off-by: Sammy Oina <sammyoina@gmail.com>
@SammyOina SammyOina requested review from Copilot and nyagamunene June 11, 2025 16:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the JWT dependency to v5 and refactors all uses of StandardClaims to RegisteredClaims, adjusting expiration handling accordingly.

  • Upgrade github.com/golang-jwt/jwt to v5
  • Replace StandardClaims with RegisteredClaims and use jwt.NewNumericDate
  • Adjust imports and tests to match the v5 API

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
service.go Switched import to /jwt/v5, updated parsing and creation to RegisteredClaims
go.mod Bumped github.com/golang-jwt/jwt from v3.2.2 to v5.2.2
certs_test.go Updated import path and test token creation to use RegisteredClaims
Comments suppressed due to low confidence (1)

certs_test.go:167

  • There is no test covering RetrieveCAToken. Adding a test for that function will ensure the new RegisteredClaims behavior in RetrieveCAToken is validated.
func TestGetCert(t *testing.T) {

@SammyOina SammyOina requested a review from dborovcanin June 11, 2025 16:50
@absmach absmach deleted a comment from Copilot AI Jun 11, 2025
@SammyOina SammyOina self-assigned this Jun 11, 2025
@SammyOina SammyOina moved this to 🩺 Review and testing in Magistrala Jun 11, 2025
Comment thread certs_test.go Outdated
@github-project-automation github-project-automation Bot moved this from 🩺 Review and testing to 🚧 In Progress in Magistrala Jun 12, 2025
Signed-off-by: Sammy Oina <sammyoina@gmail.com>
@github-project-automation github-project-automation Bot moved this from 🚧 In Progress to 🚀 Ready for merge in Magistrala Jun 12, 2025
@dborovcanin dborovcanin merged commit 8081bc5 into absmach:main Jun 12, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from 🚀 Ready for merge to ✅ Done in Magistrala Jun 12, 2025
@SammyOina SammyOina deleted the jwt-dep branch June 12, 2025 08:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

4 participants