Repository navigation
Support Workers identity bindings and caller runtime types - #465
Draft
irvinebroque wants to merge 12 commits into
Draft
irvinebroque wants to merge 12 commits into
irvinebroque wants to merge 12 commits into
Conversation
Pin the SDK packages to 40ff3ab so configuration, development sessions, and deployment share the reviewed audience validation. Keep the dependency integrity lock and supply-chain policy enabled.
Pin the reviewed Workers SDK prerelease for fixed audiences, fresh grants and signed fetch. Preserve development auth-profile forwarding and update config tests and release notes.
commit: |
Contributor
|
LGTM |
Contributor
|
| mean | stddev | min | max | |
|---|---|---|---|---|
| PR | 280.0 ms | 5.2 ms | 274.6 ms | 291.6 ms |
| base | 279.3 ms | 4.5 ms | 271.8 ms | 285.2 ms |
Δ (PR vs base): — +0.7 ms (+0.2%)
Measured with hyperfine on ubuntu-latest (3 warmup runs, 20 timed runs). CI numbers carry ±a few ms of runner jitter; treat small deltas as noise.
Contributor
|
LGTM! |
Remove identity-specific local auth profile forwarding. Consume matching SDK packages with explicit unsupported local methods and deployed Preview support. Preserve identity configuration and upload validation.
Contributor
|
LGTM! |
| /\/oidc\/(identities|assignments|development_sessions)/.test(request) | ||
| ) | ||
| ).toBe(false); | ||
| }); |
Contributor
There was a problem hiding this comment.
The deploy test only uploads identity bindings with an audience, so a regression in the newly supported signing-only serialization path would still pass. Add a deployed signing-only case:
Suggested change
| }); | |
| }); | |
| it("uploads signing-only identity bindings without provisioning identities", async () => { | |
| const requests = recordRequests(); | |
| const upload = mockWorkerUpload(); | |
| await seed({ | |
| ".cloudflare/output/v0/config.json": buildOutputRootConfig(), | |
| ".cloudflare/output/v0/workers/default/worker.config.json": | |
| workerConfig({ | |
| compatibilityFlags: ["workers_oidc"], | |
| env: { | |
| IDENTITY: { | |
| type: "identity", | |
| request_signing: { | |
| allowed_origins: ["https://api.example.com"], | |
| allowed_methods: ["GET"], | |
| }, | |
| }, | |
| }, | |
| }), | |
| ".cloudflare/output/v0/workers/default/bundle/index.js": | |
| "export default {fetch() {return new Response('ok')}}", | |
| }); | |
| const { exitCode } = await runCf([ | |
| "deploy", | |
| "--prebuilt", | |
| "--no-provision", | |
| ]); | |
| expect(exitCode).toBe(0); | |
| expect(upload.metadata?.bindings).toContainEqual({ | |
| name: "IDENTITY", | |
| type: "identity", | |
| request_signing: { | |
| allowed_origins: ["https://api.example.com"], | |
| allowed_methods: ["GET"], | |
| }, | |
| }); | |
| expect( | |
| requests.some((request) => | |
| /\/oidc\/(identities|assignments|development_sessions)/.test(request) | |
| ) | |
| ).toBe(false); | |
| }); |
Contributor
|
🤖 I've done a thorough review of your PR. Pins the Workers SDK previews and adds identity binding configuration/type tests.
|
Contributor
|
No new concerns since the last review |
Contributor
|
No new concerns since the last review |
Contributor
|
No new concerns since the last review |
Contributor
|
No new concerns since the last review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consume direct JSRPC identity bindings through the matching SDK configuration, upload, Preview, local-stub, and generated-type packages. Pin all ten SDK previews to
87c195a, published from workers-sdk PR #16455.Selected identities are fixed-selection RPC stubs with asynchronous readonly metadata and normal forwarding, duplication, and disposal. Normalize URL, FormData, and URLSearchParams inputs with
new Request(...)before selected-handle fetch. Select the default identity withgetIdentity()before fetching; the parent has no public fetch method. AbortSignal options and cross-RPC cancellation guarantees are outside this contract. No identity-specific runtime wrapper, customer SDK import, or identity compatibility flag is needed. Token audience remains optional and is required only forgetToken(); HTTP signing has no public profile selector. Local identity operations remain unavailable: use mocks or deployed Previews.Validation: normal frozen install passes with the committed supply-chain policy unchanged. The lockfile changes only SDK URLs/integrities; dependency versions are unchanged. Exact root
pnpm checkpasses 7/7 tasks (8014 formatted files,564 linted files). Focused configuration and actual workers-types command tests pass 10/10. SDK prerelease workflow 41243938912 passes; its config 327, Wrangler type-generation 137, local 2, Preview 26, compiler and lint checks pass.Draft; no deployment or provisioning performed. Account enablement, security review, live receiver enrollment/provider compatibility, and edge performance remain release gates. Full platform CI is reported in checks.
Runtime receiver update: preserve runtime-generated
CloudflareIdentityContext.caller()types for Workers with no outbound identity binding. Add no receiver configuration or JavaScript polyfill.callermeans the authenticated software making the request, separate from any human identity.Validation: all 10
workers typescommand tests pass, including binding-free caller type passthrough. The existing SDK preview pins remain available artifacts; a matched runtime/SDK/types release is still required before advertising receiver support. Seedocs/workers-oidc.mdfor the release dependency.