fix(deps): update dependency @cloudflare/workers-oauth-provider to ^0.7.0#87
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency @cloudflare/workers-oauth-provider to ^0.7.0#87renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
d11a781 to
6fdc984
Compare
6fdc984 to
89765c5
Compare
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.
This PR contains the following updates:
^0.4.0→^0.7.0Release Notes
cloudflare/workers-oauth-provider (@cloudflare/workers-oauth-provider)
v0.7.2Compare Source
Patch Changes
#222
45397d8Thanks @mattzcarey! - Add an opt-inallowPublicClientsflag toenterpriseManagedAuthorization.By default the enterprise-managed authorization (ID-JAG) grant requires client authentication, so public clients (
token_endpoint_auth_method: 'none') are rejected. SettingallowPublicClients: truealso accepts public clients on this grant — for example clients registered via a Client ID Metadata Document (CIMD), which are always public and cannot present a client secret. The default remainsfalse, preserving existing behavior.v0.7.1Compare Source
Patch Changes
#221
8e3f08cThanks @mattzcarey! - Preserve RFC 7591 §2.2 internationalized client metadata variants.Localized variants of the human-readable client metadata fields — expressed
with a
#<BCP 47 language tag>suffix on the member name (e.g.client_name#ja,tos_uri#fr) — were previously dropped during clientregistration. They are now captured for
client_name,client_uri,logo_uri,tos_uri, andpolicy_uri, stored on the client record under anew optional
i18nmap (keyed by the rawfield#tagname), and echoed back inthe registration response alongside their canonical fields. The same handling
applies to Client ID Metadata Document ingestion.
Localized values are validated with the same rules as their canonical field:
URI variants must be absolute
http:orhttps:URLs, and all variants mustbe strings. Fields that are not part of RFC 7591 §2.2 (such as
jwks_uriandredirect_uris) are not collected.#218
1f8737dThanks @mattzcarey! - Validate the URI scheme of client metadata fields during client registration.The
client_uri,logo_uri,policy_uri,tos_uri, andjwks_urifieldswere previously only checked to be strings. They are now required to be
absolute
http:orhttps:URLs, consistent with howredirect_urisarealready validated. Registration (and Client ID Metadata Document ingestion)
now rejects values using other schemes with an
invalid_client_metadataerror.
These fields are commonly surfaced in consent UIs (for example as link or
image targets), so restricting them to standard web URLs avoids non-http(s)
schemes flowing through to consumers.
v0.7.0Compare Source
Minor Changes
#208
c59c37bThanks @mattzcarey! - Experimentally support MCP Enterprise-Managed Authorization ID-JAG assertions through the JWT bearer grant.#206
13ff269Thanks @itsandy-canva! - ExposegrantIdtotokenExchangeCallbackviaTokenExchangeCallbackOptions.Implementations of
tokenExchangeCallbackalready receiveduserIdandclientId, but had no way to identify which specific grant the library wasoperating on. This made it impossible to surgically revoke a single grant from
the callback (e.g. on a terminal upstream refresh failure) — implementations had
to either sweep all grants for a
(userId, clientId)pair (racy underconcurrent refreshes) or maintain their own out-of-band mapping.
grantIdis now provided alongsideuserIdso callbacks can pass themdirectly to
OAuthHelpers.revokeGrant. Populated for all three grant types(
authorization_code,refresh_token,token_exchange). Stable acrossrefreshes for the lifetime of the grant.
v0.6.0Compare Source
Minor Changes
#199
bf7d91eThanks @mattzcarey! - ConvertOAuthErrorthrown fromtokenExchangeCallbackinto structured/tokenresponses and convert token storage KV rate limits into retryable OAuth errors.Previously, an error thrown from
tokenExchangeCallbackduring theauthorization_codeorrefresh_tokengrant flows would bubble up as anunhandled exception and be served as
500 Internal Server Error. This forcedclients to keep retrying with the same dead refresh token, producing
"refresh-token retry storms" against upstream providers.
The provider now catches
OAuthErrorthrown from the callback (or any codeit calls — errors propagate naturally up through deep call stacks) and
returns a standard
{ error, error_description }response with the suppliedstatus code and headers. KV
429 Too Many Requestswrite failures while issuingtokens are also returned as
temporarily_unavailablewithRetry-After: 30,so transient storage pressure does not leak Worker
500responses from thetoken endpoint.
OAuthError(code, options)takes:code(positional, required) — the OAuth error code returned in theerrorfield. For standard codes, this package exports theOAuthTokenErrorCodetype.options.description— human-readable text returned inerror_description.options.statusCode— HTTP status code (default400).options.headers— additional response headers. SetRetry-Afterherefor transient failures so well-behaved clients back off; per RFC 7231
§7.1.3 the value may be either seconds or an HTTP-date. No implicit
default — if you don't set it, no
Retry-Afteris sent.Throwing this package's
OAuthErrorclass is the supported form. Anythingelse — plain
Error, plain objects with acodefield, app-local OAutherror classes, etc. — continues to surface as
500 Internal Server Errorso unexpected failures stay visible. The provider does not
catch-everything-and-return-400.
The exported
OAuthErrorclass supersedes the previously-internal one: theconstructor signature is now
(code, options)rather than(code, message).Internal call sites are updated;
descriptionnow lives alongsidestatusCodeandheadersin the options object.New exports:
OAuthError(class),OAuthErrorOptions(interface),OAuthTokenErrorCode(type union of registered codes).v0.5.0Compare Source
Minor Changes
#182
251d641Thanks @threepointone! - Prevent unbounded KV namespace growth with TTL defaults, cascade deletes, and garbage collection.Default TTLs to prevent unbounded storage growth:
refreshTokenTTLnow defaults to 30 days (previously infinite). Grants auto-expire via KV TTL. Set toundefinedexplicitly to restore the previous behavior of never expiring.clientRegistrationTTL(new option) defaults to 90 days. Dynamically registered clients (DCR) auto-expire. Clients created viaOAuthHelpers.createClient()are not affected. Set toundefinedfor clients that never expire.deleteClient()now cascades to grants and tokens:Previously, deleting a client only removed the
client:{id}record, leaving all associated grants and tokens orphaned in KV. NowdeleteClient()scans all grants, revokes those belonging to the deleted client (which also deletes their tokens), and then deletes the client record.New
purgeExpiredData()method for scheduled garbage collection:Defense-in-depth cleanup method designed to be called from a Cron Trigger. Processes records in configurable batches (default: 50) to stay within Cloudflare's subrequest limits. Performs two sweep phases: (1) grant sweep removes orphaned grants (client deleted) and expired grants, (2) token sweep removes orphaned tokens (grant deleted). Safe for CIMD clients — grants with URL-based client IDs are never incorrectly treated as orphaned. Available on both
OAuthHelpers(viaenv.OAUTH_PROVIDER.purgeExpiredData()) and directly onOAuthProvider(viaoauthProvider.purgeExpiredData(env)) for use in scheduled handlers without a request context.New exports:
PurgeOptions,PurgeResultConfiguration
📅 Schedule: (in timezone Asia/Tokyo)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.