Skip to content

fix(shared): Reverse permissions array on parsePermissions to match bitmask correctly#5622

Merged
panteliselef merged 8 commits intomainfrom
elef/fix-jwt-v2-parsing-patch
Apr 14, 2025
Merged

fix(shared): Reverse permissions array on parsePermissions to match bitmask correctly#5622
panteliselef merged 8 commits intomainfrom
elef/fix-jwt-v2-parsing-patch

Conversation

@panteliselef
Copy link
Copy Markdown
Contributor

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@panteliselef panteliselef requested a review from a team April 14, 2025 17:17
@panteliselef panteliselef self-assigned this Apr 14, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 14, 2025 5:32pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 14, 2025

⚠️ No Changeset found

Latest commit: 8417f34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes changesets to release 19 packages
Name Type
@clerk/shared Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/clerk-expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines -57 to -74
test('produced auth object is the same for v1 and v2', () => {
const { sessionClaims: v2Claims, ...signedInAuthObjectV2 } = JWTPayloadToAuthObjectProperties({
...baseClaims,
v: 2,
fea: 'o:impersonation',
o: {
id: 'org_xxxxxxx',
rol: 'admin',
slg: '/test',
per: 'read,manage',
fpm: '3',
},
});

const { sessionClaims: v1Claims, ...signedInAuthObjectV1 } = JWTPayloadToAuthObjectProperties({
...baseClaims,
org_id: 'org_xxxxxxx',
org_role: 'org:admin',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate test

@panteliselef panteliselef enabled auto-merge (squash) April 14, 2025 17:38
@panteliselef panteliselef merged commit 8383df1 into main Apr 14, 2025
30 checks passed
@panteliselef panteliselef deleted the elef/fix-jwt-v2-parsing-patch branch April 14, 2025 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants