Repository navigation
feat(scopes): events declares and enforces oauth scopes - #18
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Also the jose devDependency of the scope tests, the lockfile changes are interleaved. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Routes that never read the session (internal secret pushes, ui-logs, vapidkey, api-docs) no longer depend on the caller's credentials: a broken cookie or a stray bearer header used to fail them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…shared lib tools The scope vocabulary is declared with defineScopes (lib-common-types 1.26.0), which brings the global all:* tier scopes and their descriptions; the OpenAPI oauth2 scheme comes from oauth2SecurityScheme; requireScope (lib-express 1.33.0) reads the session itself, so requireOperationScope no longer wraps the session middleware. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
data-fair fetches the document over the private url, without the reverse-proxy headers, and merges it into one document per site: it is now built without the request origin (servers /events/api, relative token url). Each accepted scope is its own security alternative, as standard OpenAPI reads the scopes of one requirement as all needed. x-scopeIncludes is dropped, the platform reads what a global tier scope grants from the operations that accept it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lib-common-types 1.27.0 builds one security alternative per accepted scope and its oauth2 scheme no longer carries x-scopeIncludes, so events stops doing both by hand. The document is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Make events scope-aware: a session whose token carries a
scopeclaim only reaches routes that check one, and gets 403 everywhere else. Sessions without a scope claim and internal secret calls are unchanged.notifications:read/:write,events:read,webhooks:read/:admin, the bare family umbrellas, and the globalall:read/all:write/all:admin, declared withdefineScopes(lib-common-types).api/src/shared/scopes.ts) withrequireScope(lib-express). Push registrations and admin routes stay refused.canSubscribestill applies.GET /api/api-docs.jsondeclares the scopes (fr/en) in anoauth2scheme (oauth2SecurityScheme), each accepted scope as its ownsecurityalternative (oauth2Alternatives). It is public and does not depend on the request origin, so data-fair can merge it into the platform document.Why: phase 1d of the platform authorization roadmap. Scoped sessions come from the NHI token exchange today, and later from users authorizing OAuth client apps.
Heads-up:
all:writedoes not grant it.simple-directory:master(for the scoped NHI exchange) until a release ships it.