* feat: Support OAuth Client ID Metadata Documents for MCP clients
MCP clients can send an https URL as their client_id. The server fetches
the metadata document at that URL and caches one team-less client row per
URL, so MCP works on the root domain without dynamic registration.
Closes#14010
* fix: Address review findings for client ID metadata documents
- Only count unexpired tokens when cleaning up metadata document clients
- Reject backslashes, whitespace and trailing host dots in client_id URLs
- Strip trailing dots before installation host comparisons
- Type clientSecret as nullable
* fix: Keep OAuth clients with pending authorization codes during cleanup
* refactor: Simplify client ID metadata document handling
- Gate metadata document fetches on the MCP preference inside the helper
- Add isMCPClient getter and a shared client ID prefix constant
- Enforce the team/metadata document CHECK in both directions
- Index oauthClientId on OAuth token and code tables
- Reuse parseDomain, clamp and time helpers
* revert: Remove pending authorization code check from OAuth client cleanup
* fix: Block all special-use addresses when fetching client metadata documents
ALLOWED_PRIVATE_IP_ADDRESSES no longer applies to client ID metadata
document requests (draft -02 section 8.6). The fetch wrapper takes an
allowIPAddressList option to override the environment list.
* fix: Reject empty userinfo in client metadata document URLs
https://@host and https://:@host have a userinfo component that the URL
parser drops, so check the raw authority (draft -02 section 3).
* fix: Accept a root path in client metadata document URLs
Draft -02 section 3 marks a root path as NOT RECOMMENDED, not invalid, so
https://example.com/ is a valid client_id. A URL with no path is still
rejected.
* fix: Reject client metadata documents with private key material
A jwks key with private or symmetric members (d, p, q, dp, dq, qi, oth,
k) makes the document invalid, so it is not cached (draft -02 section 4.1).
Public keys are still ignored.
* fix: Respect no-cache, no-store and Age for client metadata documents
no-store and no-cache now expire the cached document at once, so it is
fetched again before the next authorization. Freshness from max-age or
Expires (measured from Date) is reduced by Age before clamping (draft -02
section 5.2).
* feat: Copy DCR and CIMD client logos to file storage in the background
logo_uri was rendered directly on the consent screen, which lets the logo
host track users and change the image at any time (draft -02 sections 8.8
and 9.2). A background task now fetches the logo with the strict fetch
rules, accepts only PNG, JPEG, GIF and WebP by their leading bytes, and
stores it content addressed in the public bucket. Requests never wait for
the upload.
* fix: Match loopback redirect URIs on any port
Native apps such as Claude Code register http://localhost/callback and
then listen on a free port, so an exact match rejected them. Loopback
redirect URIs now match on any port (RFC 8252 section 7.3); the scheme,
host and path must still match, and other URIs still match exactly.
* fix: Only break the redirect URL mid-word on the consent screen
break-all on the whole notice split words such as "continue" in the
loopback warning. It now applies only to the redirect URL.
* chore: Shorten the loopback warning on the consent screen
* fix: Show the punycode host of client metadata documents on the consent screen
A lookalike Unicode host was shown as written. Hostnames now come from a
shared getHostname helper that returns the punycode form.
* refactor: Move image type detection to ImageHelper and use it for avatars
Avatars and integration logos copied from a URL are now stored only if
they are PNG, JPEG, GIF or WebP, with the content type detected from the
file data rather than the remote host.
* fix: Address review findings for OAuth client logos and metadata caching
- Count the time since the Date header as age when caching metadata
documents, so a document is not cached past its Expires time
- Log logo scheduling failures instead of failing registration requests
- Run dynamic client registration in a transaction
- Delete copied logos from storage when no client uses them
* fix: Store one logo per OAuth client and return a distinct metadata document error
- Logos are stored per client, so a file is only deleted when its own
client stops using it. This removes the reference count and its race.
- A metadata document that cannot be fetched or is invalid now returns
invalid_client_metadata with the reason, not a 404. Network errors
are only logged.
- Move scheduleOptional to BaseTask so that any task can use it.
* feat: Add reasons for archived and deleted documents
* feat: Add deprecation reasons to archived collections
* fix: Refine deprecation reason display for readers
* feat: Accept reasons when archiving or deleting
* Support reasons in archive and delete MCP tools
* Fix placeholder after clearing content editable text
* Keep the caret before content editable placeholders
* Remove test
* feat: Add archive reasons to the confirmation dialog
Dynamic client registration rejected any client sending more than 10
redirect URIs. The limit is now 20, shared between the register and
update schemas, and the error reports how many were received.
OAuth client errors were swallowed without reaching logs or Sentry,
leaving a failing integration invisible beyond its status code. 4xx
responses are now logged with the reason.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat: Support HEIC avatar uploads with in-browser conversion
HEIC and HEIF images picked for an avatar are now converted to JPEG in
the browser before the cropper opens. The browser's own decoder is used
when it supports the format, otherwise a WebAssembly decoder is loaded
on demand.
Also collects the image utilities into an ImageHelper class, fixes the
crop dialog's submit button never disabling, and stops the upload from
forwarding request headers the browser controls itself.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* refactor: Use only the browser's own HEIC decoder
Drops the bundled WebAssembly decoder in favour of the browser's native
support. This removes an LGPL dependency and a 3MB lazy chunk, and lets
the Content Security Policy stay as it was.
Browsers without HEIC support now get a message asking for a JPEG or PNG.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* docs: Add class-level JSDoc to ImageHelper
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat: Normalized filter DSL for documents.list and search
Add a structured filter expression language (field/operator/value leaves
composed with AND/OR groups) shared by documents.list, documents.search and
documents.searchTitles. Values are validated against each field's column type
and per-field operator allowlists at the input layer, and translated to
Sequelize where-clauses server-side.
Supersedes the ad-hoc statusFilter/dateFilter/collectionId/userId parameters,
adds ISO 8601 duration matching for date fields, documentId subtree expansion
for search, and preserves draft visibility and collection authorization.
* chore: Fix flaky Encrypted "different key" test
AES-256-CBC is unauthenticated, so decrypting with the wrong key only
raises "bad decrypt" when the garbage plaintext has invalid PKCS#7 padding
(~255/256 of the time). Roughly 1 in 245 runs it decrypts to a non-matching
value instead of throwing, failing the strict toThrow assertion. Accept
either outcome, mirroring the adjacent tampered-data test.
* Hardening
* fix: Increase valid user-supplied URL length to 1024
* fix: Wrap URL length migration in a transaction
Wrap the multi-column changeColumn operations in a transaction so a
failure on any column rolls back the whole migration rather than leaving
the database partially migrated.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
* Add description column to groups
- Add database migration to add description column to groups table
- Update server-side Group model with description field and validation
- Update group presenter to include description in API responses
- Update API schemas to validate description field in create/update operations
- Update client-side Group model with description field and search integration
- Update unfurl types and presenter to include description for hover cards
- Update HoverPreviewGroup component to display description in UI
The description field is optional with a 2000 character limit and is included
in group search functionality.
* Fix TypeScript error: Add missing description prop to HoverPreviewGroup
The HoverPreviewGroup component expects a description prop but it wasn't being passed from HoverPreview.tsx. This was causing the types check to fail with:
error TS2741: Property 'description' is missing in type '{ ref: MutableRefObject<HTMLDivElement | null>; name: any; memberCount: any; users: any; }' but required in type 'Props'.
Fixed by adding the description prop from data.description which is available in the UnfurlResponse[UnfurlResourceType.Group] type.
* Move 2000 char validation to shared constant
- Add GroupValidation.maxDescriptionLength constant to shared/validations.ts
- Update server Group model to use GroupValidation.maxDescriptionLength
- Update API schemas to use the shared constant instead of hardcoded value
- Ensures consistent validation across the entire application
* Add description field to CreateGroupDialog and EditGroupDialog
- Add description textarea input to both create and edit group dialogs
- Import GroupValidation constant for consistent character limit validation
- Set maxLength to GroupValidation.maxDescriptionLength (2000 chars)
- Include description in form submission for both create and update operations
- Add placeholder text for better UX
- Maintain backward compatibility with optional description field
* Add description column to GroupsTable
- Add description column between name and members columns
- Display group description with fallback to em dash (—) for empty descriptions
- Use secondary text styling for consistent visual hierarchy
- Set column width to 2fr for adequate space
- Maintain sortable functionality through accessor
* tweaks
* animation
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
* Add team description column and settings
- Add database migration to add description column to teams table
- Update server-side Team model with description field and validation
- Update client-side Team model to include description field
- Add description input field to team settings page
- Update renderApp to use team description in HTML metadata when public branding is enabled
* Applied automatic fixes
* tweaks
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
* Add installation.create API endpoint
- Add new endpoint that accepts teamName, userName, userEmail
- Use accountProvisioner to create team and user
- Only allow when no existing teams exist (unauthenticated)
- Add comprehensive tests for success, failure, and validation cases
- Add schema validation with Zod
- Include rate limiting (5 per hour)
- Follow existing API patterns and conventions
* Remove changes to .env.test
* fix
* Centralize validation
* test
* test
* test
---------
Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
This PR contains the necessary work to make Outline an OAuth provider including:
- OAuth app registration
- OAuth app management
- Private / public apps (Public in cloud only)
- Full OAuth 2.0 spec compatible authentication flow
- Granular scopes
- User token management screen in settings
- Associated API endpoints for programatic access
* Comment model
* Framework, model, policy, presenter, api endpoint etc
* Iteration, first pass of UI
* fixes, refactors
* Comment commands
* comment socket support
* typing indicators
* comment component, styling
* wip
* right sidebar resize
* fix: CMD+Enter submit
* Add usePersistedState
fix: Main page scrolling on comment highlight
* drafts
* Typing indicator
* refactor
* policies
* Click thread to highlight
Improve comment timestamps
* padding
* Comment menu v1
* Change comments to use editor
* Basic comment editing
* fix: Hide commenting button when disabled at team level
* Enable opening sidebar without mark
* Move selected comment to location state
* Add comment delete confirmation
* Add comment count to document meta
* fix: Comment sidebar togglable
Add copy link to comment
* stash
* Restore History changes
* Refactor right sidebar to allow for comment animation
* Update to new router best practices
* stash
* Various improvements
* stash
* Handle click outside
* Fix incorrect placeholder in input
fix: Input box appearing on other sessions erroneously
* stash
* fix: Don't leave orphaned child comments
* styling
* stash
* Enable comment toggling again
* Edit styling, merge conflicts
* fix: Cannot navigate from insights to comments
* Remove draft comment mark on click outside
* Fix: Empty comment sidebar, tsc
* Remove public toggle
* fix: All comments are recessed
fix: Comments should not be printed
* fix: Associated mark should be removed on comment delete
* Revert unused changes
* Empty state, basic RTL support
* Create dont toggle comment mark
* Make it feel more snappy
* Highlight active comment in text
* fix animation
* RTL support
* Add reply CTA
* Translations
* fix: Long collection description prevents import
fix: Parallelize attachment upload during import
* fix: Improve Notion image import matching
* chore: Bump JSZIP (perf)
* fix: Allow redirect from /doc/<id> to canonical url
* fix: Importing document with only title duplicates title in body