Skip to content

feat(shared): Add oiat field to JwtHeader type#8107

Merged
nikosdouvlis merged 2 commits into
mainfrom
nikos/plat-2469-oiat-jwt-header-type
Apr 3, 2026
Merged

feat(shared): Add oiat field to JwtHeader type#8107
nikosdouvlis merged 2 commits into
mainfrom
nikos/plat-2469-oiat-jwt-header-type

Conversation

@nikosdouvlis
Copy link
Copy Markdown
Member

@nikosdouvlis nikosdouvlis commented Mar 18, 2026

Why

Session Minter uses oiat (original_issued_at) in the JWT header to track when token claims were last assembled from the DB. Edge re-mints copy this value forward, so consumers can determine claim freshness regardless of how many times the token was re-signed at the edge.

What

Add oiat?: number to the JwtHeader interface in jwtv2.ts. Marked @internal.

Test plan

  • Type-only change, no runtime behavior
  • Existing JWT parsing still works (oiat passes through via JSON.parse)

Summary by CodeRabbit

  • Chores
    • Internal improvements to JWT token handling infrastructure to support enhanced token management capabilities.

Session Minter uses oiat (original_issued_at) in the JWT header to
track when token claims were last assembled from the DB. Edge
re-mints copy this value forward, so consumers can determine claim
freshness regardless of how many times the token was re-signed.

Marked @internal so developers don't depend on this field.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 18, 2026

🦋 Changeset detected

Latest commit: ee6914d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 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/expo-passkeys Patch
@clerk/expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/hono Patch
@clerk/localizations Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/react Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/ui Patch
@clerk/vue Patch

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Apr 3, 2026 0:58am

Request Review

@nikosdouvlis nikosdouvlis marked this pull request as ready for review April 3, 2026 12:57
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 3, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@8107

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@8107

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@8107

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@8107

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@8107

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@8107

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@8107

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@8107

@clerk/express

npm i https://pkg.pr.new/@clerk/express@8107

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@8107

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@8107

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@8107

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@8107

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@8107

@clerk/react

npm i https://pkg.pr.new/@clerk/react@8107

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@8107

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@8107

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@8107

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@8107

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@8107

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@8107

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@8107

commit: ee6914d

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro

Run ID: faa483ba-a8c6-4e43-871f-67c368438f99

📥 Commits

Reviewing files that changed from the base of the PR and between abfd5ef and ee6914d.

📒 Files selected for processing (2)
  • .changeset/session-minter-oiat-type.md
  • packages/shared/src/types/jwtv2.ts

📝 Walkthrough

Walkthrough

This pull request adds a changeset entry for the @clerk/shared package indicating a patch-level release. The JwtHeader interface in packages/shared/src/types/jwtv2.ts is extended with a new optional field oiat?: number. The field, documented as @internal, represents the original\_issued\_at timestamp and is intended for Session Minter monotonic token freshness checks. External dependencies on this field are discouraged.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(shared): Add oiat field to JwtHeader type' directly and clearly summarizes the main change in the pull request, which is adding the oiat field to the JwtHeader type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@nikosdouvlis nikosdouvlis merged commit 636b496 into main Apr 3, 2026
44 checks passed
@nikosdouvlis nikosdouvlis deleted the nikos/plat-2469-oiat-jwt-header-type branch April 3, 2026 13:15
nikosdouvlis added a commit that referenced this pull request May 12, 2026
Resolve tokenCache.ts conflict by adopting main's orphan guard
(cache.get(key) !== value short-circuit from #8098); drop the PR's
redundant compare-and-swap. Monotonic enforcement remains at the
broadcast handler, cookie write path, and Session resource where
user-visible state lives.

Drop stale changesets that were superseded by merged work:
- session-minter-oiat-type.md (oiat field shipped via #8107)
- session-minter-sdk-params.md (previous-token + force_origin shipped
  via #8105 + #8106 + #8107)
nikosdouvlis added a commit that referenced this pull request May 13, 2026
Resolve tokenCache.ts conflict by adopting main's orphan guard
(cache.get(key) !== value short-circuit from #8098); drop the PR's
redundant compare-and-swap. Monotonic enforcement remains at the
broadcast handler, cookie write path, and Session resource where
user-visible state lives.

Drop stale changesets that were superseded by merged work:
- session-minter-oiat-type.md (oiat field shipped via #8107)
- session-minter-sdk-params.md (previous-token + force_origin shipped
  via #8105 + #8106 + #8107)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants