Skip to content

Conversation

tusharpandey13
Copy link
Contributor

This pull request resolves a TypeScript error by aligning the clientAssertionSigningKey type with the jose library. This ensures the key is correctly processed for client assertion signing.

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

🔍 RCA

The clientAssertionSigningKey property was typed as a generic CryptoKey, but it was being assigned a jose.CryptoKey. This created a type conflict because jose.CryptoKey is not directly assignable to the Web Crypto CryptoKey type.

📋 Changes

The changes align the type definitions and ensure the key is correctly cast when used.

  • Changed src/server/auth-client.test.ts: Updated the test helper's privateKey parameter to use jose.CryptoKey.
  • Changed src/server/auth-client.ts: Updated clientAssertionSigningKey to use jose.CryptoKey and cast it to CryptoKey when calling oauth.PrivateKeyJwt.

🎯 Testing

Automated:
The existing test suite covers the client assertion signing logic and continues to pass with these type corrections.

Cherry-picked and combined commits:
- 2c0a2f2: chore: fix linting
- 157189c: fix: fix keylike errors in lint
- d029787: simplify lint changes

This fixes TypeScript linting errors related to jose.KeyLike type usage
by properly defining the supported key types for client assertion signing.
@tusharpandey13 tusharpandey13 requested a review from a team as a code owner July 23, 2025 17:16
@tusharpandey13 tusharpandey13 enabled auto-merge (squash) July 23, 2025 17:16
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.41%. Comparing base (533c4b7) to head (289bc83).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2243   +/-   ##
=======================================
  Coverage   84.40%   84.41%           
=======================================
  Files          26       26           
  Lines        2379     2380    +1     
  Branches      442      442           
=======================================
+ Hits         2008     2009    +1     
  Misses        365      365           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tusharpandey13 tusharpandey13 merged commit 2cfe390 into main Jul 23, 2025
12 checks passed
@tusharpandey13 tusharpandey13 deleted the bugfix/fix-keylike-linting-error branch July 23, 2025 18:35
@tusharpandey13 tusharpandey13 mentioned this pull request Aug 1, 2025
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.

3 participants