-
Notifications
You must be signed in to change notification settings - Fork 283
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
feat(backend,clerk-sdk-node): Simplify the authenticateRequest signature #1329
feat(backend,clerk-sdk-node): Simplify the authenticateRequest signature #1329
Conversation
🦋 Changeset detectedLatest commit: c2f124f The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Great news! Jit hasn't found any security issues in your PR. Good Job! 🏆
6da8e5e
to
af9b738
Compare
!snapshot |
Hey @nikosdouvlis - the snapshot version command generated the following package versions:
Tip: use the snippet copy button below to quickly install the required packages. # @clerk/backend
npm i @clerk/backend@0.22.0-snap.af9b738 # @clerk/chrome-extension
npm i @clerk/chrome-extension@0.3.8-snap.af9b738 # @clerk/clerk-js
npm i @clerk/clerk-js@4.45.1-snap.af9b738 # eslint-config-custom
npm i eslint-config-custom@0.3.0 # @clerk/clerk-expo
npm i @clerk/clerk-expo@0.17.8-snap.af9b738 # @clerk/fastify
npm i @clerk/fastify@0.4.6-snap.af9b738 # gatsby-plugin-clerk
npm i gatsby-plugin-clerk@4.3.7-snap.af9b738 # @clerk/localizations
npm i @clerk/localizations@1.17.1-snap.af9b738 # @clerk/nextjs
npm i @clerk/nextjs@4.20.0-snap.af9b738 # @clerk/clerk-react
npm i @clerk/clerk-react@4.19.0-snap.af9b738 # @clerk/remix
npm i @clerk/remix@2.6.6-snap.af9b738 # @clerk/clerk-sdk-node
npm i @clerk/clerk-sdk-node@4.10.4-snap.af9b738 # @clerk/shared
npm i @clerk/shared@0.18.0-snap.af9b738 # @clerk/themes
npm i @clerk/themes@1.7.5 # @clerk/types
npm i @clerk/types@3.41.1-snap.af9b738 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job @anagstef :)
publishableKey: string; | ||
/** | ||
* @deprecated Use `publishableKey` instead. | ||
*/ | ||
frontendApi: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can we have both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have wayy more context that me here so please ignore if it doesn't make sense, however, the usual way to write this would be:
type ExclusiveAOrB = {
a: string;
b?: never;
} | {
a?: never;
b: string;
}
(notice the ?
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can we have both?
@nikosdouvlis Isn't this a breaking change (on the type-level) of anyone passing both?
af9b738
to
680f728
Compare
- One pair of legacy or new instance keys are required instead of all 4 of them in `authenticateRequest` - `@clerk/backend` now can handle the `Bearer` prefix in Authorization header for better DX - `host` parameter is now optional in `@clerk/backend`
680f728
to
c2f124f
Compare
…equest (clerk#1329) - One pair of legacy or new instance keys are required instead of all 4 of them in `authenticateRequest` - `@clerk/backend` now can handle the `Bearer` prefix in Authorization header for better DX - `host` parameter is now optional in `@clerk/backend`
This PR has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Type of change
Packages affected
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore
Description
npm test
runs as expected.npm run build
runs as expected.This PR simplifies the signature of
authenticateRequest
for better DX on both@clerk/backend
and@clerk/clerk-sdk-node
packages:@clerk/backend
now can handle the"Bearer "
prefix in Authorization header for better DXhost
parameter is now optional in@clerk/backend
Example of using
authenticateRequest
Before:
After this PR: