Skip to content

Conversation

@ktyagiapphelix2u
Copy link

Description

Removal of pyjwkest dependency from ecommerce

JIRA LINK

https://2u-internal.atlassian.net/browse/BOMS-89

@ktyagiapphelix2u ktyagiapphelix2u changed the base branch from master to 2u/main August 8, 2025 06:29
@ktyagiapphelix2u ktyagiapphelix2u marked this pull request as ready for review August 8, 2025 06:44
Copilot AI review requested due to automatic review settings August 8, 2025 06:44
Copy link

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

This PR removes the pyjwkest dependency from the ecommerce codebase and replaces its JWT functionality with the standard jwt library. The change eliminates an external dependency while maintaining the same JWT signing capabilities.

Key changes:

  • Removed pyjwkest from all requirement files
  • Updated test code to use the jwt library instead of jwkest for JWT token creation
  • Cleaned up dependency comments and references throughout requirement files

Reviewed Changes

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

Show a summary per file
File Description
requirements/e2e.in Removed pyjwkest from e2e test requirements
requirements/e2e.txt Removed pyjwkest and its transitive dependencies from compiled e2e requirements
requirements/test.txt Removed pyjwkest and cleaned up dependency comments in test requirements
requirements/dev.txt Removed pyjwkest and cleaned up dependency comments in dev requirements
ecommerce/social_auth/tests/test_strategies.py Replaced jwkest imports with jwt library and updated JWT creation logic

'exp': timegm(expiration_datetime.utctimetuple()),
}
access_token = JWS(payload, jwk=key, alg='HS512').sign_compact()
access_token = jwt.encode(payload, secret, algorithm='HS512')
Copy link

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

The jwt.encode() method returns a string in newer versions of PyJWT (2.0+), but the original jwkest code expected bytes. This change may cause compatibility issues if the calling code expects bytes. Consider checking how access_token is used elsewhere and potentially add .encode() if bytes are required.

Copilot uses AI. Check for mistakes.
@ktyagiapphelix2u ktyagiapphelix2u changed the title chore: removal of pyjwkest dependency from ecommerce chore!: removal of pyjwkest dependency from ecommerce Aug 11, 2025
Copy link

@jcapphelix jcapphelix left a comment

Choose a reason for hiding this comment

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

Approved, but let @UsamaSadiq have a look on this.

As jwkest is used in test file only I don't see any large impact on it's removal, but still good to have another set of eyes take a look at it.

@ktyagiapphelix2u ktyagiapphelix2u merged commit 2b52397 into 2u/main Aug 25, 2025
6 checks passed
@ktyagiapphelix2u ktyagiapphelix2u deleted the ktyagi/BOMS-89-1 branch August 25, 2025 14:02
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.

4 participants