Skip to content

Add OidcTokenBinding types for oidc_tokens bindings - #8739

Merged
edevil merged 3 commits into
cloudflare:mainfrom
efalcao:efalcao/oidc-token-types
Nov 23, 2026
Merged

edevil merged 3 commits into
cloudflare:mainfrom
efalcao:efalcao/oidc-token-types

Conversation

@efalcao

@efalcao efalcao commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Adds the OidcTokenBinding interface for the new oidc_tokens binding. The binding issues OpenID Connect tokens for the Worker's own identity, for the one audience set in its config. getToken() returns a newly signed JWT, valid for 5 minutes, with a new jti on each call.

The binding is implemented by a Cloudflare-internal JSRPC entrypoint, so this PR adds only the type: types/defines/oidc-token.d.ts, plus the matching entries in the generated snapshots.

I updated the four types/generated-snapshot files by hand, inserting the define where the alphabetical concatenation puts it, because Bazel couldn't fetch its registry on my machine. CI's snapshot check verifies them.

Wrangler emits OidcTokenBinding in wrangler types output, in a companion workers-sdk PR, so it would be good to land this one first.

🤖 Generated with Claude Code

An oidc_tokens binding issues OpenID Connect tokens for the Worker's own
identity, for the audience set in its config. Its getToken() returns a newly
signed JWT, valid for 5 minutes, with a new jti on each call.

The generated snapshots were updated by hand: Bazel couldn't fetch its
registry here, so CI's snapshot check verifies them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@efalcao
efalcao requested review from a team as code owners November 20, 2026 14:30
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@clanky-the-clanker

clanky-the-clanker Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

This pull request's reviews are posted as pull request reviews: see the review of d81134b0.

@efalcao

efalcao commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 20, 2026
@edevil

edevil commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

clanky review

@edevil edevil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The types match the agreed spec, and the doc comments match what oidc-binding does (5-minute exp, a new jti per call). Two small wording suggestions inline.

Comment thread types/defines/oidc-token.d.ts Resolved
Comment thread types/defines/oidc-token.d.ts Resolved

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Out of date: this review is of d81134b0; the pull request is now at f6c1a445. Someone with write access can comment clanky review (or clanker review or @clanky-the-clanker review) to review the new commits.

✅ Approved — A type-only addition that follows the repository's conventions for defines. The only open points are two doc-comment wording nits that are already raised in the discussion.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

📋 Code Quality: ✅ LGTM

The interface name has the product prefix, the snapshots match the define at the alphabetical insertion point, and the .ts/.d.ts forms match the entries around them. The open binding-name wording point is covered in the summary.


📝 Documentation: ✅ LGTM

The doc comments describe the current behaviour: one audience per binding, a 5-minute validity and a new jti per call. The suggestions to mention the Durable Object namespace subject and the singular binding name are covered in the summary.


Reviewed commit: d81134b0

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.40%. Comparing base (8325eed) to head (f6c1a44).
⚠️ Report is 43 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8739      +/-   ##
==========================================
- Coverage   67.44%   67.40%   -0.05%     
==========================================
  Files         835      836       +1     
  Lines      213242   213602     +360     
  Branches    32469    32470       +1     
==========================================
+ Hits       143825   143976     +151     
- Misses      50327    50537     +210     
+ Partials    19090    19089       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread types/defines/oidc-token.d.ts Resolved
@edevil
edevil merged commit b0df89a into cloudflare:main Nov 23, 2026
31 of 33 checks passed
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.

5 participants