Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ puts jwt
import sys
import time

import jwt
from jwt import JWT, jwk_from_pem


# Get PEM file path
Expand All @@ -101,7 +101,7 @@ else:

# Open PEM
with open(pem, 'rb') as pem_file:
signing_key = pem_file.read()
signing_key = jwk_from_pem(pem_file.read())

payload = {
# Issued at time
Expand All @@ -115,7 +115,8 @@ payload = {
}

# Create JWT
encoded_jwt = jwt.encode(payload, signing_key, algorithm='RS256')
instance = JWT()
Copy link
Preview

Copilot AI Jul 20, 2025

Choose a reason for hiding this comment

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

The parameter name change from 'algorithm' to 'alg' should be documented or explained in the surrounding text to help users understand why this change was made, especially since this differs from the previous API.

Suggested change
instance = JWT()
instance = JWT()
# The 'alg' parameter specifies the algorithm used for signing the JWT.
# It corresponds to the 'algorithm' parameter in the previous API.

Copilot uses AI. Check for mistakes.

This comment was marked as spam.

This comment was marked as spam.

encoded_jwt = instance.encode(payload, signing_key, alg='RS256')

print(f"JWT: {encoded_jwt}")
```
Expand Down
Loading