-
Notifications
You must be signed in to change notification settings - Fork 537
Prioritize JWT over service API keys in authentication #7020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prioritize JWT over service API keys in authentication #7020
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 2c2d7ef 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 |
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7020 +/- ##
=======================================
Coverage 55.49% 55.49%
=======================================
Files 909 909
Lines 58406 58406
Branches 4069 4072 +3
=======================================
Hits 32415 32415
Misses 25886 25886
Partials 105 105
🚀 New features to boost your workflow:
|
size-limit report 📦
|
68ead6e
to
91b2284
Compare
0407eb8
to
41c93f3
Compare
41c93f3
to
2c2d7ef
Compare
Prioritize JWT over service API keys in authentication
This PR updates the authentication logic in the
@thirdweb-dev/service-utils
package to prioritize JWT tokens over service API keys when both are present. The changes include:getAuthHeaders
utility function that determines the appropriate authentication headers based on the provided auth datafetchTeamAndProject
function to use the new utilityThese changes ensure more consistent and secure authentication behavior across the service.
PR-Codex overview
This PR focuses on enhancing authentication in the
service-utils
package by prioritizing JWT over service API keys. It introduces new functionality for generating authentication headers and updates testing to ensure correct behavior.Detailed summary
.gitignore
to excludedist/
,coverage/
, and other files.package.json
to include@vitest/coverage-v8
.coverage
script topackage.json
.getAuthHeaders
function inget-auth-headers.ts
for dynamic auth header generation.fetchTeamAndProject
inapi.ts
to usegetAuthHeaders
.getAuthHeaders
inget-auth-headers.test.ts
covering various authentication scenarios.