chore(client): internalize jwt-decode (KNO-13812)#1021
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c9a48f5 to
66bf33e
Compare
🦋 Changeset detectedLatest commit: 66bf33e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kyle-kno-13814-remove-the-clsx-dependency-from-knocklabsreact-native #1021 +/- ##
========================================================================================================
+ Coverage 63.44% 63.56% +0.12%
========================================================================================================
Files 208 209 +1
Lines 10000 10059 +59
Branches 1280 1298 +18
========================================================================================================
+ Hits 6344 6394 +50
- Misses 3631 3640 +9
Partials 25 25
|

Description
Internalizes
jwt-decodein@knocklabs/clientand drops the runtime dependency. The package only base64url-decodes a JWT payload andJSON.parses it (no signature verification), so it is reimplemented as a small internal module.What changed
packages/client/src/jwt/— a dedicated folder containing the decoder (jwtDecode, theJwtPayloadtype, andInvalidTokenError).knock.ts(value) andinterfaces.ts(type), and updated the mock intest/knock.test.tsto target the internal module.packages/client/test/jwt.test.tscovering standard claims, custom-claim typing, unicode payloads, base64url padding, andInvalidTokenErrorcases.jwt-decodefrompackages/client/package.jsonand updated the lockfile (it was not a transitive dependency of anything else, so it is fully removed).Why: Part of the npm supply chain hardening effort.
@knocklabs/clientis published, so dropping the dependency also removes it from every consumer's install graph.Linear: KNO-13812
Stack (bottom → top) — npm supply chain hardening:
clsxfrom@knocklabs/reactjwt-decodein@knocklabs/client◀ this PRlodash.debouncein@knocklabs/reactfast-deep-equalin@knocklabs/react-coreChecklist
test/jwt.test.ts) and the existingknock.test.tssuite passes.