chore(express,hono): Add machine auth integration tests#8222
chore(express,hono): Add machine auth integration tests#8222wobsoriano wants to merge 8 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: fc1ebeb 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded Playwright integration tests for Express and Hono that provision temporary servers with API key, M2M, and OAuth authenticated routes using Clerk middleware. Updated client entry points to assign the instantiated Clerk client to window.Clerk. Extended Hono clerkMiddleware to read CLERK_MACHINE_SECRET_KEY from the environment, forward machineSecretKey into client and authentication calls, and honor acceptsToken passed to getAuth. Added a changeset documenting the Hono patch. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
…_SECRET_KEY support getAuth() was hardcoding acceptsToken to 'any' in the middleware closure, causing it to accept any token type regardless of the route-level filter. Move getAuthObjectForAcceptedToken to getAuth() to match the Express SDK pattern. Also read CLERK_MACHINE_SECRET_KEY from env vars and pass machineSecretKey to createClerkClient and authenticateRequest, enabling M2M token scope verification without explicit middleware configuration.
Description
Adding complete machine auth (API keys, M2M, OAuth) integration tests to our SDKs:
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
Tests