24 Commits
Author SHA1 Message Date
Tom Moor 631114129e perf: Lock only the target row in locked queries with joins (#14564) 2026-11-12 21:48:14 -05:00
Tom Moor f95761dddf perf: Use FOR NO KEY UPDATE where locked rows are only updated (#14559)
* perf: Use FOR NO KEY UPDATE where locked rows are only updated

Rows that other tables reference by foreign key are now locked with
FOR NO KEY UPDATE when the transaction only updates or soft-deletes
them, so concurrent inserts that reference the row are not blocked.

* test: Collaborative save does not wait for foreign key inserts
2026-11-12 18:54:37 -05:00
Tom Moor d8667e4b19 fix: Record passkey, OAuth client and invite events in the audit log (#14485)
* fix: Record passkey, OAuth client and invite events in the audit log

- Add passkeys.*, oauthClients.*, documents.unpublish,
  webhookSubscriptions.update and users.invite_accepted to AUDIT_EVENTS.
- users.invite_accepted was never emitted: the invited check ran after
  sign-in had set lastActiveAt, and email sign-in did not emit it at all.
  It also had no actor or team. Invited users signing in with SSO receive
  their welcome email again, and webhooks for this event start firing.
- passkeys.create had no actor or team as auth routes have no API context.
- Record the name on update and delete events where it is otherwise lost,
  the title on documents.unpublish, and mark OAuth client secret rotations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: Attribute invite_accepted to the invitee, not the browser session

Auth routes parse an optional cookie session, and createFromContext prefers
that user over the provided defaults, so accepting an invite in a browser
with another session recorded the wrong actor and team.
2026-11-06 08:05:18 -05:00
Tom Moor 9fe0c7ba2b fix: Preserve existing values when optional update fields are omitted (#14344)
* fix: Preserve existing values when optional update fields are omitted

* chore: Rename setDefined to fill

* chore: Use fill in users.update and teamUpdater
2026-10-26 17:29:17 -04:00
Tom Moor cfdb04e3e2 test: Stay under webhook limit in webhookSubscriptions.list test (#14259) 2026-10-22 23:44:31 -04:00
Tom MoorandClaude Opus 5.5 5647621224 chore: Prune redundant comments and type suppressions (#14124)
* chore: Prune redundant comments and normalize lint directives

Removes comments that restate the following line and stale TODOs, drops
the passive event listener feature check now that all supported browsers
support it, and renames eslint directives to oxlint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH

* fix: Evaluate restricted team domains at validation time

The restricted email provider list was captured when the model loaded, so
it could not follow the hosting environment and the tests that covered it
never reached the model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH

* chore: Replace type suppressions with accurate types

Adds a Concrete helper type for registries of abstract classes, declares
missing Sequelize and refractor typings, uses public ProseMirror APIs, a
typed mock context helper in middleware tests, and a StaticLink component
for sidebar rows being edited.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BehTjuZwKbN5csMCp3H4QH

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-17 17:07:39 -04:00
Tom Moor 086bd9e9e4 chore: Replace deprecated koa-router with @koa/router v15 (#14042)
* chore: Replace deprecated koa-router with @koa/router v15

* fix: Run optional authentication on all auth provider routes
2026-10-11 16:47:26 -04:00
Tom Moor 1eee828f73 fix: Allow null webhook subscription secrets (#13622) 2026-09-02 23:09:14 +00:00
Tom Moor a232f8c702 fix: Escape characters with special meaning in LIKE statements (#13111)
closes #13102
2026-07-23 19:58:37 -04:00
Tom MoorandClaude Opus 4.8 1cc10f5fff fix: Increase valid user-supplied URL length to 1024 (#12585)
* 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>
2026-06-04 23:30:55 -04:00
Tom Moor 82743b1c0a feat: Allow http webhook urls when self-hosting (#12499) 2026-05-27 22:52:15 -04:00
Tom Moor 77cee2806c chore: getJWTToken -> getSessionToken (#12371)
* getJWTToken -> getSessionToken

Ensure expiry is included in payload

* Refactor test harness to avoid direct usage of getSessionToken
2026-05-17 16:58:52 -04:00
Tom Moor 0139b91b5d chore: Replace lodash with es-toolkit (#12281)
* chore: Replace lodash with es-toolkit

Migrate all direct lodash imports to es-toolkit/compat for a smaller,
faster, lodash-compatible utility library. Transitive lodash usage from
other packages remains unchanged.

* fix: Restore isPlainObject semantics in CanCan policy

The lodash migration aliased `isObject` to `lodash/isPlainObject` and
the codemod incorrectly mapped the local name to es-toolkit's `isObject`,
which also returns true for arrays and functions. This caused condition
objects in policy definitions to be skipped, breaking authorization
checks across the codebase.

* fix: Restore unicode-aware length counting in validators

es-toolkit/compat's size() returns string.length, while lodash's _.size()
counts unicode code points. Switch to [...value].length to preserve the
previous behavior so multi-byte characters like emoji count as one.
2026-05-06 21:03:47 -04:00
Tom Moor 321b232f17 Move "Webhook" settings to table (#12119)
* Move 'Webhook' settings to table

* Add tests
2026-04-19 19:27:32 -04:00
Tom Moor c758f0d93a chore: Upgrade Zod to version 4 (#11465) 2026-02-15 22:54:50 -05:00
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00
Tom Moor a06671e8ce OAuth provider (#8884)
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
2025-05-03 19:40:18 -04:00
Hemachandar 5dd993adf5 Convert WebhookSubscription mutations (#8161)
* Convert 'WebhookSubscription' mutations

* add tests

* remove unnecessary assignment
2024-12-30 16:11:32 -08:00
Tom Moor 0e249951ab chore: Event.createFromContext usage (#7877)
* revisions.create

* Automatically pass transaction in state to createFromContext
2024-11-02 10:16:15 -07:00
Tom Moor b458bb3af9 Refactor required route role 2024-04-06 21:43:15 -04:00
Tom Moor 3721ea2333 fix: Allow use of validations middleware in plugins 2023-09-03 16:52:46 -04:00
Tom Moor b7bfc4bb1a chore: Remove optimize imports to allow vite upgrade (#5691) 2023-08-14 11:44:58 -07:00
Tom Moor db73879918 Assorted cleanup, minor bug fixes, styling fixes, eslint rules (#5165
* fix: Logic error in toast
fix: Remove useless component

* fix: Logout not clearing all stores

* Add icons to notification settings

* Add eslint rule to enforce spaced comment

* Add eslint rule for arrow-body-style

* Add eslint rule to enforce self-closing components

* Add menu to api key settings
Fix: Deleting webhook subscription does not remove from UI
Split webhook subscriptions into active and inactive
Styling updates
2023-04-08 05:25:20 -07:00
Tom Moor 60101c507a Move bulk of webhook logic to plugin (#4866)
* Move bulk of webhook logic to plugin

* Re-enable cleanup task

* cron tasks
2023-02-12 16:28:11 -08:00