Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: add missing kid to JWT header #585

Merged
merged 1 commit into from
Nov 19, 2024
Merged

fix: add missing kid to JWT header #585

merged 1 commit into from
Nov 19, 2024

Conversation

dbarrosop
Copy link
Member

@dbarrosop dbarrosop commented Nov 19, 2024

PR Type

Bug fix


Description

  • Added a kid field to the JWTGetter struct to include the Key ID in the JWT header.
  • Initialized the kid field in the NewJWTGetter function using the jwtSecret.KeyID.
  • Modified the GetToken method to include the kid in the JWT header if it is not empty.

Changes walkthrough 📝

Relevant files
Bug fix
jwt.go
Add missing `kid` to JWT header in `JWTGetter`                     

go/controller/jwt.go

  • Added kid field to JWTGetter struct.
  • Initialized kid field in NewJWTGetter function.
  • Included kid in JWT header if present in GetToken method.
  • +5/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Bug
    Ensure that the kid field is correctly populated and used in the JWT header. Verify that jwtSecret.KeyID is always set and valid, as an empty or incorrect kid could lead to token validation issues.

    Code Smell
    Consider adding unit tests to validate the inclusion of the kid field in the JWT header. This will help ensure that the new functionality works as expected and prevent future regressions.

    Copy link
    Contributor

    PR Code Suggestions ✨

    @dbarrosop dbarrosop merged commit ff724cd into main Nov 19, 2024
    7 checks passed
    @dbarrosop dbarrosop deleted the missing-kid branch November 19, 2024 12:37
    # for free to join this conversation on GitHub. Already have an account? # to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants