@fedify/fedify 2.4.0-dev.2065 → 2.4.0-dev.2073

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.
Files changed (98) hide show
  1. package/dist/{builder-CMkrnYbY.mjs → builder-CVHpPAjK.mjs} +6 -2
  2. package/dist/compat/mod.d.cts +1 -1
  3. package/dist/compat/mod.d.ts +1 -1
  4. package/dist/compat/transformers.test.mjs +1 -1
  5. package/dist/{compound-proof-Dj3DCsoj.mjs → compound-proof-B5Skp-vE.mjs} +1 -1
  6. package/dist/{context-D_gg4M0n.d.ts → context-BSywYspi.d.ts} +153 -2
  7. package/dist/{context-b36TpPoG.d.cts → context-CZjZYXFC.d.cts} +153 -2
  8. package/dist/{context-DG5QeQ8W.mjs → context-DlZhxdFT.mjs} +2 -1
  9. package/dist/{deno-BuRFI7wk.mjs → deno-LYTbBhYV.mjs} +1 -1
  10. package/dist/{docloader-_aSNLA90.mjs → docloader-C0SWQylk.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/compound-fanout.test.mjs +4 -4
  13. package/dist/federation/handler-compound-proof.test.mjs +4 -4
  14. package/dist/federation/handler.test.mjs +6 -6
  15. package/dist/federation/hashlink-media.test.mjs +2 -2
  16. package/dist/federation/idempotency.test.mjs +2 -2
  17. package/dist/federation/metrics.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +9 -9
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +3 -3
  21. package/dist/federation/mod.d.ts +3 -3
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/outgoing-proof.test.mjs +6 -6
  24. package/dist/federation/portable-gateway-keys.test.d.mts +2 -0
  25. package/dist/federation/portable-gateway-keys.test.mjs +363 -0
  26. package/dist/federation/portable-inbox.test.d.mts +2 -0
  27. package/dist/federation/portable-inbox.test.mjs +546 -0
  28. package/dist/federation/portable.test.mjs +3 -3
  29. package/dist/federation/send.test.mjs +3 -3
  30. package/dist/federation/tasks/enqueue.test.mjs +2 -2
  31. package/dist/federation/tasks/tasks.test.mjs +3 -3
  32. package/dist/federation/temporal.test.mjs +1 -1
  33. package/dist/federation/webfinger.test.mjs +2 -2
  34. package/dist/{federation-Coi_bg12.cjs → federation-B1aeTKKN.cjs} +631 -145
  35. package/dist/{http-f1qaBtOh.mjs → http-C7qHlv-b.mjs} +20 -5
  36. package/dist/{http-BGShIsd6.cjs → http-DGk8XI38.cjs} +2684 -48
  37. package/dist/{http-65PYi9jY.d.ts → http-n2v6DPxu.d.ts} +52 -2
  38. package/dist/http-vfTpzGEq.js +5087 -0
  39. package/dist/{http-CP-7OdSq.d.cts → http-xlG-jRdB.d.cts} +52 -2
  40. package/dist/{key-BxHsA1s9.mjs → key-BYXnTGro.mjs} +147 -7
  41. package/dist/{kv-cache-Cgj-kpQS.js → kv-cache-DCJuwdnB.js} +1 -1
  42. package/dist/{kv-cache-C9IY-FMN.mjs → kv-cache-DEH5jyND.mjs} +1 -1
  43. package/dist/{kv-cache-CY6pDNoS.cjs → kv-cache-DvqkKNIj.cjs} +1 -1
  44. package/dist/{ld-CqJq5erX.mjs → ld-DT3e2hOv.mjs} +3 -3
  45. package/dist/{metrics-DOqknlZd.mjs → metrics-DvlvYpq_.mjs} +1 -1
  46. package/dist/{middleware-VOCZN3SO.mjs → middleware-BJcez_E3.mjs} +1 -1
  47. package/dist/{middleware-1h_LgwXC.js → middleware-CCbyUF4c.js} +547 -62
  48. package/dist/{middleware-s-AZzx4r.mjs → middleware-CpyCNOW_.mjs} +549 -72
  49. package/dist/{mod-BhMvsgdF.d.ts → mod-B2h2KY0q.d.ts} +1 -1
  50. package/dist/{mod-Dhm7SqyE.d.ts → mod-C9WSpZWm.d.ts} +1 -1
  51. package/dist/{mod-C0BYc0OU.d.ts → mod-CVZrXSdm.d.ts} +1 -1
  52. package/dist/{mod-pLbeNwcC.d.cts → mod-HDSvS-ww.d.cts} +1 -1
  53. package/dist/{mod-Bfenkg_c.d.cts → mod-JzkaEXsi.d.cts} +1 -1
  54. package/dist/{mod-CyiSjRkk.d.cts → mod-xGFCHqq_.d.cts} +1 -1
  55. package/dist/mod.cjs +18 -18
  56. package/dist/mod.d.cts +7 -7
  57. package/dist/mod.d.ts +7 -7
  58. package/dist/mod.js +5 -5
  59. package/dist/nodeinfo/handler.test.mjs +2 -2
  60. package/dist/{owner-D_F22lfM.mjs → owner-CDsVeZI7.mjs} +45 -2
  61. package/dist/owner-DCIH7Iq0.cjs +225 -0
  62. package/dist/owner-DfGz0cXm.js +215 -0
  63. package/dist/portable-key-DCyKGCQd.mjs +194 -0
  64. package/dist/{proof-B03JXhrk.mjs → proof-CxsVG6vM.mjs} +5 -5
  65. package/dist/{send-NNkfKtVN.mjs → send-BZJ7NsVV.mjs} +8 -4
  66. package/dist/sig/compound-proof-discovery.test.mjs +1 -1
  67. package/dist/sig/compound-proof-producer.test.mjs +1 -1
  68. package/dist/sig/compound-proof-verification.test.mjs +2 -2
  69. package/dist/sig/compound-proof.test.mjs +3 -3
  70. package/dist/sig/http.test.mjs +2 -2
  71. package/dist/sig/key.test.mjs +1 -1
  72. package/dist/sig/ld.test.mjs +2 -2
  73. package/dist/sig/mod.cjs +16 -16
  74. package/dist/sig/mod.d.cts +2 -2
  75. package/dist/sig/mod.d.ts +2 -2
  76. package/dist/sig/mod.js +3 -3
  77. package/dist/sig/owner.test.mjs +1 -1
  78. package/dist/sig/portable-collection.test.mjs +3 -3
  79. package/dist/sig/portable-key.test.d.mts +2 -0
  80. package/dist/sig/portable-key.test.mjs +275 -0
  81. package/dist/sig/proof.test.mjs +4 -4
  82. package/dist/{sig-B1E2uyhQ.cjs → sig-C6TnADze.cjs} +4 -4
  83. package/dist/{sig-Bb20Pyrd.js → sig-Cs9_ecdh.js} +2 -2
  84. package/dist/{temporal-VVVSuruq.mjs → temporal-CLzSfIOV.mjs} +1 -1
  85. package/dist/testing/kv.test.mjs +1 -1
  86. package/dist/testing/mod.d.mts +151 -0
  87. package/dist/testing/mod.mjs +2 -2
  88. package/dist/{testing-By1YYsIK.mjs → testing-CO_cEvQc.mjs} +1 -1
  89. package/dist/utils/docloader.test.mjs +2 -2
  90. package/dist/utils/kv-cache.test.mjs +1 -1
  91. package/dist/utils/mod.cjs +1 -1
  92. package/dist/utils/mod.d.cts +1 -1
  93. package/dist/utils/mod.d.ts +1 -1
  94. package/dist/utils/mod.js +1 -1
  95. package/package.json +6 -6
  96. package/dist/http-z5n7chWw.js +0 -2647
  97. package/dist/owner-BLBWXCNt.js +0 -2276
  98. package/dist/owner-D8ZpRusc.cjs +0 -2446
@@ -0,0 +1,215 @@
1
+ import { Temporal } from "temporal-polyfill";
2
+ import { URLPattern } from "urlpattern-polyfill";
3
+ import { B as getCanonicalPortableId, G as isSamePublicKey$1, M as exportJwk, N as fetchActorDocument, U as isCompatibleKeyId, ht as version, mt as name, o as fetchPortableGatewayKey, z as verifyKeyOwnership } from "./http-vfTpzGEq.js";
4
+ import { getLogger } from "@logtape/logtape";
5
+ import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
6
+ import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
7
+ import { getDocumentLoader } from "@fedify/vocab-runtime";
8
+ //#region src/sig/owner.ts
9
+ const logger = getLogger([
10
+ "fedify",
11
+ "sig",
12
+ "owner"
13
+ ]);
14
+ /**
15
+ * Checks if the actor of the given activity owns the specified key.
16
+ *
17
+ * Ownership is never taken from what the activity or the key say about
18
+ * themselves, as both are written by whoever sent the activity. It is
19
+ * established from a document that the owner itself serves: either the key's
20
+ * claimed owner links back to the key, or the actor the activity claims lists
21
+ * the key as its own.
22
+ *
23
+ * @param activity The activity to check.
24
+ * @param key The public key to check.
25
+ * @param options Options for checking the key ownership.
26
+ * @returns Whether the actor is the owner of the key.
27
+ */
28
+ async function doesActorOwnKey(activity, key, options) {
29
+ return await (options.tracerProvider ?? trace.getTracerProvider()).getTracer(name, version).startActiveSpan("activitypub.verify_key_ownership", {
30
+ kind: SpanKind.INTERNAL,
31
+ attributes: {
32
+ "activitypub.actor.id": activity.actorId?.href ?? "",
33
+ "activitypub.key.id": key.id?.href ?? ""
34
+ }
35
+ }, async (span) => {
36
+ try {
37
+ const actorId = activity.actorId;
38
+ if (actorId == null) {
39
+ span.setAttribute("activitypub.key_ownership.verified", false);
40
+ span.setAttribute("activitypub.key_ownership.method", "none");
41
+ return false;
42
+ }
43
+ if (key.id != null && isCompatibleKeyId(key.id)) {
44
+ const owner = await getPortableGatewayKeyOwner(key, options);
45
+ if (owner !== void 0) {
46
+ const ownerId = owner?.id == null ? null : getCanonicalPortableId(owner.id);
47
+ const verified = ownerId != null && ownerId === getCanonicalPortableId(actorId);
48
+ span.setAttribute("activitypub.key_ownership.verified", verified);
49
+ span.setAttribute("activitypub.key_ownership.method", "portable_gateway_key");
50
+ return verified;
51
+ }
52
+ }
53
+ if (key.ownerId != null) {
54
+ const owner = await verifyKeyOwnership(key, options);
55
+ if (owner?.id != null && owner.id.href === actorId.href) {
56
+ span.setAttribute("activitypub.key_ownership.verified", true);
57
+ span.setAttribute("activitypub.key_ownership.method", "key_owner");
58
+ return true;
59
+ }
60
+ }
61
+ const actor = await fetchActorDocument(actorId, options);
62
+ if (actor != null && await doesActorListKey(actor, key, options)) {
63
+ span.setAttribute("activitypub.key_ownership.verified", true);
64
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
65
+ return true;
66
+ }
67
+ logger.debug("The actor {actorId} does not own key {keyId}: neither the owner the key claims nor the actor's own document links the two to each other.", {
68
+ actorId: actorId.href,
69
+ keyId: key.id?.href
70
+ });
71
+ span.setAttribute("activitypub.key_ownership.verified", false);
72
+ span.setAttribute("activitypub.key_ownership.method", "actor_fetch");
73
+ return false;
74
+ } catch (error) {
75
+ span.recordException(error);
76
+ span.setStatus({
77
+ code: SpanStatusCode.ERROR,
78
+ message: String(error)
79
+ });
80
+ throw error;
81
+ } finally {
82
+ span.end();
83
+ }
84
+ });
85
+ }
86
+ /**
87
+ * Determines whether the given actor's own document lists the given key among
88
+ * its public keys.
89
+ *
90
+ * Keys are matched by id, which is what an actor document links to. A key
91
+ * document may leave its id implicit, though, and then there is no id for the
92
+ * actor to link to; the key material itself is the only thing the two can
93
+ * have in common, so that is what gets compared.
94
+ */
95
+ async function doesActorListKey(actor, key, options) {
96
+ if (key.id != null) {
97
+ for (const publicKeyId of actor.publicKeyIds) if (publicKeyId.href === key.id.href) return true;
98
+ return false;
99
+ }
100
+ if (key.publicKey == null) return false;
101
+ const publicKeys = actor.getPublicKeys({
102
+ ...options,
103
+ suppressError: true
104
+ });
105
+ for await (const publicKey of publicKeys) {
106
+ if (publicKey.publicKey == null) continue;
107
+ if (await isSamePublicKey(publicKey.publicKey, key.publicKey)) return true;
108
+ }
109
+ return false;
110
+ }
111
+ /**
112
+ * Compares two public keys by their key material, ignoring the metadata that
113
+ * surrounds it.
114
+ */
115
+ async function isSamePublicKey(a, b) {
116
+ const [x, y] = await Promise.all([exportJwk(a), exportJwk(b)]);
117
+ return x.kty === y.kty && x.crv === y.crv && x.n === y.n && x.e === y.e && x.x === y.x && x.y === y.y;
118
+ }
119
+ /**
120
+ * Gets the actor that owns the specified key. Returns `null` if the key has no
121
+ * known owner.
122
+ *
123
+ * The owner is only returned when the key and the owner link to each other:
124
+ * a document that merely claims to own a key is not enough, as the claim and
125
+ * the key can come from the same host.
126
+ *
127
+ * @param keyId The ID of the key to check, or the key itself.
128
+ * @param options Options for getting the key owner.
129
+ * @returns The actor that owns the key, or `null` if the key has no known
130
+ * owner.
131
+ * @since 0.7.0
132
+ */
133
+ async function getKeyOwner(keyId, options) {
134
+ const tracerProvider = options.tracerProvider ?? trace.getTracerProvider();
135
+ const documentLoader = options.documentLoader ?? getDocumentLoader();
136
+ const fetchOptions = {
137
+ documentLoader,
138
+ contextLoader: options.contextLoader ?? getDocumentLoader(),
139
+ tracerProvider
140
+ };
141
+ const id = keyId instanceof CryptographicKey ? keyId.id : keyId;
142
+ if (id != null && isCompatibleKeyId(id)) {
143
+ const owner = await getPortableGatewayKeyOwner(keyId, fetchOptions);
144
+ if (owner !== void 0) return owner;
145
+ }
146
+ if (keyId instanceof CryptographicKey) return await verifyKeyOwnership(keyId, fetchOptions);
147
+ let keyDoc;
148
+ let documentUrl = keyId;
149
+ try {
150
+ const remoteDocument = await documentLoader(keyId.href);
151
+ keyDoc = remoteDocument.document;
152
+ documentUrl = new URL(remoteDocument.documentUrl ?? "", keyId);
153
+ } catch (_) {
154
+ return null;
155
+ }
156
+ let object;
157
+ try {
158
+ object = await Object$1.fromJsonLd(keyDoc, {
159
+ ...fetchOptions,
160
+ baseUrl: documentUrl
161
+ });
162
+ } catch (e) {
163
+ if (!(e instanceof TypeError)) throw e;
164
+ try {
165
+ object = await CryptographicKey.fromJsonLd(keyDoc, fetchOptions);
166
+ } catch (e) {
167
+ if (e instanceof TypeError) return null;
168
+ throw e;
169
+ }
170
+ }
171
+ if (object instanceof CryptographicKey) {
172
+ if (object.id != null && object.id.href !== keyId.href) return null;
173
+ return await verifyKeyOwnership(object.id == null ? object.clone({ id: keyId }) : object, fetchOptions);
174
+ }
175
+ if (!isActor(object)) return null;
176
+ if (object.id == null || object.id.origin !== documentUrl.origin) {
177
+ logger.debug("The document served at {documentUrl} claims to be the actor {actorId}, which belongs to another origin; refusing to treat it as the owner of key {keyId}.", {
178
+ documentUrl: documentUrl.href,
179
+ actorId: object.id?.href,
180
+ keyId: keyId.href
181
+ });
182
+ return null;
183
+ }
184
+ for (const kid of object.publicKeyIds) if (kid.href === keyId.href) return object;
185
+ return null;
186
+ }
187
+ /**
188
+ * Resolves the owner of a key at a compatible identifier, if the key turns
189
+ * out to be a gateway key of an [FEP-ef61] portable actor.
190
+ *
191
+ * [FEP-ef61]: https://w3id.org/fep/ef61
192
+ * @param key The key, or its ID, which must be a compatible identifier.
193
+ * @param options Options for fetching the key.
194
+ * @returns `undefined` if the key is not a gateway key, i.e., the document at
195
+ * the key ID is not a portable actor, so the usual checks apply.
196
+ * Otherwise, the portable actor if its signed document vouches for
197
+ * the key, and the given key, if any, has the same key material, or
198
+ * `null` if not.
199
+ */
200
+ async function getPortableGatewayKeyOwner(key, options) {
201
+ const keyId = key instanceof CryptographicKey ? key.id : key;
202
+ if (keyId == null) return void 0;
203
+ const resolution = await fetchPortableGatewayKey(keyId, options);
204
+ if (resolution.type === "legacy") return void 0;
205
+ if (resolution.type === "rejected") return null;
206
+ if (key instanceof CryptographicKey) {
207
+ if (key.publicKey == null || !await isSamePublicKey$1(key.publicKey, resolution.key.publicKey)) {
208
+ logger.debug("The key {keyId} does not have the same key material as the gateway key its portable actor vouches for.", { keyId: keyId.href });
209
+ return null;
210
+ }
211
+ }
212
+ return resolution.actor;
213
+ }
214
+ //#endregion
215
+ export { getKeyOwner as n, doesActorOwnKey as t };
@@ -0,0 +1,194 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ import { h as isSamePublicKey, l as getCanonicalPortableId, p as isPortableActorDocument } from "./key-BYXnTGro.mjs";
5
+ import { c as verifyPortableObjectProofWithRoot } from "./proof-CxsVG6vM.mjs";
6
+ import { getLogger } from "@logtape/logtape";
7
+ import { CryptographicKey, Multikey, Object as Object$1 } from "@fedify/vocab";
8
+ import { getDocumentLoader, isGatewayUrl } from "@fedify/vocab-runtime";
9
+ //#region src/sig/portable-key.ts
10
+ const logger = getLogger([
11
+ "fedify",
12
+ "sig",
13
+ "key"
14
+ ]);
15
+ const SEC = "https://w3id.org/security#";
16
+ /**
17
+ * Verifies that the signed document of a portable actor vouches for
18
+ * the gateway key with the given ID.
19
+ *
20
+ * A gateway key is accepted only if:
21
+ *
22
+ * - the document is an actor whose portable ID is the one the key ID is
23
+ * the compatible identifier of;
24
+ * - the document has a valid [FEP-8b32] Object Integrity Proof made by
25
+ * the DID of its ID, i.e., it satisfies the [FEP-ef61] proof policy;
26
+ * - the document embeds a `Multikey` with that ID in its `assertionMethod`,
27
+ * whose `controller` is the actor, as [FEP-521a] requires; a key
28
+ * embedded in its `publicKey` with the same ID must agree with it; and
29
+ * - the key ID's origin is one of the actor's `gateways`.
30
+ *
31
+ * [FEP-8b32]: https://w3id.org/fep/8b32
32
+ * [FEP-ef61]: https://w3id.org/fep/ef61
33
+ * [FEP-521a]: https://w3id.org/fep/521a
34
+ *
35
+ * @param document The raw JSON-LD document served at the key ID.
36
+ * @param actor The parsed document, which must be a portable actor.
37
+ * @param keyId The key ID, which must be a compatible key ID.
38
+ * @param options Loaders and telemetry providers.
39
+ * @returns The verification result, which is never `legacy`.
40
+ * @internal
41
+ */
42
+ async function verifyPortableGatewayKeyDocument(document, actor, keyId, options = {}) {
43
+ const reject = (reason) => {
44
+ logger.debug("Failed to verify gateway key {keyId} of the portable actor {actorId}: {reason}", {
45
+ keyId: keyId.href,
46
+ actorId: actor.id?.href,
47
+ reason
48
+ });
49
+ return {
50
+ type: "rejected",
51
+ reason
52
+ };
53
+ };
54
+ const keyBase = new URL(keyId.href);
55
+ keyBase.hash = "";
56
+ const claimedActorId = getCanonicalPortableId(keyBase);
57
+ const actorId = actor.id == null ? null : getCanonicalPortableId(actor.id);
58
+ if (claimedActorId == null || actorId == null) return reject("The key ID or the actor ID is not a valid portable ID.");
59
+ if (claimedActorId !== actorId) return reject("The key ID is not a compatible identifier of the actor it dereferences to.");
60
+ let verification;
61
+ try {
62
+ verification = await verifyPortableObjectProofWithRoot(document, {
63
+ documentLoader: options.documentLoader,
64
+ contextLoader: options.contextLoader,
65
+ keyCache: options.keyCache,
66
+ tracerProvider: options.tracerProvider,
67
+ meterProvider: options.meterProvider
68
+ });
69
+ } catch (error) {
70
+ if (!(error instanceof TypeError)) throw error;
71
+ return reject(`The actor document is malformed: ${error.message}`);
72
+ }
73
+ const { result, root } = verification;
74
+ if (!result.verified) return reject("The actor document does not satisfy the FEP-ef61 proof policy: " + result.reason.type);
75
+ if (root == null) return reject("The actor document could not be expanded.");
76
+ const refuse = (url) => Promise.reject(/* @__PURE__ */ new Error(`Refusing to fetch ${url}.`));
77
+ let verifiedActor;
78
+ try {
79
+ verifiedActor = await Object$1.fromJsonLd(root, {
80
+ documentLoader: refuse,
81
+ contextLoader: options.contextLoader,
82
+ tracerProvider: options.tracerProvider
83
+ });
84
+ } catch (error) {
85
+ if (!(error instanceof TypeError)) throw error;
86
+ return reject("The verified actor document is malformed.");
87
+ }
88
+ if (!isPortableActorDocument(verifiedActor) || getCanonicalPortableId(verifiedActor.id) !== claimedActorId) return reject("The key ID is not a compatible identifier of the actor whose document is signed.");
89
+ actor = verifiedActor;
90
+ const multikeyNode = findEmbeddedNode(root[`${SEC}assertionMethod`], keyId);
91
+ if (multikeyNode == null) return reject("The actor document does not embed the key in its assertionMethod.");
92
+ let multikey;
93
+ try {
94
+ multikey = await Multikey.fromJsonLd(multikeyNode, {
95
+ documentLoader: refuse,
96
+ contextLoader: options.contextLoader,
97
+ tracerProvider: options.tracerProvider
98
+ });
99
+ } catch (error) {
100
+ if (!(error instanceof TypeError)) throw error;
101
+ return reject("The key in the assertionMethod is malformed.");
102
+ }
103
+ if (multikey.publicKey == null) return reject("The key in the assertionMethod has no public key.");
104
+ if (multikey.controllerId == null || getCanonicalPortableId(multikey.controllerId) !== actorId) return reject("The controller of the key is not the actor.");
105
+ const publicKeyNode = findEmbeddedNode(root[`${SEC}publicKey`], keyId);
106
+ if (publicKeyNode != null) {
107
+ let publicKey;
108
+ try {
109
+ publicKey = await CryptographicKey.fromJsonLd(publicKeyNode, {
110
+ documentLoader: refuse,
111
+ contextLoader: options.contextLoader,
112
+ tracerProvider: options.tracerProvider
113
+ });
114
+ } catch (error) {
115
+ if (!(error instanceof TypeError)) throw error;
116
+ return reject("The key in the publicKey is malformed.");
117
+ }
118
+ if (publicKey.publicKey == null || !await isSamePublicKey(publicKey.publicKey, multikey.publicKey) || publicKey.ownerId != null && getCanonicalPortableId(publicKey.ownerId) !== actorId) return reject("The key in the publicKey does not agree with the one in the assertionMethod.");
119
+ }
120
+ if (!actor.gateways.some((gateway) => isGatewayUrl(gateway) && gateway.origin === keyId.origin)) return reject(`The gateway ${keyId.origin} is not listed in the actor's gateways.`);
121
+ const key = new CryptographicKey({
122
+ id: keyId,
123
+ owner: actor.id,
124
+ publicKey: multikey.publicKey
125
+ });
126
+ return {
127
+ type: "verified",
128
+ actor,
129
+ key
130
+ };
131
+ }
132
+ /**
133
+ * Fetches the document at a compatible key ID, and resolves the key as
134
+ * a gateway key if the document is a portable actor.
135
+ *
136
+ * @param keyId The key ID, which must be a compatible key ID.
137
+ * @param options Loaders and telemetry providers.
138
+ * @returns `legacy` if the document cannot be fetched or is not a portable
139
+ * actor, which leaves the key to the usual resolution; otherwise,
140
+ * the result of {@link verifyPortableGatewayKeyDocument}.
141
+ * @internal
142
+ */
143
+ async function fetchPortableGatewayKey(keyId, options = {}) {
144
+ const documentLoader = options.documentLoader ?? getDocumentLoader();
145
+ const contextLoader = options.contextLoader ?? getDocumentLoader();
146
+ let remoteDocument;
147
+ try {
148
+ remoteDocument = await documentLoader(keyId.href);
149
+ } catch (error) {
150
+ logger.debug("Failed to fetch key {keyId}: {error}", {
151
+ keyId: keyId.href,
152
+ error
153
+ });
154
+ return { type: "legacy" };
155
+ }
156
+ let object;
157
+ try {
158
+ object = await Object$1.fromJsonLd(remoteDocument.document, {
159
+ documentLoader,
160
+ contextLoader,
161
+ tracerProvider: options.tracerProvider
162
+ });
163
+ } catch (error) {
164
+ if (!(error instanceof TypeError)) throw error;
165
+ return { type: "legacy" };
166
+ }
167
+ if (!isPortableActorDocument(object)) return { type: "legacy" };
168
+ return await verifyPortableGatewayKeyDocument(remoteDocument.document, object, keyId, {
169
+ ...options,
170
+ documentLoader,
171
+ contextLoader
172
+ });
173
+ }
174
+ function findEmbeddedNode(values, id) {
175
+ if (!Array.isArray(values)) return null;
176
+ for (const value of values) {
177
+ if (value == null || typeof value !== "object" || Array.isArray(value)) continue;
178
+ const node = value;
179
+ const nodeId = node["@id"];
180
+ if (typeof nodeId !== "string") continue;
181
+ let parsed;
182
+ try {
183
+ parsed = new URL(nodeId);
184
+ } catch {
185
+ continue;
186
+ }
187
+ if (parsed.href !== id.href) continue;
188
+ if (Object.keys(node).every((key) => key === "@id")) continue;
189
+ return node;
190
+ }
191
+ return null;
192
+ }
193
+ //#endregion
194
+ export { verifyPortableGatewayKeyDocument as n, fetchPortableGatewayKey as t };
@@ -1,19 +1,19 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BuRFI7wk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DOqknlZd.mjs";
6
- import { r as fetchKey, s as validateCryptoKey } from "./key-BxHsA1s9.mjs";
4
+ import { n as version, t as name } from "./deno-LYTbBhYV.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DvlvYpq_.mjs";
6
+ import { r as fetchKey, s as validateCryptoKey } from "./key-BYXnTGro.mjs";
7
7
  import { n as preloadedOnlyDocumentLoader } from "./public-audience--klBIOk1.mjs";
8
8
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
9
- import { c as getNormalizationContextLoader } from "./ld-CqJq5erX.mjs";
9
+ import { c as getNormalizationContextLoader } from "./ld-DT3e2hOv.mjs";
10
10
  import { getLogger } from "@logtape/logtape";
11
11
  import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
12
12
  import { SpanStatusCode, trace } from "@opentelemetry/api";
13
13
  import { encodeMultibase, formatIri, getDocumentLoader, getFe34Origin, haveSameFe34Origin, parseIri } from "@fedify/vocab-runtime";
14
14
  import { encodeHex } from "byte-encodings/hex";
15
- import jsonld from "@fedify/vocab-runtime/jsonld";
16
15
  import { isPlainJsonTree, retainSignedRepresentation } from "@fedify/vocab-runtime/internal/signed-representation";
16
+ import jsonld from "@fedify/vocab-runtime/jsonld";
17
17
  import serialize from "json-canon";
18
18
  //#region src/sig/proof.ts
19
19
  /**
@@ -1,9 +1,9 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as version, t as name } from "./deno-BuRFI7wk.mjs";
5
- import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DOqknlZd.mjs";
6
- import { n as doubleKnock } from "./http-f1qaBtOh.mjs";
4
+ import { n as version, t as name } from "./deno-LYTbBhYV.mjs";
5
+ import { n as getDurationMs, r as getFederationMetrics } from "./metrics-DvlvYpq_.mjs";
6
+ import { n as doubleKnock } from "./http-C7qHlv-b.mjs";
7
7
  import { getLogger } from "@logtape/logtape";
8
8
  import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
9
9
  import { FetchError, UrlError, validatePublicUrl } from "@fedify/vocab-runtime";
@@ -146,7 +146,11 @@ async function sendActivityInternal({ activity, activityId, activityType, keys,
146
146
  rsaKey = key;
147
147
  break;
148
148
  }
149
- if (rsaKey == null) logger.warn("No supported key found to sign the request to {inbox}. The request will be sent without a signature. In order to sign the request, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
149
+ if (rsaKey == null && keys.length < 1) logger.debug("Sending the activity {activityId} to {inbox} without a signature.", {
150
+ activityId,
151
+ inbox: inbox.href
152
+ });
153
+ else if (rsaKey == null) logger.warn("No supported key found to sign the request to {inbox}. The request will be sent without a signature. In order to sign the request, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
150
154
  inbox: inbox.href,
151
155
  keys: keys.map((pair) => ({
152
156
  keyId: pair.keyId.href,
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-Dj3DCsoj.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, n as discoverCompoundProofDocuments } from "../compound-proof-B5Skp-vE.mjs";
7
7
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
8
8
  import { test } from "@fedify/fixture";
9
9
  //#region src/sig/compound-proof-discovery.test.ts
@@ -3,7 +3,7 @@ import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
- import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-Dj3DCsoj.mjs";
6
+ import { i as inspectCompoundPortableObjectApplicability, r as findUnsupportedCompoundProofShape, t as containsCompoundPortableObject } from "../compound-proof-B5Skp-vE.mjs";
7
7
  import { test } from "@fedify/fixture";
8
8
  //#region src/sig/compound-proof-producer.test.ts
9
9
  const portableId = "ap+ef61://did:key:z6MkAlice/objects/1";
@@ -4,8 +4,8 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-B03JXhrk.mjs";
8
- import { a as verifyCompoundPortableObjectProofs, o as verifyCompoundProofDocuments } from "../compound-proof-Dj3DCsoj.mjs";
7
+ import { i as verifyMapLocalProof, s as verifyPortableObjectProofPolicy } from "../proof-CxsVG6vM.mjs";
8
+ import { a as verifyCompoundPortableObjectProofs, o as verifyCompoundProofDocuments } from "../compound-proof-B5Skp-vE.mjs";
9
9
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
10
10
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
11
11
  import { mockDocumentLoader, test } from "@fedify/fixture";
@@ -4,11 +4,11 @@ globalThis.addEventListener = () => {};
4
4
  import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
5
5
  import "../std__assert-DvMDRPes.mjs";
6
6
  import { t as assert } from "../assert-D1Eafmd_.mjs";
7
- import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
8
7
  import { n as preloadedOnlyDocumentLoader } from "../public-audience--klBIOk1.mjs";
9
8
  import { r as normalizeOutgoingActivityJsonLd } from "../outgoing-jsonld-4IJqPYos.mjs";
10
- import { l as verifyProof, r as signObject } from "../proof-B03JXhrk.mjs";
11
- import { o as verifyCompoundProofDocuments } from "../compound-proof-Dj3DCsoj.mjs";
9
+ import { l as verifyProof, r as signObject } from "../proof-CxsVG6vM.mjs";
10
+ import { n as ed25519PrivateKey, r as ed25519PublicKey } from "../keys-DIJNHW-Y.mjs";
11
+ import { o as verifyCompoundProofDocuments } from "../compound-proof-B5Skp-vE.mjs";
12
12
  import { t as map_local_create_note_default } from "../map-local-create-note-B0SeXJms.mjs";
13
13
  import { t as map_local_context_conflict_default } from "../map-local-context-conflict-DOYEEJ3u.mjs";
14
14
  import { Create, DataIntegrityProof, Note, Question } from "@fedify/vocab";
@@ -11,8 +11,8 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
11
11
  import "../std__assert-DvMDRPes.mjs";
12
12
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
13
13
  import { t as assert } from "../assert-D1Eafmd_.mjs";
14
- import { t as exportJwk } from "../key-BxHsA1s9.mjs";
15
- import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-f1qaBtOh.mjs";
14
+ import { t as exportJwk } from "../key-BYXnTGro.mjs";
15
+ import { a as parseRfc9421Signature, c as timingSafeEqual, i as formatRfc9421SignatureParameters, l as verifyRequest, n as doubleKnock, o as parseRfc9421SignatureInput, r as formatRfc9421Signature, s as signRequest, t as createRfc9421SignatureBase, u as verifyRequestDetailed } from "../http-C7qHlv-b.mjs";
16
16
  import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-DIJNHW-Y.mjs";
17
17
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
18
18
  import { FetchError, exportSpki } from "@fedify/vocab-runtime";
@@ -6,7 +6,7 @@ import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
6
6
  import "../std__assert-DvMDRPes.mjs";
7
7
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
8
8
  import { t as assert } from "../assert-D1Eafmd_.mjs";
9
- import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-BxHsA1s9.mjs";
9
+ import { a as generateCryptoKeyPair, i as fetchKeyDetailed, o as importJwk, r as fetchKey, s as validateCryptoKey, t as exportJwk } from "../key-BYXnTGro.mjs";
10
10
  import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
11
11
  import { CryptographicKey, Multikey } from "@fedify/vocab";
12
12
  import { createTestMeterProvider, createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
@@ -8,9 +8,9 @@ import { t as assertInstanceOf } from "../assert_instance_of-mrXWWNY-.mjs";
8
8
  import { t as assertThrows } from "../assert_throws-BYITOvPO.mjs";
9
9
  import { t as assertRejects } from "../assert_rejects-CTptdYck.mjs";
10
10
  import { t as assert } from "../assert-D1Eafmd_.mjs";
11
- import { a as generateCryptoKeyPair } from "../key-BxHsA1s9.mjs";
11
+ import { a as generateCryptoKeyPair } from "../key-BYXnTGro.mjs";
12
+ import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-DT3e2hOv.mjs";
12
13
  import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-DIJNHW-Y.mjs";
13
- import { a as compactJsonLd, f as isInvalidUrlTypeError, g as verifySignature, h as verifyJsonLd, i as attachSignature, n as UnsafeJsonLdError, o as createSignature, p as signJsonLd, s as detachSignature, u as hasSignatureLike } from "../ld-CqJq5erX.mjs";
14
14
  import { CryptographicKey } from "@fedify/vocab";
15
15
  import { createTestMeterProvider, mockDocumentLoader, test } from "@fedify/fixture";
16
16
  import { encodeBase64 } from "byte-encodings/base64";
package/dist/sig/mod.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  const { URLPattern } = require("urlpattern-polyfill");
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_http = require("../http-BGShIsd6.cjs");
4
- const require_owner = require("../owner-D8ZpRusc.cjs");
5
- const require_sig = require("../sig-B1E2uyhQ.cjs");
6
- exports.attachSignature = require_owner.attachSignature;
7
- exports.createProof = require_owner.createProof;
8
- exports.createSignature = require_owner.createSignature;
9
- exports.detachSignature = require_owner.detachSignature;
3
+ const require_http = require("../http-DGk8XI38.cjs");
4
+ const require_owner = require("../owner-DCIH7Iq0.cjs");
5
+ const require_sig = require("../sig-C6TnADze.cjs");
6
+ exports.attachSignature = require_http.attachSignature;
7
+ exports.createProof = require_http.createProof;
8
+ exports.createSignature = require_http.createSignature;
9
+ exports.detachSignature = require_http.detachSignature;
10
10
  exports.doesActorOwnKey = require_owner.doesActorOwnKey;
11
11
  exports.exportJwk = require_http.exportJwk;
12
12
  exports.fetchKey = require_http.fetchKey;
@@ -15,19 +15,19 @@ exports.formatAcceptSignature = require_http.formatAcceptSignature;
15
15
  exports.fulfillAcceptSignature = require_http.fulfillAcceptSignature;
16
16
  exports.generateCryptoKeyPair = require_http.generateCryptoKeyPair;
17
17
  exports.getKeyOwner = require_owner.getKeyOwner;
18
- exports.hasProofLike = require_owner.hasProofLike;
19
- exports.hasSignatureLike = require_owner.hasSignatureLike;
18
+ exports.hasProofLike = require_http.hasProofLike;
19
+ exports.hasSignatureLike = require_http.hasSignatureLike;
20
20
  exports.importJwk = require_http.importJwk;
21
21
  exports.parseAcceptSignature = require_http.parseAcceptSignature;
22
- exports.signJsonLd = require_owner.signJsonLd;
23
- exports.signObject = require_owner.signObject;
22
+ exports.signJsonLd = require_http.signJsonLd;
23
+ exports.signObject = require_http.signObject;
24
24
  exports.signRequest = require_http.signRequest;
25
25
  exports.validateAcceptSignature = require_http.validateAcceptSignature;
26
- exports.verifyJsonLd = require_owner.verifyJsonLd;
27
- exports.verifyObject = require_owner.verifyObject;
26
+ exports.verifyJsonLd = require_http.verifyJsonLd;
27
+ exports.verifyObject = require_http.verifyObject;
28
28
  exports.verifyPortableObject = require_sig.verifyPortableObject;
29
- exports.verifyPortableObjectProof = require_owner.verifyPortableObjectProof;
30
- exports.verifyProof = require_owner.verifyProof;
29
+ exports.verifyPortableObjectProof = require_http.verifyPortableObjectProof;
30
+ exports.verifyProof = require_http.verifyProof;
31
31
  exports.verifyRequest = require_http.verifyRequest;
32
32
  exports.verifyRequestDetailed = require_http.verifyRequestDetailed;
33
- exports.verifySignature = require_owner.verifySignature;
33
+ exports.verifySignature = require_http.verifySignature;
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-CP-7OdSq.cjs";
2
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-xlG-jRdB.cjs";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BF0L9cMt.cjs";
4
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-pLbeNwcC.cjs";
4
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-HDSvS-ww.cjs";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-65PYi9jY.js";
2
+ import { C as exportJwk, D as importJwk, E as generateCryptoKeyPair, S as KeyCache, T as fetchKeyDetailed, _ as validateAcceptSignature, a as VerifyRequestDetailedResult, b as FetchKeyOptions, c as signRequest, d as AcceptSignatureMember, f as AcceptSignatureParameters, g as parseAcceptSignature, h as fulfillAcceptSignature, i as SignRequestOptions, l as verifyRequest, m as formatAcceptSignature, n as HttpMessageSignaturesSpecDeterminer, o as VerifyRequestFailureReason, p as FulfillAcceptSignatureResult, r as Rfc9421SignRequestOptions, s as VerifyRequestOptions, t as HttpMessageSignaturesSpec, u as verifyRequestDetailed, v as FetchKeyDetailedResult, w as fetchKey, x as FetchKeyResult, y as FetchKeyErrorResult } from "../http-n2v6DPxu.js";
3
3
  import { i as getKeyOwner, n as GetKeyOwnerOptions, r as doesActorOwnKey, t as DoesActorOwnKeyOptions } from "../owner-BSzr5-I8.js";
4
- import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-Dhm7SqyE.js";
4
+ import { C as createSignature, D as verifyJsonLd, E as signJsonLd, O as verifySignature, S as attachSignature, T as hasSignatureLike, _ as verifyProof, a as CreateProofOptions, b as VerifyJsonLdOptions, c as VerifyPortableObjectProofFailureReason, d as VerifyProofOptions, f as createProof, g as verifyPortableObjectProof, h as verifyObject, i as verifyPortableObject, l as VerifyPortableObjectProofOptions, m as signObject, n as VerifyPortableObjectOptions, o as SignObjectOptions, p as hasProofLike, r as VerifyPortableObjectResult, s as VerifyObjectOptions, t as VerifyPortableObjectFailureReason, u as VerifyPortableObjectProofResult, v as CreateSignatureOptions, w as detachSignature, x as VerifySignatureOptions, y as SignJsonLdOptions } from "../mod-C9WSpZWm.js";
5
5
  export { AcceptSignatureMember, AcceptSignatureParameters, CreateProofOptions, CreateSignatureOptions, DoesActorOwnKeyOptions, FetchKeyDetailedResult, FetchKeyErrorResult, FetchKeyOptions, FetchKeyResult, FulfillAcceptSignatureResult, GetKeyOwnerOptions, HttpMessageSignaturesSpec, HttpMessageSignaturesSpecDeterminer, KeyCache, Rfc9421SignRequestOptions, SignJsonLdOptions, SignObjectOptions, SignRequestOptions, VerifyJsonLdOptions, VerifyObjectOptions, VerifyPortableObjectFailureReason, VerifyPortableObjectOptions, VerifyPortableObjectProofFailureReason, VerifyPortableObjectProofOptions, VerifyPortableObjectProofResult, VerifyPortableObjectResult, VerifyProofOptions, VerifyRequestDetailedResult, VerifyRequestFailureReason, VerifyRequestOptions, VerifySignatureOptions, attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };
package/dist/sig/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Temporal } from "temporal-polyfill";
2
2
  import { URLPattern } from "urlpattern-polyfill";
3
- import { F as validateAcceptSignature, M as formatAcceptSignature, N as fulfillAcceptSignature, P as parseAcceptSignature, a as verifyRequestDetailed, c as fetchKey, d as importJwk, i as verifyRequest, l as fetchKeyDetailed, o as exportJwk, r as signRequest, u as generateCryptoKeyPair } from "../http-z5n7chWw.js";
4
- import { C as signJsonLd, E as verifySignature, T as verifyJsonLd, _ as detachSignature, a as signObject, b as hasSignatureLike, c as verifyPortableObjectProof, d as verifyProof, g as createSignature, i as hasProofLike, m as attachSignature, n as getKeyOwner, r as createProof, s as verifyObject, t as doesActorOwnKey } from "../owner-BLBWXCNt.js";
5
- import { t as verifyPortableObject } from "../sig-Bb20Pyrd.js";
3
+ import { A as verifySignature, D as signJsonLd, F as fetchKeyDetailed, I as generateCryptoKeyPair, L as importJwk, M as exportJwk, P as fetchKey, a as verifyRequestDetailed, b as createSignature, c as hasProofLike, d as verifyObject, dt as fulfillAcceptSignature, f as verifyPortableObjectProof, ft as parseAcceptSignature, h as verifyProof, i as verifyRequest, k as verifyJsonLd, l as signObject, pt as validateAcceptSignature, r as signRequest, s as createProof, ut as formatAcceptSignature, v as attachSignature, w as hasSignatureLike, x as detachSignature } from "../http-vfTpzGEq.js";
4
+ import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-DfGz0cXm.js";
5
+ import { t as verifyPortableObject } from "../sig-Cs9_ecdh.js";
6
6
  export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, fetchKeyDetailed, formatAcceptSignature, fulfillAcceptSignature, generateCryptoKeyPair, getKeyOwner, hasProofLike, hasSignatureLike, importJwk, parseAcceptSignature, signJsonLd, signObject, signRequest, validateAcceptSignature, verifyJsonLd, verifyObject, verifyPortableObject, verifyPortableObjectProof, verifyProof, verifyRequest, verifyRequestDetailed, verifySignature };