Skip to content

jwt: Add unified_secret handling#34

Merged
nuclearcat merged 4 commits intokernelci:mainfrom
nuclearcat:unified-secret
Apr 15, 2026
Merged

jwt: Add unified_secret handling#34
nuclearcat merged 4 commits intokernelci:mainfrom
nuclearcat:unified-secret

Conversation

@nuclearcat
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for verifying JWTs using an additional configuration key (unified_secret) as a fallback to jwt_secret, centralizing the verification logic in a helper.

Changes:

  • Introduces verify_with_key_str helper to verify a token with a provided secret and validate required claims.
  • Updates verify_jwt_token to try jwt_secret first, then fall back to unified_secret if present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/storjwt.rs Outdated
Comment thread src/storjwt.rs Outdated
Comment on lines +48 to +49

Err(jwt::Error::InvalidSignature)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

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

When jwt_secret verification fails and unified_secret is not configured, the function returns a generic jwt::Error::InvalidSignature here, discarding the original verification error from the first attempt. Consider carrying the first error through (e.g., store it and return it when no fallback key exists) so failures are diagnosed accurately.

Copilot uses AI. Check for mistakes.
Comment thread src/storjwt.rs
…on too

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
jwt seems abandoned 5 years ago

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
@nuclearcat nuclearcat merged commit 3d85a35 into kernelci:main Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants