Skip to content

feat(jwt): support more algorithms#12944

Merged
nic-6443 merged 12 commits intoapache:masterfrom
shreemaan-abhishek:feat/support-more-algo
Feb 6, 2026
Merged

feat(jwt): support more algorithms#12944
nic-6443 merged 12 commits intoapache:masterfrom
shreemaan-abhishek:feat/support-more-algo

Conversation

@shreemaan-abhishek
Copy link
Contributor

Description

Support more algorithms used to generate jwt tokens.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Jan 27, 2026
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
nic-6443
nic-6443 previously approved these changes Jan 29, 2026
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
f
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
membphis
membphis previously approved these changes Feb 3, 2026
Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

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

nice PR, minor issues


function _M.new(token)
local jwt_obj = jwt:load_jwt(token)
if not jwt_obj.valid then
Copy link
Member

Choose a reason for hiding this comment

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

pls confirm the jwt_obj is a table always


function _M.verify_signature(self, key)
return alg_verify[self.header.alg](self.raw_header .. "." ..
self.raw_payload, base64_decode(self.signature), key)
Copy link
Member

Choose a reason for hiding this comment

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

pls add 4 spaces



function _M.get_default_claims(self)
return {
Copy link
Member

Choose a reason for hiding this comment

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

use a global lua variable, then we can reuse this table

Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
f
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
nic-6443
nic-6443 previously approved these changes Feb 4, 2026
Signed-off-by: Abhishek Choudhary <shreemaan.abhishek@gmail.com>
@nic-6443 nic-6443 requested a review from membphis February 6, 2026 01:13
@nic-6443 nic-6443 merged commit 282995f into apache:master Feb 6, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants