@fedify/fedify 2.1.0-dev.565 → 2.1.0-dev.599
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.
- package/dist/accept-D7sAxyNa.js +143 -0
- package/dist/{assert_rejects-Ce45JcFg.js → assert_rejects-0h7I2Esa.js} +1 -1
- package/dist/{builder-Deoi2N2z.js → builder-rlJT9XsH.js} +3 -3
- package/dist/compat/mod.d.cts +3 -3
- package/dist/compat/mod.d.ts +3 -3
- package/dist/compat/transformers.test.js +17 -16
- package/dist/{context-DL0cPpPV.d.cts → context-BcqA-0BL.d.cts} +52 -2
- package/dist/{context--RwChtri.d.ts → context-DyJjQQ_H.d.ts} +52 -2
- package/dist/{deno-CEdy89j9.js → deno-BYv1FXyT.js} +1 -2
- package/dist/{docloader-CL1QPJzN.js → docloader-D3dGL8MN.js} +2 -2
- package/dist/federation/builder.test.js +7 -7
- package/dist/federation/collection.test.js +5 -5
- package/dist/federation/handler.test.js +806 -26
- package/dist/federation/idempotency.test.js +22 -21
- package/dist/federation/inbox.test.js +3 -3
- package/dist/federation/keycache.test.js +1 -1
- package/dist/federation/kv.test.js +4 -4
- package/dist/federation/middleware.test.js +22 -21
- package/dist/federation/mod.cjs +4 -4
- package/dist/federation/mod.d.cts +4 -4
- package/dist/federation/mod.d.ts +4 -4
- package/dist/federation/mod.js +4 -4
- package/dist/federation/mq.test.js +4 -4
- package/dist/federation/negotiation.test.js +5 -5
- package/dist/federation/retry.test.js +2 -2
- package/dist/federation/router.test.js +4 -4
- package/dist/federation/send.test.js +11 -10
- package/dist/federation/webfinger.test.js +22 -21
- package/dist/{http-DsqqmkXi.d.cts → http-BudnHZE2.d.cts} +229 -1
- package/dist/{http-iDlaLy8a.cjs → http-Cjdbgipx.cjs} +307 -50
- package/dist/{http-BbfOqHGG.d.ts → http-Dax_FIBo.d.ts} +229 -1
- package/dist/{http-Dm9n1mRe.js → http-SDJbghtm.js} +144 -49
- package/dist/{http-VpqmUjje.js → http-WrV4DdQ1.js} +278 -51
- package/dist/{inbox-CMtnW0RE.js → inbox-gPJ0RaKj.js} +1 -1
- package/dist/{key-B0yADkL8.js → key-BSOrewQw.js} +1 -1
- package/dist/{kv-cache-BSATpUtX.js → kv-cache-D0a-g8yG.js} +1 -1
- package/dist/{kv-cache-551Om14-.cjs → kv-cache-sn8V-LU_.cjs} +1 -1
- package/dist/{ld-BBmbv1nb.js → ld-8UNDFIO0.js} +3 -3
- package/dist/middleware-74Kx7iWO.cjs +12 -0
- package/dist/{middleware-DpdPMZII.js → middleware-Brge9sYu.js} +4 -4
- package/dist/{middleware-Cldp2YSv.js → middleware-CWItYNUL.js} +113 -34
- package/dist/{middleware-Cx0tTbX1.js → middleware-C_89nqvv.js} +95 -18
- package/dist/{middleware-D11GYoP-.cjs → middleware-PGDxr3nC.cjs} +94 -17
- package/dist/middleware-nfE7By0g.js +27 -0
- package/dist/{mod-DE8MYisy.d.cts → mod-B7QkWzrL.d.cts} +1 -1
- package/dist/{mod-DKG0ovjR.d.cts → mod-Bx9jcLB8.d.cts} +1 -1
- package/dist/{mod-CFBU2OT3.d.cts → mod-Coe7KEgX.d.cts} +1 -1
- package/dist/{mod-BugwI0JN.d.ts → mod-Cs2dYEwI.d.ts} +1 -1
- package/dist/{mod-DcfFNgYf.d.ts → mod-D6MdymW7.d.ts} +1 -1
- package/dist/{mod-CvxylbuV.d.ts → mod-D6dOd--H.d.ts} +1 -1
- package/dist/{mod-Z7lIaCfo.d.ts → mod-SMHOMNpZ.d.ts} +1 -1
- package/dist/{mod-Dp0kK0hO.d.cts → mod-em2Il1eD.d.cts} +1 -1
- package/dist/mod.cjs +12 -4
- package/dist/mod.d.cts +8 -8
- package/dist/mod.d.ts +8 -8
- package/dist/mod.js +9 -5
- package/dist/nodeinfo/client.test.js +4 -4
- package/dist/nodeinfo/handler.test.js +22 -21
- package/dist/nodeinfo/types.test.js +4 -4
- package/dist/otel/exporter.test.js +4 -4
- package/dist/{owner-C1ZyG4NL.js → owner-D1i3Gz1q.js} +1 -1
- package/dist/{proof-wclcUq0C.js → proof-Blm7rPHe.js} +2 -2
- package/dist/{proof-CgK60TcQ.cjs → proof-DFqGzNZi.cjs} +3 -3
- package/dist/{proof-DnRq8s8f.js → proof-DgU0YpXY.js} +2 -2
- package/dist/{send-DNJyYRVU.js → send-Ban_thmx.js} +2 -2
- package/dist/sig/accept.test.d.ts +3 -0
- package/dist/sig/accept.test.js +451 -0
- package/dist/sig/http.test.js +452 -27
- package/dist/sig/key.test.js +7 -7
- package/dist/sig/ld.test.js +6 -6
- package/dist/sig/mod.cjs +6 -2
- package/dist/sig/mod.d.cts +3 -3
- package/dist/sig/mod.d.ts +3 -3
- package/dist/sig/mod.js +3 -3
- package/dist/sig/owner.test.js +8 -8
- package/dist/sig/proof.test.js +8 -8
- package/dist/testing/mod.js +1 -1
- package/dist/utils/docloader.test.js +10 -9
- package/dist/utils/kv-cache.test.js +1 -1
- package/dist/utils/mod.cjs +2 -2
- package/dist/utils/mod.d.cts +2 -2
- package/dist/utils/mod.d.ts +2 -2
- package/dist/utils/mod.js +2 -2
- package/package.json +6 -7
- package/dist/middleware-BDr0P6dx.cjs +0 -12
- package/dist/middleware-BZ8WpBo6.js +0 -26
- /package/dist/{assert_not_equals-C80BG-_5.js → assert_not_equals-f3m3epl3.js} +0 -0
- /package/dist/{assert_throws-BNXdRGWP.js → assert_throws-rjdMBf31.js} +0 -0
- /package/dist/{collection-CcnIw1qY.js → collection-CSzG2j1P.js} +0 -0
- /package/dist/{context-pa9aIrwp.js → context-Aqenou7c.js} +0 -0
- /package/dist/{keycache-C7k8s1Bk.js → keycache-CpGWAUbj.js} +0 -0
- /package/dist/{keys-ZbcByPg9.js → keys-BFve7QQv.js} +0 -0
- /package/dist/{kv-cache-El7We5sy.js → kv-cache-Bw2F2ABq.js} +0 -0
- /package/dist/{negotiation-5NPJL6zp.js → negotiation-BlAuS_nr.js} +0 -0
- /package/dist/{retry-D4GJ670a.js → retry-mqLf4b-R.js} +0 -0
- /package/dist/{std__assert-DWivtrGR.js → std__assert-X-_kMxKM.js} +0 -0
|
@@ -7,30 +7,31 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { createFederation } from "../middleware-
|
|
10
|
+
import "../deno-BYv1FXyT.js";
|
|
11
|
+
import { createFederation } from "../middleware-CWItYNUL.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
import
|
|
15
|
+
import "../accept-D7sAxyNa.js";
|
|
16
|
+
import "../key-BSOrewQw.js";
|
|
17
|
+
import "../http-SDJbghtm.js";
|
|
18
|
+
import "../ld-8UNDFIO0.js";
|
|
19
|
+
import "../owner-D1i3Gz1q.js";
|
|
20
|
+
import { signObject } from "../proof-Blm7rPHe.js";
|
|
21
|
+
import "../docloader-D3dGL8MN.js";
|
|
22
|
+
import "../kv-cache-Bw2F2ABq.js";
|
|
23
|
+
import "../inbox-gPJ0RaKj.js";
|
|
24
|
+
import "../builder-rlJT9XsH.js";
|
|
25
|
+
import "../collection-CSzG2j1P.js";
|
|
26
|
+
import "../keycache-CpGWAUbj.js";
|
|
27
|
+
import "../negotiation-BlAuS_nr.js";
|
|
28
|
+
import "../retry-mqLf4b-R.js";
|
|
29
|
+
import "../send-Ban_thmx.js";
|
|
30
|
+
import "../std__assert-X-_kMxKM.js";
|
|
31
|
+
import "../assert_rejects-0h7I2Esa.js";
|
|
32
|
+
import "../assert_throws-rjdMBf31.js";
|
|
33
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
34
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey } from "../keys-BFve7QQv.js";
|
|
34
35
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
35
36
|
import { Create, Follow, Person } from "@fedify/vocab";
|
|
36
37
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
6
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
|
-
import "../deno-
|
|
8
|
-
import { InboxListenerSet } from "../inbox-
|
|
9
|
-
import { assertThrows } from "../assert_throws-
|
|
7
|
+
import "../deno-BYv1FXyT.js";
|
|
8
|
+
import { InboxListenerSet } from "../inbox-gPJ0RaKj.js";
|
|
9
|
+
import { assertThrows } from "../assert_throws-rjdMBf31.js";
|
|
10
10
|
import { test } from "@fedify/fixture";
|
|
11
11
|
import { Activity, Create, Invite, Offer, Update } from "@fedify/vocab";
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import { KvKeyCache } from "../keycache-
|
|
10
|
+
import { KvKeyCache } from "../keycache-CpGWAUbj.js";
|
|
11
11
|
import { test } from "@fedify/fixture";
|
|
12
12
|
import { CryptographicKey, Multikey } from "@fedify/vocab";
|
|
13
13
|
|
|
@@ -7,10 +7,10 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../std__assert-
|
|
11
|
-
import "../assert_rejects-
|
|
12
|
-
import "../assert_throws-
|
|
13
|
-
import "../assert_not_equals-
|
|
10
|
+
import "../std__assert-X-_kMxKM.js";
|
|
11
|
+
import "../assert_rejects-0h7I2Esa.js";
|
|
12
|
+
import "../assert_throws-rjdMBf31.js";
|
|
13
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
14
14
|
import { test } from "@fedify/fixture";
|
|
15
15
|
|
|
16
16
|
//#region src/federation/kv.test.ts
|
|
@@ -8,30 +8,31 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
10
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
11
|
-
import "../deno-
|
|
12
|
-
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-
|
|
11
|
+
import "../deno-BYv1FXyT.js";
|
|
12
|
+
import { ContextImpl, FederationImpl, InboxContextImpl, KvSpecDeterminer, createFederation } from "../middleware-CWItYNUL.js";
|
|
13
13
|
import "../client-CoCIaTNO.js";
|
|
14
14
|
import { RouterError } from "../router-D9eI0s4b.js";
|
|
15
15
|
import "../types-CPz01LGH.js";
|
|
16
|
-
import "../
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
16
|
+
import "../accept-D7sAxyNa.js";
|
|
17
|
+
import "../key-BSOrewQw.js";
|
|
18
|
+
import { signRequest, verifyRequest } from "../http-SDJbghtm.js";
|
|
19
|
+
import { detachSignature, signJsonLd, verifyJsonLd } from "../ld-8UNDFIO0.js";
|
|
20
|
+
import { doesActorOwnKey } from "../owner-D1i3Gz1q.js";
|
|
21
|
+
import { signObject, verifyObject } from "../proof-Blm7rPHe.js";
|
|
22
|
+
import { getAuthenticatedDocumentLoader } from "../docloader-D3dGL8MN.js";
|
|
23
|
+
import "../kv-cache-Bw2F2ABq.js";
|
|
24
|
+
import "../inbox-gPJ0RaKj.js";
|
|
25
|
+
import "../builder-rlJT9XsH.js";
|
|
26
|
+
import "../collection-CSzG2j1P.js";
|
|
27
|
+
import "../keycache-CpGWAUbj.js";
|
|
28
|
+
import "../negotiation-BlAuS_nr.js";
|
|
29
|
+
import "../retry-mqLf4b-R.js";
|
|
30
|
+
import "../send-Ban_thmx.js";
|
|
31
|
+
import { assertStrictEquals } from "../std__assert-X-_kMxKM.js";
|
|
32
|
+
import { assertFalse, assertRejects } from "../assert_rejects-0h7I2Esa.js";
|
|
33
|
+
import { assertThrows } from "../assert_throws-rjdMBf31.js";
|
|
34
|
+
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
|
35
|
+
import { ed25519Multikey, ed25519PrivateKey, ed25519PublicKey, rsaPrivateKey2, rsaPrivateKey3, rsaPublicKey2, rsaPublicKey3 } from "../keys-BFve7QQv.js";
|
|
35
36
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
36
37
|
import * as vocab from "@fedify/vocab";
|
|
37
38
|
import { getTypeId, lookupObject } from "@fedify/vocab";
|
package/dist/federation/mod.cjs
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
4
4
|
|
|
5
5
|
require('../transformers-3g8GZwkZ.cjs');
|
|
6
|
-
require('../http-
|
|
7
|
-
const require_middleware = require('../middleware-
|
|
8
|
-
require('../proof-
|
|
6
|
+
require('../http-Cjdbgipx.cjs');
|
|
7
|
+
const require_middleware = require('../middleware-PGDxr3nC.cjs');
|
|
8
|
+
require('../proof-DFqGzNZi.cjs');
|
|
9
9
|
const require_federation = require('../federation-Bp3HI26G.cjs');
|
|
10
10
|
require('../types-Cd_hszr_.cjs');
|
|
11
|
-
require('../kv-cache-
|
|
11
|
+
require('../kv-cache-sn8V-LU_.cjs');
|
|
12
12
|
|
|
13
13
|
exports.InProcessMessageQueue = require_federation.InProcessMessageQueue;
|
|
14
14
|
exports.MemoryKvStore = require_federation.MemoryKvStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../client-C97KOq3x.cjs";
|
|
2
|
-
import "../http-
|
|
2
|
+
import "../http-BudnHZE2.cjs";
|
|
3
3
|
import "../owner-1AbPBOOZ.cjs";
|
|
4
|
-
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-
|
|
4
|
+
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-BcqA-0BL.cjs";
|
|
5
5
|
import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "../kv-BL4nlICN.cjs";
|
|
6
|
-
import { WebFingerHandlerParameters, handleWebFinger } from "../mod-
|
|
7
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
6
|
+
import { WebFingerHandlerParameters, handleWebFinger } from "../mod-em2Il1eD.cjs";
|
|
7
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
import "../client-BxMZiQaD.js";
|
|
4
|
-
import "../http-
|
|
4
|
+
import "../http-Dax_FIBo.js";
|
|
5
5
|
import "../owner-gd0Q9FuU.js";
|
|
6
|
-
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context
|
|
6
|
+
import { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, respondWithObject, respondWithObjectIfAcceptable } from "../context-DyJjQQ_H.js";
|
|
7
7
|
import { KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore } from "../kv-DXEUEP6z.js";
|
|
8
|
-
import { WebFingerHandlerParameters, handleWebFinger } from "../mod-
|
|
9
|
-
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
8
|
+
import { WebFingerHandlerParameters, handleWebFinger } from "../mod-D6MdymW7.js";
|
|
9
|
+
export { ActorAliasMapper, ActorCallbackSetters, ActorDispatcher, ActorHandleMapper, ActorKeyPair, ActorKeyPairsDispatcher, AuthorizePredicate, CollectionCallbackSetters, CollectionCounter, CollectionCursor, CollectionDispatcher, ConstructorWithTypeId, Context, CreateExponentialBackoffPolicyOptions, CustomCollectionCallbackSetters, CustomCollectionCounter, CustomCollectionCursor, CustomCollectionDispatcher, Federatable, Federation, FederationBuilder, FederationFetchOptions, FederationKvPrefixes, FederationOptions, FederationOrigin, FederationQueueOptions, FederationStartQueueOptions, ForwardActivityOptions, GetSignedKeyOptions, IdempotencyKeyCallback, IdempotencyStrategy, InProcessMessageQueue, InProcessMessageQueueOptions, InboxChallengePolicy, InboxContext, InboxErrorHandler, InboxListener, InboxListenerSetters, KvKey, KvStore, KvStoreListEntry, KvStoreSetOptions, MemoryKvStore, Message, MessageQueue, MessageQueueEnqueueOptions, MessageQueueListenOptions, NodeInfoDispatcher, ObjectAuthorizePredicate, ObjectCallbackSetters, ObjectDispatcher, OutboxErrorHandler, OutboxPermanentFailureHandler, PageItems, ParallelMessageQueue, ParseUriResult, RequestContext, RespondWithObjectOptions, RetryContext, RetryPolicy, Rfc6570Expression, RouteActivityOptions, Router, RouterError, RouterOptions, RouterRouteResult, SendActivityError, SendActivityOptions, SendActivityOptionsForCollection, SenderKeyPair, SharedInboxKeyDispatcher, UnverifiedActivityHandler, UnverifiedActivityReason, WebFingerHandlerParameters, WebFingerLinksDispatcher, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
package/dist/federation/mod.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { URLPattern } from "urlpattern-polyfill";
|
|
4
4
|
|
|
5
5
|
import "../transformers-C3FLHUd6.js";
|
|
6
|
-
import "../http-
|
|
7
|
-
import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-
|
|
8
|
-
import "../proof-
|
|
6
|
+
import "../http-WrV4DdQ1.js";
|
|
7
|
+
import { Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable } from "../middleware-C_89nqvv.js";
|
|
8
|
+
import "../proof-DgU0YpXY.js";
|
|
9
9
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "../federation-DaMfqRm4.js";
|
|
10
10
|
import "../types-C93Ob9cU.js";
|
|
11
|
-
import "../kv-cache-
|
|
11
|
+
import "../kv-cache-D0a-g8yG.js";
|
|
12
12
|
|
|
13
13
|
export { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue, Router, RouterError, SendActivityError, buildCollectionSynchronizationHeader, createExponentialBackoffPolicy, createFederation, createFederationBuilder, digest, handleWebFinger, respondWithObject, respondWithObjectIfAcceptable };
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
|
-
import { assertGreater, assertGreaterOrEqual } from "../std__assert-
|
|
10
|
-
import { assertFalse } from "../assert_rejects-
|
|
11
|
-
import "../assert_throws-
|
|
12
|
-
import "../assert_not_equals-
|
|
9
|
+
import { assertGreater, assertGreaterOrEqual } from "../std__assert-X-_kMxKM.js";
|
|
10
|
+
import { assertFalse } from "../assert_rejects-0h7I2Esa.js";
|
|
11
|
+
import "../assert_throws-rjdMBf31.js";
|
|
12
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
13
13
|
import { test } from "@fedify/fixture";
|
|
14
14
|
import { delay } from "es-toolkit";
|
|
15
15
|
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import "../assert_equals-DSbWqCm3.js";
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
|
-
import { acceptsJsonLd } from "../negotiation-
|
|
10
|
-
import "../std__assert-
|
|
11
|
-
import { assertFalse } from "../assert_rejects-
|
|
12
|
-
import "../assert_throws-
|
|
13
|
-
import "../assert_not_equals-
|
|
9
|
+
import { acceptsJsonLd } from "../negotiation-BlAuS_nr.js";
|
|
10
|
+
import "../std__assert-X-_kMxKM.js";
|
|
11
|
+
import { assertFalse } from "../assert_rejects-0h7I2Esa.js";
|
|
12
|
+
import "../assert_throws-rjdMBf31.js";
|
|
13
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
14
14
|
import { test } from "@fedify/fixture";
|
|
15
15
|
|
|
16
16
|
//#region src/federation/negotiation.test.ts
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
globalThis.addEventListener = () => {};
|
|
5
5
|
|
|
6
6
|
import { AssertionError, assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
7
|
-
import { createExponentialBackoffPolicy } from "../retry-
|
|
8
|
-
import { assertNotEquals } from "../assert_not_equals-
|
|
7
|
+
import { createExponentialBackoffPolicy } from "../retry-mqLf4b-R.js";
|
|
8
|
+
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
|
|
11
11
|
//#region src/federation/retry.test.ts
|
|
@@ -7,10 +7,10 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { Router, RouterError } from "../router-D9eI0s4b.js";
|
|
10
|
-
import "../std__assert-
|
|
11
|
-
import { assertFalse } from "../assert_rejects-
|
|
12
|
-
import { assertThrows } from "../assert_throws-
|
|
13
|
-
import "../assert_not_equals-
|
|
10
|
+
import "../std__assert-X-_kMxKM.js";
|
|
11
|
+
import { assertFalse } from "../assert_rejects-0h7I2Esa.js";
|
|
12
|
+
import { assertThrows } from "../assert_throws-rjdMBf31.js";
|
|
13
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
14
14
|
import { test } from "@fedify/fixture";
|
|
15
15
|
|
|
16
16
|
//#region src/federation/router.test.ts
|
|
@@ -7,16 +7,17 @@ import { esm_default } from "../esm-nLm00z9V.js";
|
|
|
7
7
|
import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
8
8
|
import { assert } from "../assert-MZs1qjMx.js";
|
|
9
9
|
import { assertInstanceOf } from "../assert_instance_of-DHz7EHNU.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import "../
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import "../
|
|
16
|
-
import
|
|
17
|
-
import "../
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
10
|
+
import "../deno-BYv1FXyT.js";
|
|
11
|
+
import "../accept-D7sAxyNa.js";
|
|
12
|
+
import "../key-BSOrewQw.js";
|
|
13
|
+
import { verifyRequest } from "../http-SDJbghtm.js";
|
|
14
|
+
import { doesActorOwnKey } from "../owner-D1i3Gz1q.js";
|
|
15
|
+
import { SendActivityError, extractInboxes, sendActivity } from "../send-Ban_thmx.js";
|
|
16
|
+
import "../std__assert-X-_kMxKM.js";
|
|
17
|
+
import { assertFalse, assertRejects } from "../assert_rejects-0h7I2Esa.js";
|
|
18
|
+
import "../assert_throws-rjdMBf31.js";
|
|
19
|
+
import { assertNotEquals } from "../assert_not_equals-f3m3epl3.js";
|
|
20
|
+
import { ed25519Multikey, ed25519PrivateKey, rsaPrivateKey2, rsaPublicKey2 } from "../keys-BFve7QQv.js";
|
|
20
21
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
21
22
|
import { Activity, Application, Endpoints, Group, Person, Service } from "@fedify/vocab";
|
|
22
23
|
|
|
@@ -7,30 +7,31 @@ import { assertEquals } from "../assert_equals-DSbWqCm3.js";
|
|
|
7
7
|
import "../assert-MZs1qjMx.js";
|
|
8
8
|
import "../assert_instance_of-DHz7EHNU.js";
|
|
9
9
|
import { MemoryKvStore } from "../kv-QzKcOQgP.js";
|
|
10
|
-
import "../deno-
|
|
11
|
-
import { createFederation, handleWebFinger } from "../middleware-
|
|
10
|
+
import "../deno-BYv1FXyT.js";
|
|
11
|
+
import { createFederation, handleWebFinger } from "../middleware-CWItYNUL.js";
|
|
12
12
|
import "../client-CoCIaTNO.js";
|
|
13
13
|
import "../router-D9eI0s4b.js";
|
|
14
14
|
import "../types-CPz01LGH.js";
|
|
15
|
-
import "../
|
|
16
|
-
import "../
|
|
17
|
-
import "../
|
|
18
|
-
import "../
|
|
19
|
-
import "../
|
|
20
|
-
import "../
|
|
21
|
-
import "../
|
|
22
|
-
import "../
|
|
23
|
-
import "../
|
|
24
|
-
import "../
|
|
25
|
-
import "../
|
|
26
|
-
import "../
|
|
27
|
-
import "../
|
|
28
|
-
import "../
|
|
29
|
-
import "../
|
|
30
|
-
import "../
|
|
31
|
-
import "../
|
|
32
|
-
import "../
|
|
33
|
-
import
|
|
15
|
+
import "../accept-D7sAxyNa.js";
|
|
16
|
+
import "../key-BSOrewQw.js";
|
|
17
|
+
import "../http-SDJbghtm.js";
|
|
18
|
+
import "../ld-8UNDFIO0.js";
|
|
19
|
+
import "../owner-D1i3Gz1q.js";
|
|
20
|
+
import "../proof-Blm7rPHe.js";
|
|
21
|
+
import "../docloader-D3dGL8MN.js";
|
|
22
|
+
import "../kv-cache-Bw2F2ABq.js";
|
|
23
|
+
import "../inbox-gPJ0RaKj.js";
|
|
24
|
+
import "../builder-rlJT9XsH.js";
|
|
25
|
+
import "../collection-CSzG2j1P.js";
|
|
26
|
+
import "../keycache-CpGWAUbj.js";
|
|
27
|
+
import "../negotiation-BlAuS_nr.js";
|
|
28
|
+
import "../retry-mqLf4b-R.js";
|
|
29
|
+
import "../send-Ban_thmx.js";
|
|
30
|
+
import "../std__assert-X-_kMxKM.js";
|
|
31
|
+
import "../assert_rejects-0h7I2Esa.js";
|
|
32
|
+
import "../assert_throws-rjdMBf31.js";
|
|
33
|
+
import "../assert_not_equals-f3m3epl3.js";
|
|
34
|
+
import { createRequestContext } from "../context-Aqenou7c.js";
|
|
34
35
|
import { test } from "@fedify/fixture";
|
|
35
36
|
import { Image, Link, Person } from "@fedify/vocab";
|
|
36
37
|
|
|
@@ -151,6 +151,194 @@ interface KeyCache {
|
|
|
151
151
|
set(keyId: URL, key: CryptographicKey | Multikey | null): Promise<void>;
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
+
//#region src/sig/accept.d.ts
|
|
155
|
+
/**
|
|
156
|
+
* Signature metadata parameters that may appear in an
|
|
157
|
+
* `Accept-Signature` member, as defined in
|
|
158
|
+
* [RFC 9421 §5.1](https://www.rfc-editor.org/rfc/rfc9421#section-5.1).
|
|
159
|
+
*
|
|
160
|
+
* @since 2.1.0
|
|
161
|
+
*/
|
|
162
|
+
interface AcceptSignatureParameters {
|
|
163
|
+
/**
|
|
164
|
+
* If present, the signer is requested to use the indicated key
|
|
165
|
+
* material to create the target signature.
|
|
166
|
+
*/
|
|
167
|
+
keyid?: string;
|
|
168
|
+
/**
|
|
169
|
+
* If present, the signer is requested to use the indicated algorithm
|
|
170
|
+
* from the HTTP Signature Algorithms registry.
|
|
171
|
+
*/
|
|
172
|
+
alg?: string;
|
|
173
|
+
/**
|
|
174
|
+
* If `true`, the signer is requested to generate and include a
|
|
175
|
+
* creation timestamp. This parameter has no associated value in the
|
|
176
|
+
* wire format.
|
|
177
|
+
*/
|
|
178
|
+
created?: true;
|
|
179
|
+
/**
|
|
180
|
+
* If `true`, the signer is requested to generate and include an
|
|
181
|
+
* expiration timestamp. This parameter has no associated value in
|
|
182
|
+
* the wire format.
|
|
183
|
+
*/
|
|
184
|
+
expires?: true;
|
|
185
|
+
/**
|
|
186
|
+
* If present, the signer is requested to include this value as the
|
|
187
|
+
* signature nonce in the target signature.
|
|
188
|
+
*/
|
|
189
|
+
nonce?: string;
|
|
190
|
+
/**
|
|
191
|
+
* If present, the signer is requested to include this value as the
|
|
192
|
+
* signature tag in the target signature.
|
|
193
|
+
*/
|
|
194
|
+
tag?: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* A single covered component identifier from an `Accept-Signature` inner list,
|
|
198
|
+
* as defined in [RFC 9421 §2.1](https://www.rfc-editor.org/rfc/rfc9421#section-2.1)
|
|
199
|
+
* and [§5.1](https://www.rfc-editor.org/rfc/rfc9421#section-5.1).
|
|
200
|
+
*
|
|
201
|
+
* RFC 9421 §5.1 requires that the list of component identifiers includes
|
|
202
|
+
* *all applicable component parameters*. Parameters such as `;sf`, `;bs`,
|
|
203
|
+
* `;req`, `;tr`, `;name`, and `;key` narrow the meaning of a component
|
|
204
|
+
* identifier and MUST be preserved exactly as received so that the signer
|
|
205
|
+
* can cover the same components the verifier requested.
|
|
206
|
+
*
|
|
207
|
+
* Examples:
|
|
208
|
+
* - `{ value: "@method", params: {} }`
|
|
209
|
+
* - `{ value: "content-type", params: { sf: true } }`
|
|
210
|
+
* - `{ value: "@query-param", params: { name: "foo" } }`
|
|
211
|
+
*
|
|
212
|
+
* @since 2.1.0
|
|
213
|
+
*/
|
|
214
|
+
interface AcceptSignatureComponent {
|
|
215
|
+
/**
|
|
216
|
+
* The component identifier name (e.g., `"@method"`, `"content-digest"`,
|
|
217
|
+
* `"@query-param"`).
|
|
218
|
+
*/
|
|
219
|
+
value: string;
|
|
220
|
+
/**
|
|
221
|
+
* Component parameters attached to this identifier (e.g., `{ sf: true }`,
|
|
222
|
+
* `{ name: "foo" }`). An empty object means no parameters were present.
|
|
223
|
+
* Parameters MUST NOT be dropped; doing so would cause the signer to cover
|
|
224
|
+
* a different component than the verifier requested.
|
|
225
|
+
*/
|
|
226
|
+
params: Record<string, unknown>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Represents a single member of the `Accept-Signature` Dictionary
|
|
230
|
+
* Structured Field, as defined in
|
|
231
|
+
* [RFC 9421 §5.1](https://www.rfc-editor.org/rfc/rfc9421#section-5.1).
|
|
232
|
+
*
|
|
233
|
+
* @since 2.1.0
|
|
234
|
+
*/
|
|
235
|
+
interface AcceptSignatureMember {
|
|
236
|
+
/**
|
|
237
|
+
* The label that uniquely identifies the requested message signature
|
|
238
|
+
* within the context of the target HTTP message (e.g., `"sig1"`).
|
|
239
|
+
*/
|
|
240
|
+
label: string;
|
|
241
|
+
/**
|
|
242
|
+
* The exact list of covered component identifiers requested for the target
|
|
243
|
+
* signature, including all applicable component parameters, as required by
|
|
244
|
+
* [RFC 9421 §5.1](https://www.rfc-editor.org/rfc/rfc9421#section-5.1).
|
|
245
|
+
*
|
|
246
|
+
* Each element is an {@link AcceptSignatureComponent} that preserves
|
|
247
|
+
* both the identifier name and any parameters (e.g., `;sf`, `;name="foo"`).
|
|
248
|
+
* The signer MUST cover exactly these components—with their parameters—when
|
|
249
|
+
* fulfilling the challenge.
|
|
250
|
+
*/
|
|
251
|
+
components: AcceptSignatureComponent[];
|
|
252
|
+
/**
|
|
253
|
+
* Optional signature metadata parameters requested by the verifier.
|
|
254
|
+
*/
|
|
255
|
+
parameters: AcceptSignatureParameters;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parses an `Accept-Signature` header value (RFC 9421 §5.1) into an
|
|
259
|
+
* array of {@link AcceptSignatureMember} objects.
|
|
260
|
+
*
|
|
261
|
+
* The `Accept-Signature` field is a Dictionary Structured Field
|
|
262
|
+
* (RFC 8941 §3.2). Each dictionary member describes a single
|
|
263
|
+
* requested message signature.
|
|
264
|
+
*
|
|
265
|
+
* On parse failure (malformed or empty header), returns an empty array.
|
|
266
|
+
*
|
|
267
|
+
* @param header The raw `Accept-Signature` header value string.
|
|
268
|
+
* @returns An array of parsed members. Empty if the header is
|
|
269
|
+
* malformed or empty.
|
|
270
|
+
* @since 2.1.0
|
|
271
|
+
*/
|
|
272
|
+
declare function parseAcceptSignature(header: string): AcceptSignatureMember[];
|
|
273
|
+
/**
|
|
274
|
+
* Serializes an array of {@link AcceptSignatureMember} objects into an
|
|
275
|
+
* `Accept-Signature` header value string (RFC 9421 §5.1).
|
|
276
|
+
*
|
|
277
|
+
* The output is a Dictionary Structured Field (RFC 8941 §3.2).
|
|
278
|
+
*
|
|
279
|
+
* @param members The members to serialize.
|
|
280
|
+
* @returns The serialized header value string.
|
|
281
|
+
* @since 2.1.0
|
|
282
|
+
*/
|
|
283
|
+
declare function formatAcceptSignature(members: AcceptSignatureMember[]): string;
|
|
284
|
+
/**
|
|
285
|
+
* Filters out {@link AcceptSignatureMember} entries whose covered
|
|
286
|
+
* components include response-only identifiers (`@status`) that are
|
|
287
|
+
* not applicable to request-target messages, as required by
|
|
288
|
+
* [RFC 9421 §5](https://www.rfc-editor.org/rfc/rfc9421#section-5).
|
|
289
|
+
*
|
|
290
|
+
* A warning is logged for each discarded entry.
|
|
291
|
+
*
|
|
292
|
+
* @param members The parsed `Accept-Signature` entries to validate.
|
|
293
|
+
* @returns Only entries that are valid for request-target messages.
|
|
294
|
+
* @since 2.1.0
|
|
295
|
+
*/
|
|
296
|
+
declare function validateAcceptSignature(members: AcceptSignatureMember[]): AcceptSignatureMember[];
|
|
297
|
+
/**
|
|
298
|
+
* The result of {@link fulfillAcceptSignature}. This can be used directly
|
|
299
|
+
* as the `rfc9421` option of {@link SignRequestOptions}.
|
|
300
|
+
* @since 2.1.0
|
|
301
|
+
*/
|
|
302
|
+
interface FulfillAcceptSignatureResult {
|
|
303
|
+
/** The label for the signature. */
|
|
304
|
+
label: string;
|
|
305
|
+
/**
|
|
306
|
+
* The merged set of covered component identifiers, including all component
|
|
307
|
+
* parameters, ready to be passed to the signer.
|
|
308
|
+
*/
|
|
309
|
+
components: AcceptSignatureComponent[];
|
|
310
|
+
/** The nonce requested by the challenge, if any. */
|
|
311
|
+
nonce?: string;
|
|
312
|
+
/** The tag requested by the challenge, if any. */
|
|
313
|
+
tag?: string;
|
|
314
|
+
/**
|
|
315
|
+
* If `true`, the challenger requested that the signer generate and include
|
|
316
|
+
* an expiration timestamp in the signature parameters.
|
|
317
|
+
*/
|
|
318
|
+
expires?: true;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Attempts to translate an {@link AcceptSignatureMember} challenge into
|
|
322
|
+
* RFC 9421 signing options that the local signer can fulfill.
|
|
323
|
+
*
|
|
324
|
+
* Returns `null` if the challenge cannot be fulfilled—for example, if
|
|
325
|
+
* the requested `alg` or `keyid` is incompatible with the local key.
|
|
326
|
+
*
|
|
327
|
+
* Safety constraints:
|
|
328
|
+
* - `alg`: only honored if it matches `localAlg`.
|
|
329
|
+
* - `keyid`: only honored if it matches `localKeyId`.
|
|
330
|
+
* - `components`: passed through exactly as requested, per RFC 9421 §5.2.
|
|
331
|
+
* - `nonce`, `tag`, and `expires` are passed through directly.
|
|
332
|
+
*
|
|
333
|
+
* @param entry The challenge entry from the `Accept-Signature` header.
|
|
334
|
+
* @param localKeyId The local key identifier (e.g., the actor key URL).
|
|
335
|
+
* @param localAlg The algorithm of the local private key
|
|
336
|
+
* (e.g., `"rsa-v1_5-sha256"`).
|
|
337
|
+
* @returns Signing options if the challenge can be fulfilled, or `null`.
|
|
338
|
+
* @since 2.1.0
|
|
339
|
+
*/
|
|
340
|
+
declare function fulfillAcceptSignature(entry: AcceptSignatureMember, localKeyId: string, localAlg: string): FulfillAcceptSignatureResult | null;
|
|
341
|
+
//#endregion
|
|
154
342
|
//#region src/sig/http.d.ts
|
|
155
343
|
/**
|
|
156
344
|
* The standard to use for signing and verifying HTTP signatures.
|
|
@@ -184,6 +372,45 @@ interface SignRequestOptions {
|
|
|
184
372
|
* is used.
|
|
185
373
|
*/
|
|
186
374
|
tracerProvider?: TracerProvider;
|
|
375
|
+
/**
|
|
376
|
+
* Options specific to the RFC 9421 signing path. These options are
|
|
377
|
+
* ignored when `spec` is `"draft-cavage-http-signatures-12"`.
|
|
378
|
+
* @since 2.1.0
|
|
379
|
+
*/
|
|
380
|
+
rfc9421?: Rfc9421SignRequestOptions;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Options for customizing the RFC 9421 signature label, covered components,
|
|
384
|
+
* and metadata parameters. These are typically derived from an
|
|
385
|
+
* `Accept-Signature` challenge.
|
|
386
|
+
* @since 2.1.0
|
|
387
|
+
*/
|
|
388
|
+
interface Rfc9421SignRequestOptions {
|
|
389
|
+
/**
|
|
390
|
+
* The label for the signature in `Signature-Input` and `Signature` headers.
|
|
391
|
+
* @default `"sig1"`
|
|
392
|
+
*/
|
|
393
|
+
label?: string;
|
|
394
|
+
/**
|
|
395
|
+
* The covered component identifiers. When omitted, the default set
|
|
396
|
+
* `["@method", "@target-uri", "@authority", "host", "date"]`
|
|
397
|
+
* (plus `"content-digest"` when a body is present) is used.
|
|
398
|
+
*/
|
|
399
|
+
components?: AcceptSignatureComponent[];
|
|
400
|
+
/**
|
|
401
|
+
* A nonce value to include in the signature parameters.
|
|
402
|
+
*/
|
|
403
|
+
nonce?: string;
|
|
404
|
+
/**
|
|
405
|
+
* A tag value to include in the signature parameters.
|
|
406
|
+
*/
|
|
407
|
+
tag?: string;
|
|
408
|
+
/**
|
|
409
|
+
* If `true`, an expiration timestamp is generated and included in the
|
|
410
|
+
* signature parameters. The expiration time defaults to one hour after
|
|
411
|
+
* the signature creation time.
|
|
412
|
+
*/
|
|
413
|
+
expires?: true;
|
|
187
414
|
}
|
|
188
415
|
/**
|
|
189
416
|
* Signs a request using the given private key.
|
|
@@ -259,6 +486,7 @@ type VerifyRequestFailureReason = {
|
|
|
259
486
|
type VerifyRequestDetailedResult = {
|
|
260
487
|
readonly verified: true;
|
|
261
488
|
readonly key: CryptographicKey;
|
|
489
|
+
readonly signatureLabel?: string;
|
|
262
490
|
} | {
|
|
263
491
|
readonly verified: false;
|
|
264
492
|
readonly reason: VerifyRequestFailureReason;
|
|
@@ -313,4 +541,4 @@ interface HttpMessageSignaturesSpecDeterminer {
|
|
|
313
541
|
* @since 1.6.0
|
|
314
542
|
*/
|
|
315
543
|
//#endregion
|
|
316
|
-
export { FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, SignRequestOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, exportJwk, fetchKey, fetchKeyDetailed, generateCryptoKeyPair, importJwk, signRequest, verifyRequest, verifyRequestDetailed };
|
|
544
|
+
export { AcceptSignatureMember, AcceptSignatureParameters, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignRequestOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, importJwk, parseAcceptSignature, signRequest, validateAcceptSignature, verifyRequest, verifyRequestDetailed };
|