Repository navigation
Separate inbox authentication from the declared actor #1299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dahlia
merged 5 commits into
fedify-dev:main
from
dahlia:feat/verify-actorless-activities
Oct 17, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e9d72cf
Separate inbox authentication from the actor
dahlia f55d194
Queue only the contexts an interpretation uses
dahlia 123f1f1
Link FEP-7aa9 in the changelog entries
dahlia ec55aa2
Process activities whose contexts can't be queued
dahlia ae36326
Check contexts linked from context documents
dahlia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| links: | ||
| '#1290': https://github.com/fedify-dev/fedify/issues/1290 | ||
| '#1299': https://github.com/fedify-dev/fedify/pull/1299 | ||
| --- | ||
| - `DenoKvMessageQueue` now declares the `maxMessageSize` of Deno KV, so that | ||
| an incoming activity too large for Deno KV is processed immediately | ||
| instead of failing to be enqueued. [[#1290], [#1299]] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| links: | ||
| '#1289': https://github.com/fedify-dev/fedify/issues/1289 | ||
| '#1290': https://github.com/fedify-dev/fedify/issues/1290 | ||
| '#1299': https://github.com/fedify-dev/fedify/pull/1299 | ||
| --- | ||
| - Added `InboxContext.authentication`, which tells inbox listeners who Fedify | ||
| authenticated for an incoming activity independently of its declared | ||
| `actor`: the signers of the HTTP request, the signers of the activity's | ||
| Linked Data Signature or Object Integrity Proofs, and the activity as Fedify | ||
| interpreted it while authenticating it. A valid signature does not | ||
| authorize an activity by itself; use the new `isActorAuthenticated()` | ||
| function to check whether a specific actor was authenticated, e.g., the | ||
| owner of an object the activity acts on. The new `InboxPrincipal` and | ||
| `InboxAuthenticationEvidence` types describe the evidence. | ||
| [[#1290], [#1299]] | ||
|
|
||
| - Added the `allowActorless` option to `InboxListenerSetters.on()`, so that | ||
| activities declaring no `actor` at all, such as the [FEP-7aa9] | ||
| `FeatureRequest` activities Mastodon sends, can reach a listener. Such an | ||
| activity is dispatched only if Fedify authenticated a principal for it and | ||
| its `id` has the same origin as that principal; the listener must authorize | ||
| it with `InboxContext.authentication`. Without the option, these | ||
| activities are still rejected with `400 Bad Request`. An activity whose | ||
| `actor` cannot be read, such as an anonymous actor, is never treated as | ||
| having no actor. Rejected deliveries are reported with the new | ||
| `noAuthenticatedPrincipal` reason in `onRequestFinished` reports. | ||
| [[#1289], [#1290], [#1299]] | ||
|
|
||
| - Changed the inbox to interpret each incoming activity with one set of | ||
| JSON-LD context documents throughout signature verification and dispatch, | ||
| and to keep that interpretation, along with the authentication evidence, | ||
| in queued inbox messages. Queue workers and their retries no longer load | ||
| remote JSON-LD contexts again for such messages, so a remote context that | ||
| changes in the meantime cannot make a listener see an activity other than | ||
| the one that was authenticated. An activity using a context that cannot | ||
| be kept this way, such as one a custom context loader marks as `static`, | ||
| is processed right away instead of being queued. Messages queued by | ||
| older versions are processed as before. [[#1290], [#1299]] | ||
|
|
||
| - Added the `MessageQueue.maxMessageSize` property. When an incoming | ||
| activity would make an inbox message larger than the queue can hold, it is | ||
| now processed right away instead of being enqueued. [[#1290], [#1299]] | ||
|
|
||
| - Changed inbox queue workers to deduplicate activities with the configured | ||
| `idempotency` strategy, as direct processing already did, instead of always | ||
| deduplicating them per origin. Activities recorded by workers of older | ||
| versions are still recognized. [[#1290], [#1299]] | ||
|
|
||
| [FEP-7aa9]: https://w3id.org/fep/7aa9 | ||
26 changes: 26 additions & 0 deletions
26
changes.d/interaction-controls/actorless-feature-requests.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| links: | ||
| '#1289': https://github.com/fedify-dev/fedify/issues/1289 | ||
| '#1290': https://github.com/fedify-dev/fedify/issues/1290 | ||
| '#1299': https://github.com/fedify-dev/fedify/pull/1299 | ||
| --- | ||
| - `featureInteraction.verifyRequest()` can now verify the [FEP-7aa9] | ||
| `FeatureRequest` activities Mastodon sends without an `actor`. Pass the | ||
| inbox listener's `InboxContext.authentication` as the new `authentication` | ||
| option; the requester is then the owner of the featured collection, who | ||
| must have been authenticated. [[#1289], [#1290], [#1299]] | ||
|
|
||
| - Changed `featureInteraction.verifyRequest()` to always fetch the featured | ||
| collection from its ID and to take its owner from that document only: an | ||
| ordinary collection must be served from the origin of its ID, a portable | ||
| one must satisfy the FEP-ef61 policy, and it must have exactly one | ||
| `attributedTo` value. A collection embedded in the request, or given as | ||
| `resolvedInteractingObject`, is no longer trusted, because anyone could | ||
| attribute someone else's collection to themselves that way. A request | ||
| without an actor is no longer accepted on the strength of the collection's | ||
| `attributedTo` alone; without `authentication`, it fails with | ||
| `missingActor`. New failure types `credentialsInUrl`, | ||
| `invalidInteractingObject`, `ambiguousRequest`, and | ||
| `unauthenticatedRequester` describe the new checks. [[#1290], [#1299]] | ||
|
|
||
| [FEP-7aa9]: https://w3id.org/fep/7aa9 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| links: | ||
| '#1290': https://github.com/fedify-dev/fedify/issues/1290 | ||
| '#1299': https://github.com/fedify-dev/fedify/pull/1299 | ||
| --- | ||
| - Mock inbox contexts made by `createInboxContext()` now have the | ||
| `authentication` property, which can be given as an option and defaults | ||
| to evidence that nothing was authenticated. [[#1290], [#1299]] |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.