@fedify/fedify 2.0.36-dev.2760 → 2.0.36-dev.2828
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/attachment-arrays-D43igPLB.mjs +111 -0
- package/dist/{builder-CyuiJaas.mjs → builder-NquOFkEx.mjs} +3 -3
- package/dist/compat/attachment-arrays.test.d.mts +2 -0
- package/dist/compat/attachment-arrays.test.mjs +254 -0
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{deno-Bbso5CSl.mjs → deno-uX5OxSMQ.mjs} +1 -1
- package/dist/{docloader-CP5VuWA0.mjs → docloader-BVio_R-w.mjs} +2 -2
- package/dist/federation/attachment-responses.test.d.mts +2 -0
- package/dist/federation/attachment-responses.test.mjs +182 -0
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/collection.test.mjs +1 -1
- package/dist/federation/delivery-attachments.test.d.mts +2 -0
- package/dist/federation/delivery-attachments.test.mjs +280 -0
- package/dist/federation/handler.test.mjs +6 -6
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/keycache.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +7 -7
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.js +1 -1
- package/dist/federation/negotiation.test.mjs +1 -1
- package/dist/federation/retry.test.mjs +1 -1
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{http-DBBUPm9V.cjs → http-Bp6bXNxO.cjs} +1 -1
- package/dist/{http-Cp7sQLeG.mjs → http-Cx49vN9O.mjs} +2 -2
- package/dist/{http-D03Qcwc-.js → http-DaxiTQXs.js} +1 -1
- package/dist/{inbox-DTuh59nR.mjs → inbox-Rw21yNrv.mjs} +1 -1
- package/dist/{key-CsY0Ifod.mjs → key-CxZXo3sZ.mjs} +1 -1
- package/dist/{kv-cache-CVxDhqGp.js → kv-cache-BEYK4z_E.js} +1 -1
- package/dist/{kv-cache-BpjVni_0.cjs → kv-cache-BjsvCInD.cjs} +1 -1
- package/dist/{ld-dYjiHKj1.mjs → ld-DTaV6DUm.mjs} +2 -2
- package/dist/{middleware-DFR4tBL2.js → middleware-Bnn9AKMf.js} +259 -32
- package/dist/{middleware-3x7W0auZ.mjs → middleware-BuQURchh.mjs} +170 -45
- package/dist/{middleware-5EN1mHvx.cjs → middleware-By3uBhIJ.cjs} +260 -32
- package/dist/{middleware-2zkNwQvz.cjs → middleware-ByAekFky.cjs} +1 -1
- package/dist/{middleware-DvCyN-xk.mjs → middleware-Cz87lzGU.mjs} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/types.test.mjs +1 -1
- package/dist/{owner-A1Xol6Zh.mjs → owner-CEFC5tVI.mjs} +2 -2
- package/dist/{proof-CCZCT2xF.cjs → proof-Bl3zk5c6.cjs} +3 -3
- package/dist/{proof-DGOXBmlo.js → proof-Ct8tSLww.js} +2 -2
- package/dist/{proof-DCqYLXDl.mjs → proof-DFrHHTit.mjs} +2 -2
- package/dist/{send-yQno-6bP.mjs → send-Dn11B6x2.mjs} +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key-types.test.d.mts +1 -1
- package/dist/sig/key.test.mjs +2 -2
- package/dist/sig/ld.test.mjs +2 -2
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/proof.test.mjs +2 -2
- package/dist/{temporal-C26UV3h7.mjs → temporal-DEWMgahT.mjs} +1 -1
- package/dist/testing/mod.d.mts +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +5 -5
- /package/dist/{callback-BFMEE_9V.d.mts → callback-ySj5p3Ml.d.mts} +0 -0
- /package/dist/{collection-ChgDTHLz.mjs → collection-BD6-SZ6O.mjs} +0 -0
- /package/dist/{keycache-crDMn2HK.mjs → keycache-BhLorx33.mjs} +0 -0
- /package/dist/{negotiation-BehA2uul.mjs → negotiation-DnsfFF8I.mjs} +0 -0
- /package/dist/{retry-B_E3V_Dx.mjs → retry-CJL0poaU.mjs} +0 -0
- /package/dist/{types-C37hquWI.mjs → types-DCP0WLdt.mjs} +0 -0
|
@@ -2,10 +2,10 @@ const { Temporal } = require("@js-temporal/polyfill");
|
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
4
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
5
|
-
const require_http = require("./http-
|
|
5
|
+
const require_http = require("./http-Bp6bXNxO.cjs");
|
|
6
6
|
const require_types = require("./types-DOvyymM4.cjs");
|
|
7
|
-
const require_proof = require("./proof-
|
|
8
|
-
const require_kv_cache = require("./kv-cache-
|
|
7
|
+
const require_proof = require("./proof-Bl3zk5c6.cjs");
|
|
8
|
+
const require_kv_cache = require("./kv-cache-BjsvCInD.cjs");
|
|
9
9
|
let _logtape_logtape = require("@logtape/logtape");
|
|
10
10
|
let _fedify_vocab = require("@fedify/vocab");
|
|
11
11
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -14,10 +14,12 @@ let uri_template_router = require("uri-template-router");
|
|
|
14
14
|
let url_template = require("url-template");
|
|
15
15
|
let byte_encodings_hex = require("byte-encodings/hex");
|
|
16
16
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
17
|
-
let _fedify_vocab_runtime_internal = require("@fedify/vocab-runtime/internal");
|
|
18
|
-
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
19
17
|
let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
|
|
20
18
|
_fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld);
|
|
19
|
+
let _fedify_vocab_runtime_internal = require("@fedify/vocab-runtime/internal");
|
|
20
|
+
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
21
|
+
let json_canon = require("json-canon");
|
|
22
|
+
json_canon = require_chunk.__toESM(json_canon);
|
|
21
23
|
let _fedify_vocab_runtime_temporal = require("@fedify/vocab-runtime/temporal");
|
|
22
24
|
let _fedify_webfinger = require("@fedify/webfinger");
|
|
23
25
|
let node_url = require("node:url");
|
|
@@ -351,7 +353,7 @@ var FederationBuilderImpl = class {
|
|
|
351
353
|
this.collectionTypeIds = {};
|
|
352
354
|
}
|
|
353
355
|
async build(options) {
|
|
354
|
-
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-
|
|
356
|
+
const { FederationImpl } = await Promise.resolve().then(() => require("./middleware-ByAekFky.cjs"));
|
|
355
357
|
const f = new FederationImpl(options);
|
|
356
358
|
const trailingSlashInsensitiveValue = f.router.trailingSlashInsensitive;
|
|
357
359
|
f.router = this.router.clone();
|
|
@@ -878,6 +880,110 @@ async function buildCollectionSynchronizationHeader(collectionId, actorIds) {
|
|
|
878
880
|
return `collectionId="${collectionId}", url="${url}", digest="${(0, byte_encodings_hex.encodeHex)(await digest(actorIds))}"`;
|
|
879
881
|
}
|
|
880
882
|
//#endregion
|
|
883
|
+
//#region src/compat/attachment-arrays.ts
|
|
884
|
+
const logger$1 = (0, _logtape_logtape.getLogger)([
|
|
885
|
+
"fedify",
|
|
886
|
+
"compat",
|
|
887
|
+
"attachment-arrays"
|
|
888
|
+
]);
|
|
889
|
+
const MAX_DEPTH = 64;
|
|
890
|
+
const ATTACHMENT = "https://www.w3.org/ns/activitystreams#attachment";
|
|
891
|
+
const PROOF = "https://w3id.org/security#proof";
|
|
892
|
+
/** Recognizes JSON-LD maps without accepting arrays or scalar values. */
|
|
893
|
+
function isMap(value) {
|
|
894
|
+
return typeof value === "object" && value != null && !Array.isArray(value);
|
|
895
|
+
}
|
|
896
|
+
/** Copies only changed branches; cached vocabulary JSON belongs to its owner. */
|
|
897
|
+
function walk(value, depth = 0) {
|
|
898
|
+
if (depth >= MAX_DEPTH) throw new RangeError("JSON-LD nesting limit exceeded.");
|
|
899
|
+
if (Array.isArray(value)) {
|
|
900
|
+
const items = value.map((item) => walk(item, depth + 1));
|
|
901
|
+
return items.some((item, i) => item !== value[i]) ? items : value;
|
|
902
|
+
}
|
|
903
|
+
if (!isMap(value)) return value;
|
|
904
|
+
if (Object.hasOwn(value, "@value")) return value;
|
|
905
|
+
let result;
|
|
906
|
+
for (const [key, item] of Object.entries(value)) {
|
|
907
|
+
let next = key === "@context" ? item : walk(item, depth + 1);
|
|
908
|
+
if ((key === "attachment" || key === ATTACHMENT) && next != null && !Array.isArray(next) && !(isMap(next) && Object.hasOwn(next, "@list"))) next = [next];
|
|
909
|
+
if (next !== item) {
|
|
910
|
+
result ??= Object.assign(Object.create(null), value);
|
|
911
|
+
result[key] = next;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
return result ?? value;
|
|
915
|
+
}
|
|
916
|
+
const preloadedLoader = (url) => {
|
|
917
|
+
if (!Object.hasOwn(_fedify_vocab_runtime.preloadedContexts, url)) return Promise.reject(/* @__PURE__ */ new Error("Unknown JSON-LD context: " + url));
|
|
918
|
+
return Promise.resolve({
|
|
919
|
+
contextUrl: null,
|
|
920
|
+
documentUrl: url,
|
|
921
|
+
document: _fedify_vocab_runtime.preloadedContexts[url]
|
|
922
|
+
});
|
|
923
|
+
};
|
|
924
|
+
/** Reuses each context resolution across the complete equivalence check. */
|
|
925
|
+
function memoizeLoader(loader) {
|
|
926
|
+
const pending = /* @__PURE__ */ new Map();
|
|
927
|
+
return (url, options) => {
|
|
928
|
+
let result = pending.get(url);
|
|
929
|
+
if (result == null) {
|
|
930
|
+
result = loader(url, options);
|
|
931
|
+
pending.set(url, result);
|
|
932
|
+
}
|
|
933
|
+
return result;
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
/** Finds security predicates in expanded nodes, never inside JSON literals. */
|
|
937
|
+
function hasSecurityPredicate(value) {
|
|
938
|
+
if (Array.isArray(value)) return value.some(hasSecurityPredicate);
|
|
939
|
+
if (!isMap(value) || Object.hasOwn(value, "@value")) return false;
|
|
940
|
+
for (const [key, child] of Object.entries(value)) {
|
|
941
|
+
if (key === PROOF || key === "https://w3id.org/security#signature") return true;
|
|
942
|
+
if (hasSecurityPredicate(child)) return true;
|
|
943
|
+
}
|
|
944
|
+
return false;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Keeps singleton attachments in arrays for raw-JSON ActivityPub consumers.
|
|
948
|
+
* Mastodon's property_values() ignores valid compact JSON-LD scalar values,
|
|
949
|
+
* and its caller clears the profile fields in that case:
|
|
950
|
+
* https://github.com/mastodon/mastodon/blob/594166519a623584920c7e696bae9a009d9183ab/app/services/activitypub/process_account_service.rb#L465-L472
|
|
951
|
+
* Pixelfed likewise rejects singleton media attachments:
|
|
952
|
+
* https://github.com/pixelfed/pixelfed/issues/6588
|
|
953
|
+
*
|
|
954
|
+
* This workaround changes only attachment representation, after serialization.
|
|
955
|
+
* RDF equality protects custom contexts, including JSON literals; it does not
|
|
956
|
+
* protect JCS signatures. Any semantic proof or Linked Data signature leaves
|
|
957
|
+
* the whole serialized document unchanged, as does an unresolved context.
|
|
958
|
+
* This layer does not compose signed objects or repair vocabulary serialization.
|
|
959
|
+
* Remove this
|
|
960
|
+
* workaround only when the supported consumer versions, including deployed
|
|
961
|
+
* older releases, accept scalar attachments. Do not replace it with a
|
|
962
|
+
* vocabulary transformer: subsequent compaction collapses arrays.
|
|
963
|
+
* @internal
|
|
964
|
+
*/
|
|
965
|
+
async function normalizeAttachmentArrays(document, contextLoader) {
|
|
966
|
+
try {
|
|
967
|
+
const normalized = walk(document);
|
|
968
|
+
if (normalized === document) return document;
|
|
969
|
+
const loader = memoizeLoader(contextLoader ?? preloadedLoader);
|
|
970
|
+
if (hasSecurityPredicate(await _fedify_vocab_runtime_jsonld.default.expand(document, { documentLoader: loader }))) return document;
|
|
971
|
+
const [before, after] = await Promise.allSettled([_fedify_vocab_runtime_jsonld.default.canonize(document, {
|
|
972
|
+
format: "application/n-quads",
|
|
973
|
+
documentLoader: loader
|
|
974
|
+
}), _fedify_vocab_runtime_jsonld.default.canonize(normalized, {
|
|
975
|
+
format: "application/n-quads",
|
|
976
|
+
documentLoader: loader
|
|
977
|
+
})]);
|
|
978
|
+
if (before.status === "rejected") throw before.reason;
|
|
979
|
+
if (after.status === "rejected") throw after.reason;
|
|
980
|
+
if (before.value === after.value) return normalized;
|
|
981
|
+
} catch (error) {
|
|
982
|
+
logger$1.debug("Could not safely normalize attachment arrays; preserving the document: {error}", { error });
|
|
983
|
+
}
|
|
984
|
+
return document;
|
|
985
|
+
}
|
|
986
|
+
//#endregion
|
|
881
987
|
//#region src/federation/keycache.ts
|
|
882
988
|
const NULL_KEY_CACHE_VALUE = { _fedify: "key-unavailable" };
|
|
883
989
|
const NULL_KEY_CACHE_TTL = Temporal.Duration.from({ minutes: 5 });
|
|
@@ -1136,7 +1242,7 @@ async function handleActor(request, { identifier, context, actorDispatcher, auth
|
|
|
1136
1242
|
if (authorizePredicate != null) {
|
|
1137
1243
|
if (!await authorizePredicate(context, identifier)) return await onUnauthorized(request);
|
|
1138
1244
|
}
|
|
1139
|
-
const jsonLd = await actor
|
|
1245
|
+
const jsonLd = await serializeForResponse(actor, context);
|
|
1140
1246
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
1141
1247
|
"Content-Type": "application/activity+json",
|
|
1142
1248
|
Vary: "Accept"
|
|
@@ -1156,7 +1262,7 @@ async function handleObject(request, { values, context, objectDispatcher, author
|
|
|
1156
1262
|
if (authorizePredicate != null) {
|
|
1157
1263
|
if (!await authorizePredicate(context, values)) return await onUnauthorized(request);
|
|
1158
1264
|
}
|
|
1159
|
-
const jsonLd = await object
|
|
1265
|
+
const jsonLd = await serializeForResponse(object, context);
|
|
1160
1266
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
1161
1267
|
"Content-Type": "application/activity+json",
|
|
1162
1268
|
Vary: "Accept"
|
|
@@ -1287,7 +1393,7 @@ async function handleCollection(request, { name: name$1, identifier, uriGetter,
|
|
|
1287
1393
|
if (collectionCallbacks.authorizePredicate != null) {
|
|
1288
1394
|
if (!await collectionCallbacks.authorizePredicate(context, identifier)) return await onUnauthorized(request);
|
|
1289
1395
|
}
|
|
1290
|
-
const jsonLd = await collection
|
|
1396
|
+
const jsonLd = await serializeForResponse(collection, context);
|
|
1291
1397
|
return new Response(JSON.stringify(jsonLd), { headers: {
|
|
1292
1398
|
"Content-Type": "application/activity+json",
|
|
1293
1399
|
Vary: "Accept"
|
|
@@ -1847,7 +1953,7 @@ var CustomCollectionHandler = class {
|
|
|
1847
1953
|
* @returns A promise that resolves to the JSON-LD representation.
|
|
1848
1954
|
*/
|
|
1849
1955
|
async toJsonLd() {
|
|
1850
|
-
return (await this.collection
|
|
1956
|
+
return serializeForResponse(await this.collection, this.context);
|
|
1851
1957
|
}
|
|
1852
1958
|
/**
|
|
1853
1959
|
* Fetches the collection with optional cursor for pagination.
|
|
@@ -2150,7 +2256,7 @@ var UnauthorizedError = class extends HandlerError {
|
|
|
2150
2256
|
* @since 0.3.0
|
|
2151
2257
|
*/
|
|
2152
2258
|
async function respondWithObject(object, options) {
|
|
2153
|
-
const jsonLd = await object
|
|
2259
|
+
const jsonLd = await serializeForResponse(object, options);
|
|
2154
2260
|
return new Response(JSON.stringify(jsonLd), { headers: { "Content-Type": "application/activity+json" } });
|
|
2155
2261
|
}
|
|
2156
2262
|
/**
|
|
@@ -2168,6 +2274,106 @@ async function respondWithObjectIfAcceptable(object, request, options) {
|
|
|
2168
2274
|
response.headers.set("Vary", "Accept");
|
|
2169
2275
|
return response;
|
|
2170
2276
|
}
|
|
2277
|
+
/** Applies compatibility changes only after ordinary vocabulary serialization. */
|
|
2278
|
+
async function serializeForResponse(object, options) {
|
|
2279
|
+
return await normalizeAttachmentArrays(await object.toJsonLd(options), options?.contextLoader);
|
|
2280
|
+
}
|
|
2281
|
+
//#endregion
|
|
2282
|
+
//#region src/sig/proof-creation.ts
|
|
2283
|
+
/** Signs the exact serialized message supplied by an internal producer. */
|
|
2284
|
+
async function createProofForJsonLd(jsonLd, privateKey, keyId, created) {
|
|
2285
|
+
require_http.validateCryptoKey(privateKey, "private");
|
|
2286
|
+
if (privateKey.algorithm.name !== "Ed25519") throw new TypeError("Unsupported algorithm: " + privateKey.algorithm.name);
|
|
2287
|
+
const encoder = new TextEncoder();
|
|
2288
|
+
const msgDigest = await crypto.subtle.digest("SHA-256", encoder.encode((0, json_canon.default)(jsonLd)));
|
|
2289
|
+
created ??= Temporal.Now.instant();
|
|
2290
|
+
const proofConfig = {
|
|
2291
|
+
"@context": jsonLd["@context"],
|
|
2292
|
+
type: "DataIntegrityProof",
|
|
2293
|
+
cryptosuite: "eddsa-jcs-2022",
|
|
2294
|
+
verificationMethod: keyId.href,
|
|
2295
|
+
proofPurpose: "assertionMethod",
|
|
2296
|
+
created: created.toString()
|
|
2297
|
+
};
|
|
2298
|
+
const proofDigest = await crypto.subtle.digest("SHA-256", encoder.encode((0, json_canon.default)(proofConfig)));
|
|
2299
|
+
const digest = new Uint8Array(proofDigest.byteLength + msgDigest.byteLength);
|
|
2300
|
+
digest.set(new Uint8Array(proofDigest), 0);
|
|
2301
|
+
digest.set(new Uint8Array(msgDigest), proofDigest.byteLength);
|
|
2302
|
+
const sig = await crypto.subtle.sign("Ed25519", (0, _fedify_vocab_runtime_internal.asCryptoKey)(privateKey), digest);
|
|
2303
|
+
return new _fedify_vocab.DataIntegrityProof({
|
|
2304
|
+
cryptosuite: "eddsa-jcs-2022",
|
|
2305
|
+
verificationMethod: keyId,
|
|
2306
|
+
proofPurpose: "assertionMethod",
|
|
2307
|
+
created,
|
|
2308
|
+
proofValue: new Uint8Array(sig)
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
//#endregion
|
|
2312
|
+
//#region src/compat/delivery-jsonld.ts
|
|
2313
|
+
/**
|
|
2314
|
+
* Returns changed attachment JSON only; unchanged documents keep the existing
|
|
2315
|
+
* delivery signing path. This uses ordinary vocabulary serialization, without
|
|
2316
|
+
* retaining or repairing independently signed child representations.
|
|
2317
|
+
*/
|
|
2318
|
+
async function prepareActivityJsonLd(activity, contextLoader) {
|
|
2319
|
+
if (activity.proofIds.length > 0) return void 0;
|
|
2320
|
+
for await (const _ of activity.getProofs({ contextLoader })) return void 0;
|
|
2321
|
+
const source = await activity.clone().toJsonLd({
|
|
2322
|
+
format: "compact",
|
|
2323
|
+
contextLoader
|
|
2324
|
+
});
|
|
2325
|
+
const prepared = await normalizeAttachmentArrays(source, contextLoader);
|
|
2326
|
+
return prepared !== source && typeof prepared === "object" && prepared != null && !Array.isArray(prepared) ? prepared : void 0;
|
|
2327
|
+
}
|
|
2328
|
+
/** Signs a changed, proof-free delivery map without serializing it again. */
|
|
2329
|
+
async function signActivityJsonLd(activity, unsigned, keys, options) {
|
|
2330
|
+
const proofs = [];
|
|
2331
|
+
const serializedProofs = [];
|
|
2332
|
+
const tracer = (options.tracerProvider ?? _opentelemetry_api.trace.getTracerProvider()).getTracer(require_http.name, require_http.version);
|
|
2333
|
+
for (const { privateKey, keyId } of keys) {
|
|
2334
|
+
const proof = await tracer.startActiveSpan("object_integrity_proofs.sign", { attributes: { "activitypub.object.type": (0, _fedify_vocab.getTypeId)(activity).href } }, async (span) => {
|
|
2335
|
+
try {
|
|
2336
|
+
if (activity.id != null) span.setAttribute("activitypub.object.id", activity.id.href);
|
|
2337
|
+
const proof = await createProofForJsonLd(unsigned, privateKey, keyId);
|
|
2338
|
+
if (span.isRecording()) {
|
|
2339
|
+
span.setAttribute("object_integrity_proofs.cryptosuite", "eddsa-jcs-2022");
|
|
2340
|
+
span.setAttribute("object_integrity_proofs.key_id", keyId.href);
|
|
2341
|
+
span.setAttribute("object_integrity_proofs.signature", (0, byte_encodings_hex.encodeHex)(proof.proofValue));
|
|
2342
|
+
}
|
|
2343
|
+
return proof;
|
|
2344
|
+
} catch (error) {
|
|
2345
|
+
span.setStatus({
|
|
2346
|
+
code: _opentelemetry_api.SpanStatusCode.ERROR,
|
|
2347
|
+
message: String(error)
|
|
2348
|
+
});
|
|
2349
|
+
throw error;
|
|
2350
|
+
} finally {
|
|
2351
|
+
span.end();
|
|
2352
|
+
}
|
|
2353
|
+
});
|
|
2354
|
+
proofs.push(proof);
|
|
2355
|
+
serializedProofs.push({
|
|
2356
|
+
"@context": unsigned["@context"],
|
|
2357
|
+
type: "DataIntegrityProof",
|
|
2358
|
+
cryptosuite: proof.cryptosuite,
|
|
2359
|
+
verificationMethod: keyId.href,
|
|
2360
|
+
proofPurpose: "assertionMethod",
|
|
2361
|
+
created: proof.created.toString(),
|
|
2362
|
+
proofValue: new TextDecoder().decode((0, _fedify_vocab_runtime.encodeMultibase)("base58btc", proof.proofValue))
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
if (proofs.length === 0) return {
|
|
2366
|
+
activity,
|
|
2367
|
+
jsonLd: unsigned
|
|
2368
|
+
};
|
|
2369
|
+
return {
|
|
2370
|
+
activity: activity.clone({ proofs }),
|
|
2371
|
+
jsonLd: {
|
|
2372
|
+
...unsigned,
|
|
2373
|
+
proof: serializedProofs.length === 1 ? serializedProofs[0] : serializedProofs
|
|
2374
|
+
}
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2171
2377
|
//#endregion
|
|
2172
2378
|
//#region src/nodeinfo/handler.ts
|
|
2173
2379
|
/**
|
|
@@ -3434,19 +3640,29 @@ var FederationImpl = class extends FederationBuilderImpl {
|
|
|
3434
3640
|
proofCreated = true;
|
|
3435
3641
|
break;
|
|
3436
3642
|
}
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3643
|
+
const prepared = !proofCreated && options.activityJsonLd == null ? await prepareActivityJsonLd(activity, contextLoader) : void 0;
|
|
3644
|
+
let jsonLd;
|
|
3645
|
+
if (prepared != null) {
|
|
3646
|
+
const signingKeys = keys.filter(({ privateKey }) => privateKey.algorithm.name === "Ed25519");
|
|
3647
|
+
const signed = await signActivityJsonLd(activity, prepared, signingKeys, { tracerProvider: this.tracerProvider });
|
|
3648
|
+
activity = signed.activity;
|
|
3649
|
+
jsonLd = signed.jsonLd;
|
|
3650
|
+
proofCreated = signingKeys.length > 0;
|
|
3651
|
+
} else {
|
|
3652
|
+
if (!proofCreated) {
|
|
3653
|
+
for (const { keyId, privateKey } of keys) if (privateKey.algorithm.name === "Ed25519") {
|
|
3654
|
+
activity = await require_proof.signObject(activity, privateKey, keyId, {
|
|
3655
|
+
contextLoader,
|
|
3656
|
+
tracerProvider: this.tracerProvider
|
|
3657
|
+
});
|
|
3658
|
+
proofCreated = true;
|
|
3659
|
+
}
|
|
3444
3660
|
}
|
|
3661
|
+
jsonLd = options.activityJsonLd != null ? require_proof.detachSignature(options.activityJsonLd) : await activity.toJsonLd({
|
|
3662
|
+
format: "compact",
|
|
3663
|
+
contextLoader
|
|
3664
|
+
});
|
|
3445
3665
|
}
|
|
3446
|
-
let jsonLd = options.activityJsonLd != null ? require_proof.detachSignature(options.activityJsonLd) : await activity.toJsonLd({
|
|
3447
|
-
format: "compact",
|
|
3448
|
-
contextLoader
|
|
3449
|
-
});
|
|
3450
3666
|
if (rsaKey == null) logger.warn("No supported key found to create a Linked Data signature for the activity {activityId}. The activity will be sent without a Linked Data signature. In order to create a Linked Data signature, at least one RSASSA-PKCS1-v1_5 key must be provided.", {
|
|
3451
3667
|
activityId,
|
|
3452
3668
|
keys: keys.map((pair) => ({
|
|
@@ -4285,19 +4501,31 @@ var ContextImpl = class ContextImpl {
|
|
|
4285
4501
|
}
|
|
4286
4502
|
if (actorKeyPairs != null) {
|
|
4287
4503
|
const contextLoader = this.contextLoader;
|
|
4288
|
-
|
|
4504
|
+
const willSign = actorKeyPairs.some((kp) => kp.privateKey.algorithm.name === "Ed25519" && kp.multikey.id != null);
|
|
4505
|
+
if (willSign) {
|
|
4289
4506
|
if (activityJsonLd != null && !contextMatches) activity = activity.clone({ proofs: [] });
|
|
4290
4507
|
}
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
});
|
|
4298
|
-
|
|
4508
|
+
const prepared = willSign ? await prepareActivityJsonLd(activity, contextLoader) : void 0;
|
|
4509
|
+
if (prepared != null) {
|
|
4510
|
+
const signingKeys = actorKeyPairs.flatMap((kp) => kp.privateKey.algorithm.name === "Ed25519" && kp.multikey.id != null ? [{
|
|
4511
|
+
privateKey: kp.privateKey,
|
|
4512
|
+
keyId: kp.multikey.id
|
|
4513
|
+
}] : []);
|
|
4514
|
+
const signed = await signActivityJsonLd(activity, prepared, signingKeys, { tracerProvider: this.tracerProvider });
|
|
4515
|
+
activity = signed.activity;
|
|
4516
|
+
activityJsonLd = signed.jsonLd;
|
|
4517
|
+
} else {
|
|
4518
|
+
let proofAdded = false;
|
|
4519
|
+
for (const kp of actorKeyPairs) {
|
|
4520
|
+
if (kp.privateKey.algorithm.name !== "Ed25519" || kp.multikey.id == null) continue;
|
|
4521
|
+
activity = await require_proof.signObject(activity, kp.privateKey, kp.multikey.id, {
|
|
4522
|
+
contextLoader,
|
|
4523
|
+
tracerProvider: this.tracerProvider
|
|
4524
|
+
});
|
|
4525
|
+
proofAdded = true;
|
|
4526
|
+
}
|
|
4527
|
+
if (proofAdded) activityJsonLd = void 0;
|
|
4299
4528
|
}
|
|
4300
|
-
if (proofAdded) activityJsonLd = void 0;
|
|
4301
4529
|
}
|
|
4302
4530
|
const opts = {
|
|
4303
4531
|
context: this,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
|
-
const require_middleware = require("./middleware-
|
|
3
|
+
const require_middleware = require("./middleware-By3uBhIJ.cjs");
|
|
4
4
|
exports.FederationImpl = require_middleware.FederationImpl;
|
package/dist/mod.cjs
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
4
4
|
require("./chunk-DDcVe30Y.cjs");
|
|
5
5
|
const require_transformers = require("./transformers-NeAONrAq.cjs");
|
|
6
6
|
require("./compat/mod.cjs");
|
|
7
|
-
const require_http = require("./http-
|
|
8
|
-
const require_middleware = require("./middleware-
|
|
7
|
+
const require_http = require("./http-Bp6bXNxO.cjs");
|
|
8
|
+
const require_middleware = require("./middleware-By3uBhIJ.cjs");
|
|
9
9
|
const require_types = require("./types-DOvyymM4.cjs");
|
|
10
|
-
const require_proof = require("./proof-
|
|
11
|
-
const require_kv_cache = require("./kv-cache-
|
|
10
|
+
const require_proof = require("./proof-Bl3zk5c6.cjs");
|
|
11
|
+
const require_kv_cache = require("./kv-cache-BjsvCInD.cjs");
|
|
12
12
|
const require_federation_mod = require("./federation/mod.cjs");
|
|
13
13
|
require("./nodeinfo/mod.cjs");
|
|
14
14
|
require("./runtime/mod.cjs");
|
package/dist/mod.js
CHANGED
|
@@ -3,11 +3,11 @@ import { URLPattern } from "urlpattern-polyfill";
|
|
|
3
3
|
import "./chunk-CRNNMoPX.js";
|
|
4
4
|
import { n as autoIdAssigner, r as getDefaultActivityTransformers, t as actorDehydrator } from "./transformers-BGMIq1cs.js";
|
|
5
5
|
import "./compat/mod.js";
|
|
6
|
-
import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "./http-
|
|
7
|
-
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-
|
|
6
|
+
import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "./http-DaxiTQXs.js";
|
|
7
|
+
import { a as createExponentialBackoffPolicy, c as buildCollectionSynchronizationHeader, d as Router, f as RouterError, i as SendActivityError, l as digest, o as respondWithObject, r as handleWebFinger, s as respondWithObjectIfAcceptable, t as createFederation, u as createFederationBuilder } from "./middleware-Bnn9AKMf.js";
|
|
8
8
|
import { n as getNodeInfo, r as parseNodeInfo, t as nodeInfoToJson } from "./types-B1_pRFE_.js";
|
|
9
|
-
import { a as doesActorOwnKey, b as verifyJsonLd, d as createSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, p as detachSignature, r as verifyObject, t as createProof, v as signJsonLd, x as verifySignature } from "./proof-
|
|
10
|
-
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-
|
|
9
|
+
import { a as doesActorOwnKey, b as verifyJsonLd, d as createSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, p as detachSignature, r as verifyObject, t as createProof, v as signJsonLd, x as verifySignature } from "./proof-Ct8tSLww.js";
|
|
10
|
+
import { n as getAuthenticatedDocumentLoader, t as kvCache } from "./kv-cache-BEYK4z_E.js";
|
|
11
11
|
import { InProcessMessageQueue, MemoryKvStore, ParallelMessageQueue } from "./federation/mod.js";
|
|
12
12
|
import "./nodeinfo/mod.js";
|
|
13
13
|
import "./runtime/mod.js";
|
|
@@ -5,7 +5,7 @@ import { n as createRequestContext } from "../context-Juj6bdHC.mjs";
|
|
|
5
5
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
6
6
|
import "../std__assert-DflMZha5.mjs";
|
|
7
7
|
import { t as MemoryKvStore } from "../kv-BrZHNugx.mjs";
|
|
8
|
-
import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-
|
|
8
|
+
import { a as createFederation, h as handleNodeInfoJrd, m as handleNodeInfo } from "../middleware-BuQURchh.mjs";
|
|
9
9
|
import { test } from "@fedify/fixture";
|
|
10
10
|
//#region src/nodeinfo/handler.test.ts
|
|
11
11
|
test("handleNodeInfo()", async () => {
|
|
@@ -4,7 +4,7 @@ globalThis.addEventListener = () => {};
|
|
|
4
4
|
import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
5
5
|
import "../std__assert-DflMZha5.mjs";
|
|
6
6
|
import { t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
7
|
-
import { t as nodeInfoToJson } from "../types-
|
|
7
|
+
import { t as nodeInfoToJson } from "../types-DCP0WLdt.mjs";
|
|
8
8
|
import { test } from "@fedify/fixture";
|
|
9
9
|
//#region src/nodeinfo/types.test.ts
|
|
10
10
|
test("nodeInfoToJson()", () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { n as fetchActorDocument, s as verifyKeyOwnership, t as exportJwk } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
|
+
import { n as fetchActorDocument, s as verifyKeyOwnership, t as exportJwk } from "./key-CxZXo3sZ.mjs";
|
|
6
6
|
import { CryptographicKey, Object as Object$1, isActor } from "@fedify/vocab";
|
|
7
7
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { getDocumentLoader } from "@fedify/vocab-runtime";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
const require_chunk = require("./chunk-DDcVe30Y.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-Bp6bXNxO.cjs");
|
|
5
5
|
let _logtape_logtape = require("@logtape/logtape");
|
|
6
6
|
let _fedify_vocab = require("@fedify/vocab");
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
8
8
|
let byte_encodings_hex = require("byte-encodings/hex");
|
|
9
9
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
10
|
-
let _fedify_vocab_runtime_internal = require("@fedify/vocab-runtime/internal");
|
|
11
|
-
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
12
10
|
let _fedify_vocab_runtime_jsonld = require("@fedify/vocab-runtime/jsonld");
|
|
13
11
|
_fedify_vocab_runtime_jsonld = require_chunk.__toESM(_fedify_vocab_runtime_jsonld);
|
|
12
|
+
let _fedify_vocab_runtime_internal = require("@fedify/vocab-runtime/internal");
|
|
13
|
+
let byte_encodings_base64 = require("byte-encodings/base64");
|
|
14
14
|
let json_canon = require("json-canon");
|
|
15
15
|
json_canon = require_chunk.__toESM(json_canon);
|
|
16
16
|
//#region src/sig/ld.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as fetchActorDocument, d as name, f as version, i as exportJwk, l as validateCryptoKey, o as fetchKey, u as verifyKeyOwnership } from "./http-
|
|
3
|
+
import { a as fetchActorDocument, d as name, f as version, i as exportJwk, l as validateCryptoKey, o as fetchKey, u as verifyKeyOwnership } from "./http-DaxiTQXs.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { encodeHex } from "byte-encodings/hex";
|
|
8
8
|
import { getDocumentLoader, preloadedContexts } from "@fedify/vocab-runtime";
|
|
9
|
+
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
9
10
|
import { asCryptoKey } from "@fedify/vocab-runtime/internal";
|
|
10
11
|
import { decodeBase64, encodeBase64 } from "byte-encodings/base64";
|
|
11
|
-
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
12
12
|
import serialize from "json-canon";
|
|
13
13
|
//#region src/sig/ld.ts
|
|
14
14
|
const logger$2 = getLogger([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { o as validateCryptoKey, r as fetchKey } from "./key-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
|
+
import { o as validateCryptoKey, r as fetchKey } from "./key-CxZXo3sZ.mjs";
|
|
6
6
|
import { Activity, DataIntegrityProof, Multikey, getTypeId } from "@fedify/vocab";
|
|
7
7
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
8
8
|
import { asCryptoKey } from "@fedify/vocab-runtime/internal";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
5
|
-
import { r as doubleKnockScoped } from "./http-
|
|
4
|
+
import { n as version, t as name } from "./deno-uX5OxSMQ.mjs";
|
|
5
|
+
import { r as doubleKnockScoped } from "./http-Cx49vN9O.mjs";
|
|
6
6
|
import { SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
7
7
|
import { FetchError, UrlError } from "@fedify/vocab-runtime";
|
|
8
8
|
import { openDirectFetch, openPublicFetch } from "@fedify/vocab-runtime/internal";
|
package/dist/sig/http.test.mjs
CHANGED
|
@@ -7,8 +7,8 @@ import { i as assertExists, t as assertStringIncludes } from "../std__assert-Dfl
|
|
|
7
7
|
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
8
8
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
9
9
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
10
|
-
import { t as exportJwk } from "../key-
|
|
11
|
-
import { a as formatRfc9421SignatureParameters, c as signRequest, i as formatRfc9421Signature, l as timingSafeEqual, n as doubleKnock, o as parseRfc9421Signature, r as doubleKnockScoped, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as verifyRequest } from "../http-
|
|
10
|
+
import { t as exportJwk } from "../key-CxZXo3sZ.mjs";
|
|
11
|
+
import { a as formatRfc9421SignatureParameters, c as signRequest, i as formatRfc9421Signature, l as timingSafeEqual, n as doubleKnock, o as parseRfc9421Signature, r as doubleKnockScoped, s as parseRfc9421SignatureInput, t as createRfc9421SignatureBase, u as verifyRequest } from "../http-Cx49vN9O.mjs";
|
|
12
12
|
import { i as rsaPrivateKey2, l as rsaPublicKey5, o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
|
|
13
13
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
14
14
|
import { FetchError, exportSpki } from "@fedify/vocab-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { a as ActorCallbackSetters, c as SenderKeyPair, d as exportJwk, l as HttpMessageSignaturesSpecDeterminer, n as Context, r as InboxContext, s as InboxListenerSetters, t as ActorKeyPairsDispatcher, u as signRequest } from "../callback-
|
|
3
|
+
import { a as ActorCallbackSetters, c as SenderKeyPair, d as exportJwk, l as HttpMessageSignaturesSpecDeterminer, n as Context, r as InboxContext, s as InboxListenerSetters, t as ActorKeyPairsDispatcher, u as signRequest } from "../callback-ySj5p3Ml.mjs";
|
|
4
4
|
import { Activity, CryptographicKey, DataIntegrityProof, Multikey, Object as Object$1, Recipient } from "@fedify/vocab";
|
|
5
5
|
import { TracerProvider } from "@opentelemetry/api";
|
|
6
6
|
import { AuthenticatedDocumentLoaderFactory, CryptoKeyLike, CryptoKeyPairLike, DocumentLoader, DocumentLoaderFactoryOptions, exportMultibaseKey, exportSpki } from "@fedify/vocab-runtime";
|
package/dist/sig/key.test.mjs
CHANGED
|
@@ -6,9 +6,9 @@ import { n as assertStrictEquals } from "../std__assert-DflMZha5.mjs";
|
|
|
6
6
|
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
7
7
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
8
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
9
|
-
import { a as importJwk, i as generateCryptoKeyPair, o as validateCryptoKey, r as fetchKey, t as exportJwk } from "../key-
|
|
9
|
+
import { a as importJwk, i as generateCryptoKeyPair, o as validateCryptoKey, r as fetchKey, t as exportJwk } from "../key-CxZXo3sZ.mjs";
|
|
10
10
|
import { c as rsaPublicKey3, i as rsaPrivateKey2, o as rsaPublicKey1, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
11
|
-
import { v as wrapContextLoaderForJsonLd } from "../ld-
|
|
11
|
+
import { v as wrapContextLoaderForJsonLd } from "../ld-DTaV6DUm.mjs";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { CryptographicKey, Multikey, Person } from "@fedify/vocab";
|
|
14
14
|
import { FetchError, UrlError, getDocumentLoader } from "@fedify/vocab-runtime";
|
package/dist/sig/ld.test.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { t as assertEquals } from "../assert_equals-Ew3jOFa3.mjs";
|
|
|
5
5
|
import { r as assertFalse, t as assertThrows } from "../assert_throws-D4DNWrux.mjs";
|
|
6
6
|
import { n as assertInstanceOf, t as assert } from "../assert-BhQd8QHP.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
8
|
-
import { i as generateCryptoKeyPair } from "../key-
|
|
8
|
+
import { i as generateCryptoKeyPair } from "../key-CxZXo3sZ.mjs";
|
|
9
9
|
import { a as rsaPrivateKey3, c as rsaPublicKey3, i as rsaPrivateKey2, n as ed25519PrivateKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
10
|
-
import { _ as verifySignature, a as compactJsonLd, c as detachSignature, d as hasVerifiableSignature, g as verifyJsonLd, i as attachSignature, m as signJsonLd, n as UnsafeJsonLdError, o as createSignature, p as isInvalidUrlTypeError, s as describeSignatureShape, u as hasSignature } from "../ld-
|
|
10
|
+
import { _ as verifySignature, a as compactJsonLd, c as detachSignature, d as hasVerifiableSignature, g as verifyJsonLd, i as attachSignature, m as signJsonLd, n as UnsafeJsonLdError, o as createSignature, p as isInvalidUrlTypeError, s as describeSignatureShape, u as hasSignature } from "../ld-DTaV6DUm.mjs";
|
|
11
11
|
import { t as ldSignatureWithoutCreated } from "../ld-signature-_KYhPsqt.mjs";
|
|
12
12
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
13
13
|
import { Create, CryptographicKey, Note } from "@fedify/vocab";
|
package/dist/sig/mod.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { Temporal } = require("@js-temporal/polyfill");
|
|
2
2
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
|
-
const require_http = require("../http-
|
|
5
|
-
const require_proof = require("../proof-
|
|
4
|
+
const require_http = require("../http-Bp6bXNxO.cjs");
|
|
5
|
+
const require_proof = require("../proof-Bl3zk5c6.cjs");
|
|
6
6
|
exports.attachSignature = require_proof.attachSignature;
|
|
7
7
|
exports.createProof = require_proof.createProof;
|
|
8
8
|
exports.createSignature = require_proof.createSignature;
|
package/dist/sig/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "../http-
|
|
4
|
-
import { a as doesActorOwnKey, b as verifyJsonLd, d as createSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, p as detachSignature, r as verifyObject, t as createProof, v as signJsonLd, x as verifySignature } from "../proof-
|
|
3
|
+
import { c as importJwk, i as exportJwk, n as signRequest, o as fetchKey, r as verifyRequest, s as generateCryptoKeyPair } from "../http-DaxiTQXs.js";
|
|
4
|
+
import { a as doesActorOwnKey, b as verifyJsonLd, d as createSignature, i as verifyProof, l as attachSignature, n as signObject, o as getKeyOwner, p as detachSignature, r as verifyObject, t as createProof, v as signJsonLd, x as verifySignature } from "../proof-Ct8tSLww.js";
|
|
5
5
|
export { attachSignature, createProof, createSignature, detachSignature, doesActorOwnKey, exportJwk, fetchKey, generateCryptoKeyPair, getKeyOwner, importJwk, signJsonLd, signObject, signRequest, verifyJsonLd, verifyObject, verifyProof, verifyRequest, verifySignature };
|
package/dist/sig/owner.test.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import "../std__assert-DflMZha5.mjs";
|
|
|
6
6
|
import { r as assertFalse } from "../assert_throws-D4DNWrux.mjs";
|
|
7
7
|
import { t as assert } from "../assert-BhQd8QHP.mjs";
|
|
8
8
|
import { o as rsaPublicKey1, s as rsaPublicKey2 } from "../keys-CCxRJhWa.mjs";
|
|
9
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-
|
|
9
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "../owner-CEFC5tVI.mjs";
|
|
10
10
|
import { createTestTracerProvider, mockDocumentLoader, test } from "@fedify/fixture";
|
|
11
11
|
import { Create, CryptographicKey, lookupObject } from "@fedify/vocab";
|
|
12
12
|
//#region src/sig/owner.test.ts
|
package/dist/sig/proof.test.mjs
CHANGED
|
@@ -6,8 +6,8 @@ import "../std__assert-DflMZha5.mjs";
|
|
|
6
6
|
import { n as assertInstanceOf } from "../assert-BhQd8QHP.mjs";
|
|
7
7
|
import { t as assertRejects } from "../assert_rejects-WyYSTDDX.mjs";
|
|
8
8
|
import { i as rsaPrivateKey2, n as ed25519PrivateKey, r as ed25519PublicKey, s as rsaPublicKey2, t as ed25519Multikey } from "../keys-CCxRJhWa.mjs";
|
|
9
|
-
import { _ as verifySignature, c as detachSignature, m as signJsonLd } from "../ld-
|
|
10
|
-
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-
|
|
9
|
+
import { _ as verifySignature, c as detachSignature, m as signJsonLd } from "../ld-DTaV6DUm.mjs";
|
|
10
|
+
import { i as verifyProof, n as signObject, r as verifyObject, t as createProof } from "../proof-DFrHHTit.mjs";
|
|
11
11
|
import { mockDocumentLoader, test } from "@fedify/fixture";
|
|
12
12
|
import { Create, DataIntegrityProof, Multikey, Note, OrderedCollectionPage, Place } from "@fedify/vocab";
|
|
13
13
|
import { decodeMultibase, importMultibaseKey } from "@fedify/vocab-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "@js-temporal/polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { l as getNormalizationContextLoader } from "./ld-
|
|
4
|
+
import { l as getNormalizationContextLoader } from "./ld-DTaV6DUm.mjs";
|
|
5
5
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
6
6
|
import { normalizeDateTimeLiteral } from "@fedify/vocab-runtime/temporal";
|
|
7
7
|
//#region src/federation/temporal.ts
|