@fedify/fedify 0.7.0-dev.117 → 0.7.0-dev.118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @fedify/fedify might be problematic. Click here for more details.
- package/CHANGES.md +12 -2
- package/esm/federation/handler.js +29 -44
- package/esm/federation/middleware.js +43 -5
- package/package.json +1 -1
- package/types/federation/callback.d.ts +12 -0
- package/types/federation/callback.d.ts.map +1 -1
- package/types/federation/handler.d.ts +10 -3
- package/types/federation/handler.d.ts.map +1 -1
- package/types/federation/middleware.d.ts +39 -2
- package/types/federation/middleware.d.ts.map +1 -1
package/CHANGES.md
CHANGED
@@ -10,8 +10,18 @@ To be released.
|
|
10
10
|
|
11
11
|
- Added `PUBLIC_COLLECTION` constant for [public addressing].
|
12
12
|
|
13
|
-
-
|
14
|
-
|
13
|
+
- `Federation` now supports [authorized fetch] for actor dispatcher and
|
14
|
+
collection dispatchers.
|
15
|
+
|
16
|
+
- Added `ActorCallbackSetters.authorize()` method.
|
17
|
+
- Added `CollectionCallbackSetters.authorize()` method.
|
18
|
+
- Added `AuthorizedPredicate` type.
|
19
|
+
- Added `RequestContext.getSignedKey()` method.
|
20
|
+
- Added `FederationFetchOptions.onUnauthorized` option for handling
|
21
|
+
unauthorized fetches.
|
22
|
+
|
23
|
+
- The default implementation of `FederationFetchOptions.onNotAcceptable`
|
24
|
+
option now responds with `Vary: Accept, Signature` header.
|
15
25
|
|
16
26
|
[public addressing]: https://www.w3.org/TR/activitypub/#public-addressing
|
17
27
|
[authorized fetch]: https://swicg.github.io/activitypub-http-signature/#authorized-fetch
|
@@ -13,20 +13,22 @@ export function acceptsJsonLd(request) {
|
|
13
13
|
types.includes("application/ld+json") ||
|
14
14
|
types.includes("application/json");
|
15
15
|
}
|
16
|
-
export async function handleActor(request, { handle, context, actorDispatcher, onNotFound, onNotAcceptable, }) {
|
16
|
+
export async function handleActor(request, { handle, context, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized, }) {
|
17
17
|
if (actorDispatcher == null) {
|
18
18
|
const response = onNotFound(request);
|
19
19
|
return response instanceof Promise ? await response : response;
|
20
20
|
}
|
21
21
|
const key = await context.getActorKey(handle);
|
22
22
|
const actor = await actorDispatcher(context, handle, key);
|
23
|
-
if (actor == null)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
if (
|
28
|
-
const
|
29
|
-
|
23
|
+
if (actor == null)
|
24
|
+
return await onNotFound(request);
|
25
|
+
if (!acceptsJsonLd(request))
|
26
|
+
return await onNotAcceptable(request);
|
27
|
+
if (authorizePredicate != null) {
|
28
|
+
const key = await context.getSignedKey();
|
29
|
+
if (!await authorizePredicate(context, handle, key)) {
|
30
|
+
return await onUnauthorized(request);
|
31
|
+
}
|
30
32
|
}
|
31
33
|
const jsonLd = await actor.toJsonLd(context);
|
32
34
|
return new Response(JSON.stringify(jsonLd), {
|
@@ -36,32 +38,19 @@ export async function handleActor(request, { handle, context, actorDispatcher, o
|
|
36
38
|
},
|
37
39
|
});
|
38
40
|
}
|
39
|
-
export async function handleCollection(request, { handle, context, collectionCallbacks, onNotFound, onNotAcceptable, }) {
|
40
|
-
if (collectionCallbacks == null)
|
41
|
-
|
42
|
-
return response instanceof Promise ? await response : response;
|
43
|
-
}
|
41
|
+
export async function handleCollection(request, { handle, context, collectionCallbacks, onUnauthorized, onNotFound, onNotAcceptable, }) {
|
42
|
+
if (collectionCallbacks == null)
|
43
|
+
return await onNotFound(request);
|
44
44
|
const url = new URL(request.url);
|
45
45
|
const cursor = url.searchParams.get("cursor");
|
46
46
|
let collection;
|
47
47
|
if (cursor == null) {
|
48
|
-
const
|
49
|
-
const
|
50
|
-
? await firstCursorPromise
|
51
|
-
: firstCursorPromise;
|
52
|
-
const totalItemsPromise = collectionCallbacks.counter?.(context, handle);
|
53
|
-
const totalItems = totalItemsPromise instanceof Promise
|
54
|
-
? await totalItemsPromise
|
55
|
-
: totalItemsPromise;
|
48
|
+
const firstCursor = await collectionCallbacks.firstCursor?.(context, handle);
|
49
|
+
const totalItems = await collectionCallbacks.counter?.(context, handle);
|
56
50
|
if (firstCursor == null) {
|
57
|
-
const
|
58
|
-
|
59
|
-
|
60
|
-
: pagePromise;
|
61
|
-
if (page == null) {
|
62
|
-
const response = onNotFound(request);
|
63
|
-
return response instanceof Promise ? await response : response;
|
64
|
-
}
|
51
|
+
const page = await collectionCallbacks.dispatcher(context, handle, null);
|
52
|
+
if (page == null)
|
53
|
+
return await onNotFound(request);
|
65
54
|
const { items } = page;
|
66
55
|
collection = new OrderedCollection({
|
67
56
|
totalItems: totalItems == null ? null : Number(totalItems),
|
@@ -69,10 +58,7 @@ export async function handleCollection(request, { handle, context, collectionCal
|
|
69
58
|
});
|
70
59
|
}
|
71
60
|
else {
|
72
|
-
const
|
73
|
-
const lastCursor = lastCursorPromise instanceof Promise
|
74
|
-
? await lastCursorPromise
|
75
|
-
: lastCursorPromise;
|
61
|
+
const lastCursor = await collectionCallbacks.lastCursor?.(context, handle);
|
76
62
|
const first = new URL(context.url);
|
77
63
|
first.searchParams.set("cursor", firstCursor);
|
78
64
|
let last = null;
|
@@ -88,14 +74,9 @@ export async function handleCollection(request, { handle, context, collectionCal
|
|
88
74
|
}
|
89
75
|
}
|
90
76
|
else {
|
91
|
-
const
|
92
|
-
|
93
|
-
|
94
|
-
: pagePromise;
|
95
|
-
if (page == null) {
|
96
|
-
const response = onNotFound(request);
|
97
|
-
return response instanceof Promise ? await response : response;
|
98
|
-
}
|
77
|
+
const page = await collectionCallbacks.dispatcher(context, handle, cursor);
|
78
|
+
if (page == null)
|
79
|
+
return await onNotFound(request);
|
99
80
|
const { items, prevCursor, nextCursor } = page;
|
100
81
|
let prev = null;
|
101
82
|
if (prevCursor != null) {
|
@@ -111,9 +92,13 @@ export async function handleCollection(request, { handle, context, collectionCal
|
|
111
92
|
partOf.searchParams.delete("cursor");
|
112
93
|
collection = new OrderedCollectionPage({ prev, next, items, partOf });
|
113
94
|
}
|
114
|
-
if (!acceptsJsonLd(request))
|
115
|
-
|
116
|
-
|
95
|
+
if (!acceptsJsonLd(request))
|
96
|
+
return await onNotAcceptable(request);
|
97
|
+
if (collectionCallbacks.authorizePredicate != null) {
|
98
|
+
const key = await context.getSignedKey();
|
99
|
+
if (!await collectionCallbacks.authorizePredicate(context, handle, key)) {
|
100
|
+
return await onUnauthorized(request);
|
101
|
+
}
|
117
102
|
}
|
118
103
|
const jsonLd = await collection.toJsonLd(context);
|
119
104
|
return new Response(JSON.stringify(jsonLd), {
|
@@ -219,12 +219,15 @@ export class Federation {
|
|
219
219
|
};
|
220
220
|
if (request == null)
|
221
221
|
return context;
|
222
|
+
let signedKey = undefined;
|
222
223
|
const reqCtx = {
|
223
224
|
...context,
|
224
225
|
request,
|
225
226
|
url,
|
226
|
-
getSignedKey() {
|
227
|
-
|
227
|
+
async getSignedKey() {
|
228
|
+
if (signedKey !== undefined)
|
229
|
+
return signedKey;
|
230
|
+
return signedKey = await verify(request, context.documentLoader);
|
228
231
|
},
|
229
232
|
};
|
230
233
|
return reqCtx;
|
@@ -285,10 +288,14 @@ export class Federation {
|
|
285
288
|
const callbacks = { dispatcher };
|
286
289
|
this.#actorCallbacks = callbacks;
|
287
290
|
const setters = {
|
288
|
-
setKeyPairDispatcher
|
291
|
+
setKeyPairDispatcher(dispatcher) {
|
289
292
|
callbacks.keyPairDispatcher = dispatcher;
|
290
293
|
return setters;
|
291
294
|
},
|
295
|
+
authorize(predicate) {
|
296
|
+
callbacks.authorizePredicate = predicate;
|
297
|
+
return setters;
|
298
|
+
},
|
292
299
|
};
|
293
300
|
return setters;
|
294
301
|
}
|
@@ -340,6 +347,10 @@ export class Federation {
|
|
340
347
|
callbacks.lastCursor = cursor;
|
341
348
|
return setters;
|
342
349
|
},
|
350
|
+
authorize(predicate) {
|
351
|
+
callbacks.authorizePredicate = predicate;
|
352
|
+
return setters;
|
353
|
+
},
|
343
354
|
};
|
344
355
|
return setters;
|
345
356
|
}
|
@@ -379,6 +390,10 @@ export class Federation {
|
|
379
390
|
callbacks.lastCursor = cursor;
|
380
391
|
return setters;
|
381
392
|
},
|
393
|
+
authorize(predicate) {
|
394
|
+
callbacks.authorizePredicate = predicate;
|
395
|
+
return setters;
|
396
|
+
},
|
382
397
|
};
|
383
398
|
return setters;
|
384
399
|
}
|
@@ -418,6 +433,10 @@ export class Federation {
|
|
418
433
|
callbacks.lastCursor = cursor;
|
419
434
|
return setters;
|
420
435
|
},
|
436
|
+
authorize(predicate) {
|
437
|
+
callbacks.authorizePredicate = predicate;
|
438
|
+
return setters;
|
439
|
+
},
|
421
440
|
};
|
422
441
|
return setters;
|
423
442
|
}
|
@@ -562,9 +581,10 @@ export class Federation {
|
|
562
581
|
* @returns The response to the request.
|
563
582
|
* @since 0.6.0
|
564
583
|
*/
|
565
|
-
async fetch(request, { onNotFound, onNotAcceptable, contextData, }) {
|
584
|
+
async fetch(request, { onNotFound, onNotAcceptable, onUnauthorized, contextData, }) {
|
566
585
|
onNotFound ??= notFound;
|
567
586
|
onNotAcceptable ??= notAcceptable;
|
587
|
+
onUnauthorized ??= unauthorized;
|
568
588
|
const url = new URL(request.url);
|
569
589
|
const route = this.#router.route(url.pathname);
|
570
590
|
if (route == null) {
|
@@ -591,6 +611,8 @@ export class Federation {
|
|
591
611
|
handle: route.values.handle,
|
592
612
|
context,
|
593
613
|
actorDispatcher: this.#actorCallbacks?.dispatcher,
|
614
|
+
authorizePredicate: this.#actorCallbacks?.authorizePredicate,
|
615
|
+
onUnauthorized,
|
594
616
|
onNotFound,
|
595
617
|
onNotAcceptable,
|
596
618
|
});
|
@@ -599,6 +621,7 @@ export class Federation {
|
|
599
621
|
handle: route.values.handle,
|
600
622
|
context,
|
601
623
|
collectionCallbacks: this.#outboxCallbacks,
|
624
|
+
onUnauthorized,
|
602
625
|
onNotFound,
|
603
626
|
onNotAcceptable,
|
604
627
|
});
|
@@ -626,6 +649,7 @@ export class Federation {
|
|
626
649
|
handle: route.values.handle,
|
627
650
|
context,
|
628
651
|
collectionCallbacks: this.#followingCallbacks,
|
652
|
+
onUnauthorized,
|
629
653
|
onNotFound,
|
630
654
|
onNotAcceptable,
|
631
655
|
});
|
@@ -634,6 +658,7 @@ export class Federation {
|
|
634
658
|
handle: route.values.handle,
|
635
659
|
context,
|
636
660
|
collectionCallbacks: this.#followersCallbacks,
|
661
|
+
onUnauthorized,
|
637
662
|
onNotFound,
|
638
663
|
onNotAcceptable,
|
639
664
|
});
|
@@ -648,5 +673,18 @@ function notFound(_request) {
|
|
648
673
|
return new Response("Not Found", { status: 404 });
|
649
674
|
}
|
650
675
|
function notAcceptable(_request) {
|
651
|
-
return new Response("Not Acceptable", {
|
676
|
+
return new Response("Not Acceptable", {
|
677
|
+
status: 406,
|
678
|
+
headers: {
|
679
|
+
Vary: "Accept, Signature",
|
680
|
+
},
|
681
|
+
});
|
682
|
+
}
|
683
|
+
function unauthorized(_request) {
|
684
|
+
return new Response("Unauthorized", {
|
685
|
+
status: 401,
|
686
|
+
headers: {
|
687
|
+
Vary: "Accept, Signature",
|
688
|
+
},
|
689
|
+
});
|
652
690
|
}
|
package/package.json
CHANGED
@@ -62,4 +62,16 @@ export type InboxErrorHandler<TContextData> = (context: RequestContext<TContextD
|
|
62
62
|
* @since 0.6.0
|
63
63
|
*/
|
64
64
|
export type OutboxErrorHandler = (error: Error, activity: Activity | null) => void | Promise<void>;
|
65
|
+
/**
|
66
|
+
* A callback that determines if a request is authorized or not.
|
67
|
+
*
|
68
|
+
* @typeParam TContextData The context data to pass to the {@link Context}.
|
69
|
+
* @param context The request context.
|
70
|
+
* @param handle The handle of the actor that is being requested.
|
71
|
+
* @param signedKey The key that was used to sign the request, or `null` if
|
72
|
+
* the request was not signed or the signature was invalid.
|
73
|
+
* @returns `true` if the request is authorized, `false` otherwise.
|
74
|
+
* @since 0.7.0
|
75
|
+
*/
|
76
|
+
export type AuthorizePredicate<TContextData> = (context: RequestContext<TContextData>, handle: string, signedKey: CryptographicKey | null) => boolean | Promise<boolean>;
|
65
77
|
//# sourceMappingURL=callback.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../src/federation/callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,YAAY,IAAI,CAC7C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,KAClC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAElC;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,YAAY,IAAI,CAC1C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,gBAAgB,GAAG,IAAI,KACzB,KAAK,GAAG,IAAI,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,CAAC,YAAY,IAAI,CACjD,WAAW,EAAE,YAAY,EACzB,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,KAAK,EAAE,YAAY,IAAI,CACtD,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,MAAM,EAA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AAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,KACX,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,YAAY,IAAI,CAC3C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,KACX,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,MAAM,aAAa,CAAC,YAAY,EAAE,SAAS,SAAS,QAAQ,IAAI,CACpE,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,QAAQ,EAAE,SAAS,KAChB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,YAAY,IAAI,CAC5C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,KAAK,EAAE,KAAK,KACT,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,GAAG,IAAI,KACtB,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,CAAC,YAAY,IAAI,CAC7C,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,GAAG,IAAI,KAC/B,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC"}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/// <reference types="node" />
|
3
3
|
import type { DocumentLoader } from "../runtime/docloader.js";
|
4
4
|
import { Activity, type Link, type Object } from "../vocab/vocab.js";
|
5
|
-
import type { ActorDispatcher, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener } from "./callback.js";
|
5
|
+
import type { ActorDispatcher, AuthorizePredicate, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener } from "./callback.js";
|
6
6
|
import type { RequestContext } from "./context.js";
|
7
7
|
import type { KvKey, KvStore } from "./kv.js";
|
8
8
|
export declare function acceptsJsonLd(request: Request): boolean;
|
@@ -10,10 +10,12 @@ export interface ActorHandlerParameters<TContextData> {
|
|
10
10
|
handle: string;
|
11
11
|
context: RequestContext<TContextData>;
|
12
12
|
actorDispatcher?: ActorDispatcher<TContextData>;
|
13
|
+
authorizePredicate?: AuthorizePredicate<TContextData>;
|
14
|
+
onUnauthorized(request: Request): Response | Promise<Response>;
|
13
15
|
onNotFound(request: Request): Response | Promise<Response>;
|
14
16
|
onNotAcceptable(request: Request): Response | Promise<Response>;
|
15
17
|
}
|
16
|
-
export declare function handleActor<TContextData>(request: Request, { handle, context, actorDispatcher, onNotFound, onNotAcceptable, }: ActorHandlerParameters<TContextData>): Promise<Response>;
|
18
|
+
export declare function handleActor<TContextData>(request: Request, { handle, context, actorDispatcher, authorizePredicate, onNotFound, onNotAcceptable, onUnauthorized, }: ActorHandlerParameters<TContextData>): Promise<Response>;
|
17
19
|
/**
|
18
20
|
* Callbacks for handling a collection.
|
19
21
|
*/
|
@@ -34,15 +36,20 @@ export interface CollectionCallbacks<TItem, TContextData> {
|
|
34
36
|
* A callback that returns the last cursor for a collection.
|
35
37
|
*/
|
36
38
|
lastCursor?: CollectionCursor<TContextData>;
|
39
|
+
/**
|
40
|
+
* A callback that determines if a request is authorized to access the collection.
|
41
|
+
*/
|
42
|
+
authorizePredicate?: AuthorizePredicate<TContextData>;
|
37
43
|
}
|
38
44
|
export interface CollectionHandlerParameters<TItem, TContextData> {
|
39
45
|
handle: string;
|
40
46
|
context: RequestContext<TContextData>;
|
41
47
|
collectionCallbacks?: CollectionCallbacks<TItem, TContextData>;
|
48
|
+
onUnauthorized(request: Request): Response | Promise<Response>;
|
42
49
|
onNotFound(request: Request): Response | Promise<Response>;
|
43
50
|
onNotAcceptable(request: Request): Response | Promise<Response>;
|
44
51
|
}
|
45
|
-
export declare function handleCollection<TItem extends URL | Object | Link, TContextData>(request: Request, { handle, context, collectionCallbacks, onNotFound, onNotAcceptable, }: CollectionHandlerParameters<TItem, TContextData>): Promise<Response>;
|
52
|
+
export declare function handleCollection<TItem extends URL | Object | Link, TContextData>(request: Request, { handle, context, collectionCallbacks, onUnauthorized, onNotFound, onNotAcceptable, }: CollectionHandlerParameters<TItem, TContextData>): Promise<Response>;
|
46
53
|
export interface InboxHandlerParameters<TContextData> {
|
47
54
|
handle: string | null;
|
48
55
|
context: RequestContext<TContextData>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/federation/handler.ts"],"names":[],"mappings":";;AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,QAAQ,EACR,KAAK,IAAI,EACT,KAAK,MAAM,EAGZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACd,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE9C,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CASvD;AAED,MAAM,WAAW,sBAAsB,CAAC,YAAY;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACtC,eAAe,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAChD,UAAU,CAAC,OAAO,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H,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAK1B"}
|
@@ -5,7 +5,7 @@ import { Temporal } from "@js-temporal/polyfill";
|
|
5
5
|
import { type AuthenticatedDocumentLoaderFactory, type DocumentLoader } from "../runtime/docloader.js";
|
6
6
|
import type { Actor } from "../vocab/actor.js";
|
7
7
|
import { Activity } from "../vocab/mod.js";
|
8
|
-
import type { ActorDispatcher, ActorKeyPairDispatcher, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener, NodeInfoDispatcher, OutboxErrorHandler } from "./callback.js";
|
8
|
+
import type { ActorDispatcher, ActorKeyPairDispatcher, AuthorizePredicate, CollectionCounter, CollectionCursor, CollectionDispatcher, InboxErrorHandler, InboxListener, NodeInfoDispatcher, OutboxErrorHandler } from "./callback.js";
|
9
9
|
import type { Context, RequestContext, SendActivityOptions } from "./context.js";
|
10
10
|
import type { KvKey, KvStore } from "./kv.js";
|
11
11
|
import type { MessageQueue } from "./mq.js";
|
@@ -258,7 +258,7 @@ export declare class Federation<TContextData> {
|
|
258
258
|
* @returns The response to the request.
|
259
259
|
* @since 0.6.0
|
260
260
|
*/
|
261
|
-
fetch(request: Request, { onNotFound, onNotAcceptable, contextData, }: FederationFetchOptions<TContextData>): Promise<Response>;
|
261
|
+
fetch(request: Request, { onNotFound, onNotAcceptable, onUnauthorized, contextData, }: FederationFetchOptions<TContextData>): Promise<Response>;
|
262
262
|
}
|
263
263
|
/**
|
264
264
|
* Parameters of {@link Federation.fetch} method.
|
@@ -285,6 +285,14 @@ export interface FederationFetchOptions<TContextData> {
|
|
285
285
|
* @returns The response to the request.
|
286
286
|
*/
|
287
287
|
onNotAcceptable?: (request: Request) => Response | Promise<Response>;
|
288
|
+
/**
|
289
|
+
* A callback to handle a request when the request is unauthorized.
|
290
|
+
* If not provided, a 401 response is returned.
|
291
|
+
* @param request The request object.
|
292
|
+
* @returns The response to the request.
|
293
|
+
* @since 0.7.0
|
294
|
+
*/
|
295
|
+
onUnauthorized?: (request: Request) => Response | Promise<Response>;
|
288
296
|
}
|
289
297
|
/**
|
290
298
|
* Additional settings for the actor dispatcher.
|
@@ -306,14 +314,43 @@ export interface ActorCallbackSetters<TContextData> {
|
|
306
314
|
* @returns The setters object so that settings can be chained.
|
307
315
|
*/
|
308
316
|
setKeyPairDispatcher(dispatcher: ActorKeyPairDispatcher<TContextData>): ActorCallbackSetters<TContextData>;
|
317
|
+
/**
|
318
|
+
* Specifies the conditions under which requests are authorized.
|
319
|
+
* @param predicate A callback that returns whether a request is authorized.
|
320
|
+
* @returns The setters object so that settings can be chained.
|
321
|
+
* @since 0.7.0
|
322
|
+
*/
|
323
|
+
authorize(predicate: AuthorizePredicate<TContextData>): ActorCallbackSetters<TContextData>;
|
309
324
|
}
|
310
325
|
/**
|
311
326
|
* Additional settings for a collection dispatcher.
|
312
327
|
*/
|
313
328
|
export interface CollectionCallbackSetters<TContextData> {
|
329
|
+
/**
|
330
|
+
* Sets the counter for the collection.
|
331
|
+
* @param counter A callback that returns the number of items in the collection.
|
332
|
+
* @returns The setters object so that settings can be chained.
|
333
|
+
*/
|
314
334
|
setCounter(counter: CollectionCounter<TContextData>): CollectionCallbackSetters<TContextData>;
|
335
|
+
/**
|
336
|
+
* Sets the first cursor for the collection.
|
337
|
+
* @param cursor The cursor for the first item in the collection.
|
338
|
+
* @returns The setters object so that settings can be chained.
|
339
|
+
*/
|
315
340
|
setFirstCursor(cursor: CollectionCursor<TContextData>): CollectionCallbackSetters<TContextData>;
|
341
|
+
/**
|
342
|
+
* Sets the last cursor for the collection.
|
343
|
+
* @param cursor The cursor for the last item in the collection.
|
344
|
+
* @returns The setters object so that settings can be chained.
|
345
|
+
*/
|
316
346
|
setLastCursor(cursor: CollectionCursor<TContextData>): CollectionCallbackSetters<TContextData>;
|
347
|
+
/**
|
348
|
+
* Specifies the conditions under which requests are authorized.
|
349
|
+
* @param predicate A callback that returns whether a request is authorized.
|
350
|
+
* @returns The setters object so that settings can be chained.
|
351
|
+
* @since 0.7.0
|
352
|
+
*/
|
353
|
+
authorize(predicate: AuthorizePredicate<TContextData>): CollectionCallbackSetters<TContextData>;
|
317
354
|
}
|
318
355
|
/**
|
319
356
|
* Registry for inbox listeners for different activity types.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjD,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAoB,MAAM,iBAAiB,CAAC;AAE7D,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,OAAO,CAAC;IAEZ;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE3C;;;;OAIG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IAErB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;;;;OAMG;IACH,kCAAkC,CAAC,EAAE,kCAAkC,CAAC;IAExE;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAInC,eAAe,CAAC,EAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,mBAAmB,EAAE,KAAK,CAAC;IAE3B;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC;CACvB;AAED;;;;;;GAMG;AACH,qBAAa,UAAU,CAAC,YAAY;;IAqBlC;;;OAGG;gBAED,EACE,EAAE,EACF,UAAU,EACV,KAAK,EACL,cAAc,EACd,kCAAkC,EAClC,UAAU,EACV,aAAa,EACb,eAAe,GAChB,EAAE,oBAAoB;IAqEzB;;;;;;OAMG;IACH,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAE7E;;;;;OAKG;IACH,aAAa,CACX,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,YAAY,GACxB,cAAc,CAAC,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/federation/middleware.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAIjD,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,cAAc,EAIpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAoB,MAAM,iBAAiB,CAAC;AAE7D,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,kBAAkB,EAClB,iBAAiB,EACjB,gBAA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