-
Notifications
You must be signed in to change notification settings - Fork 334
feat(backend,nextjs): Machine-to-Machine #4875
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 2810822 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
237e875
to
89949d4
Compare
!snapshot |
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@2.1.7-snapshot.v20250122203406 --save-exact
npm i @clerk/backend@1.22.0-snapshot.v20250122203406 --save-exact
npm i @clerk/chrome-extension@2.1.11-snapshot.v20250122203406 --save-exact
npm i @clerk/clerk-js@5.44.0-snapshot.v20250122203406 --save-exact
npm i @clerk/clerk-expo@2.6.10-snapshot.v20250122203406 --save-exact
npm i @clerk/express@1.3.34-snapshot.v20250122203406 --save-exact
npm i @clerk/fastify@2.1.7-snapshot.v20250122203406 --save-exact
npm i @clerk/nextjs@6.10.0-snapshot.v20250122203406 --save-exact
npm i @clerk/nuxt@1.0.3-snapshot.v20250122203406 --save-exact
npm i @clerk/react-router@0.1.8-snapshot.v20250122203406 --save-exact
npm i @clerk/remix@4.4.9-snapshot.v20250122203406 --save-exact
npm i @clerk/tanstack-start@0.8.8-snapshot.v20250122203406 --save-exact
npm i @clerk/testing@1.4.7-snapshot.v20250122203406 --save-exact |
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.
we need to run every test in this file with entity: 'machine'
and entity: 'any'
now and in the future when future features get tests written to ensure the entities are doing the right thing
currently, these tests do pass when i manually copy and paste the file and manually input the entities
but i need recommendations on a idiomatic way to do this in vitest 🙏
(chatgpt recommended some cursed ways so unless there's a straightforward way to do this, imma send the cursed way)
Hello 👋 We currently close PRs after 60 days of inactivity. It's been 50 days since the last update here. If we missed this PR, please reply here. Otherwise, we'll close this PR in 10 days. Thanks for being a part of the Clerk community! 🙏 |
Description
Adds machine to machine. Dx guide here
The spicy changes are in
/backend/src/tokens/request.ts
,/nextjs/src/server/clerkMiddleware.ts
,/nextjs/src/server/data/getAuthFromRequest.ts
.The changes to authenticate request adds the MachineAuthenticated and MachineUnauthenticated objects and the logic required.
In nextjs middleware specifically, I check the JWT sub claim in middleware and if it's prefixed withDiscussion here Introducingmch_
, passentity: machine
to authenticateRequest. There's a few alternatives but that's the meat and potatoes of this.entity: any
Half of this PR is just test code
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change