19 Commits
Author SHA1 Message Date
Tom Moor 5f9144b50b fix: Allow URLs in the name of MCP OAuth clients (#14643) 2026-11-18 19:58:08 -05:00
Tahsin Ahmed RefatandClaude Opus 5.5 62ef10d629 fix: Allow private-use URI schemes for OAuth redirect URIs (#13945)
* fix: Allow private-use URI schemes for OAuth redirect URIs

Native apps receive OAuth redirects on a private-use URI scheme
(RFC 8252 section 7.1), e.g. com.example.app:/oauth2redirect or
myapp://callback. These were rejected when registering a client
because IsUrlList only accepted http, https and ftp, and the
recommended com.example.app:/path form was also rejected at authorize
time because it has no host.

Add isPrivateUseSchemeUrl, which accepts private-use schemes while
excluding web schemes and schemes that can execute or embed content,
and use it in both places.

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

* fix: Require a protocol for OAuth redirect URIs

isURL treats a bare word such as "callback" as a hostname, so a client
could be saved with a redirect URI that validateRedirectUri would always
reject at authorize time. Require a protocol when validating the list.

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

* fix: Accept one-character private-use URI destinations

The destination check compared the pathname length, so a valid opaque URI
such as myapp:a was rejected along with the empty myapp: and myapp:/.
Reject only those empty forms.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 17:59:34 -04:00
Tom MoorandClaude Fable 5.1 a577d5c2c8 fix: Validate API key and OAuth scopes at the model layer (#13664)
* fix: Validate API key scopes with Sequelize-level validators

* test: Add API regression tests for duplicate OAuth redirect URIs

* fix: Preserve wildcard scope and guard non-string redirect URIs

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 23:10:32 -04:00
Tom MoorandClaude Opus 4.8 8183c8e032 fix: Allow webhook urls without a top-level domain when self-hosted (#12728)
* fix: Allow webhook urls without a top-level domain when self-hosted

Webhook URL validation required a top-level domain, rejecting valid
internal hostnames such as http://webhook on self-hosted installations.
The TLD requirement is now only enforced when cloud hosted.

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

* refactor: Extract webhook url validation into reusable IsUrl decorator

Move the conditional top-level domain validation into a reusable IsUrl
validator alongside the other model validators, and restore mocks
between create tests to keep hosting mode isolated.

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

* test: Move webhook url validation tests onto IsUrl validator

The top-level domain validation is owned by the IsUrl decorator, so test
it directly via a collocated unit test rather than through the
webhookSubscriptions API.

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

* PR feedback

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 20:29:03 -04:00
Tom Moor 935e0bb7b9 chore: Fix all no-misused-spread lint warnings (#12327) 2026-05-12 17:30:08 -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 5610df5a26 chore: Reduce no-explicit-any warnings in server directory (#12202)
* chore: Reduce no-explicit-any warnings in server directory

Tightens types across test response bodies, decorator signatures, the
TestServer wrapper, base class generics, and presenter Record types.
Where any is genuinely load-bearing (Sequelize model generics,
PropertyDescriptor decorator returns, plugin-registered template
classes, Fix mixin), keeps any with a targeted eslint-disable plus
reason rather than masking the constraint. Cuts server-only
no-explicit-any warnings from 162 to 70.

* fix: groups test asserts on first response instead of second

Caught by Copilot review on the no-explicit-any cleanup. Also fixes
the pre-existing getChangsetSkipped → getChangesetSkipped typo
surfaced while reviewing nearby decorator code.
2026-04-28 19:50:45 -04: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
Hemachandar 7f818c7329 chore: Replace custom toPlainText serialization with leafText (#10039) 2025-08-30 20:26:07 +05:30
codegen-sh[bot]andTom Moor 758d4edbb9 Upgrade @typescript-eslint dependencies to v8.33.0 (#9363)
* Upgrade @typescript-eslint dependencies from v6.21.0 to v8.33.0

- Updated @typescript-eslint/eslint-plugin from ^6.21.0 to ^8.33.0
- Updated @typescript-eslint/parser from ^6.21.0 to ^8.33.0
- Tested linting functionality to ensure compatibility
- This brings the latest TypeScript ESLint features and bug fixes

* lint

* tsc

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-06-01 11:01:15 -04:00
Tom Moor d51267b8bc JSON to client (#5553) 2024-05-24 05:29:00 -07:00
Tom Moor 0b7253bb0c fix: Tighten valiation around URLs in database fields
closes #6012
2023-10-16 19:38:11 -04:00
Apoorv MishraandTom Moor 67b1fe5514 Local file storage (#5763)
Co-authored-by: Tom Moor <tom.moor@gmail.com>
2023-09-20 15:12:03 -07:00
Tom Moor b7bfc4bb1a chore: Remove optimize imports to allow vite upgrade (#5691) 2023-08-14 11:44:58 -07:00
Tom Moor abb38ea447 fix: Server error with invalid Prosemirror JSON should be validation error 2023-07-15 23:04:30 -04:00
Tom Moor 8957e86c12 fix: Add server-side validation of comment length 2023-06-29 22:41:57 -04:00
Tom Moor 4a46d19846 fix: Improved model validation for Collection (#3749)
* fix: Added improved model validation for Collection attributes

* sp

* fix: Enforce title length in UI
2022-07-08 11:10:22 -07:00
Tom Moor c36e7bfbb6 fix: Add 10 domain limit per team (#3733)
* fix: Validate team domains are FQDN's
Add 10 domain limit per team
fix: Deletion of domains not happening within request lifecycle

* tests

* docs
2022-07-05 12:27:02 -07:00
Tom Moor 8ebe4b27b1 fix: Add additional model validation (#3725) 2022-07-02 14:29:01 -07:00