@fedify/fedify 2.5.0-dev.2494 → 2.5.0-dev.2496
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/{builder-Y3pokaG2.mjs → builder-CUVoluZR.mjs} +2 -2
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-BM7AINht.mjs → compound-proof-DSHBRvPr.mjs} +2 -2
- package/dist/{context-COHd1Rsh.mjs → context-A-Nde3u-.mjs} +1 -1
- package/dist/{context-DSuL3YWx.d.cts → context-De6_qvb7.d.cts} +12 -11
- package/dist/{context-DQJE9YfH.d.ts → context-TVf3fdlB.d.ts} +12 -11
- package/dist/{deno-D7blYLbb.mjs → deno-Bd6U_y-w.mjs} +1 -1
- package/dist/{docloader-DbBbDaY-.mjs → docloader-CDPwFfMf.mjs} +2 -2
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +3 -3
- package/dist/federation/handler-compound-proof.test.mjs +4 -4
- package/dist/federation/handler.test.mjs +10 -6
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-actorless.test.mjs +55 -20
- package/dist/federation/inbox-authentication.test.mjs +112 -8
- package/dist/federation/inbox-report.test.mjs +13 -9
- package/dist/federation/inbox-view.test.mjs +1 -1
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +8 -8
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +2 -2
- package/dist/federation/mod.d.ts +2 -2
- package/dist/federation/mod.js +1 -1
- package/dist/federation/mq.test.mjs +1 -1
- package/dist/federation/outgoing-proof.test.mjs +4 -4
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +6 -6
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +3 -3
- package/dist/federation/tasks/enqueue.test.mjs +2 -2
- package/dist/federation/tasks/tasks.test.mjs +3 -3
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +2 -2
- package/dist/{federation-CFaTsSMN.cjs → federation-BsYWlas-.cjs} +61 -49
- package/dist/{http-CxKd10Lq.mjs → http-Bexcl2MP.mjs} +4 -4
- package/dist/{http-2SwIR4b-.cjs → http-DRIP8OAf.cjs} +1 -1
- package/dist/{http-CrYxBKqG.js → http-DU8SkmyD.js} +1 -1
- package/dist/{inbox-CM0UktG8.mjs → inbox-DzY3wS80.mjs} +3 -3
- package/dist/{inbox-authentication-DflPYlLL.mjs → inbox-authentication-CgonVRkg.mjs} +41 -14
- package/dist/{inbox-view-BJ5DBPFo.mjs → inbox-view-CXoRpTuL.mjs} +1 -1
- package/dist/{kv-cache-DbgFe35y.js → kv-cache-C1GxDlbI.js} +1 -1
- package/dist/{kv-cache-Cd8xKv-x.cjs → kv-cache-Dzr88ylV.cjs} +1 -1
- package/dist/{kv-cache-CIdGATck.mjs → kv-cache-fvy2JeOS.mjs} +1 -1
- package/dist/{ld-DUeBHFWH.mjs → ld-DrQTMLaI.mjs} +2 -2
- package/dist/{metrics-B7TvoAP7.mjs → metrics-DS2ZFVe-.mjs} +1 -1
- package/dist/{middleware-BEaUojg7.mjs → middleware-CREOtfQu.mjs} +26 -41
- package/dist/{middleware-CId6efsJ.js → middleware-DKlWAcyP.js} +53 -41
- package/dist/{middleware-BE4JXx-U.mjs → middleware-WhO2R1IG.mjs} +1 -1
- package/dist/{mod-6TQ4UQZb.d.cts → mod-oYNzF2VJ.d.cts} +1 -1
- package/dist/{mod-CIeBgsOC.d.ts → mod-xr6CN9Vz.d.ts} +1 -1
- package/dist/mod.cjs +4 -4
- package/dist/mod.d.cts +2 -2
- package/dist/mod.d.ts +2 -2
- package/dist/mod.js +4 -4
- package/dist/nodeinfo/handler.test.mjs +2 -2
- package/dist/{owner-CwijV0c5.mjs → owner-56YVyohg.mjs} +3 -3
- package/dist/{portable-collection-BeS88JJp.cjs → portable-collection-CnaKW3o7.cjs} +1 -1
- package/dist/{portable-collection-B023xqhZ.mjs → portable-collection-baJxIrh8.mjs} +2 -2
- package/dist/{portable-collection-2jn_4V7Y.js → portable-collection-xCJQ3HQp.js} +1 -1
- package/dist/{portable-key-BpBucRfb.mjs → portable-key-v1tXVIxd.mjs} +1 -1
- package/dist/{proof-DQh2z9fx.mjs → proof-CzS2dAmn.mjs} +3 -3
- package/dist/{send-DN5HNBv-.mjs → send-BqrsM02_.mjs} +3 -3
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +2 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +1 -1
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- 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/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +3 -3
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-yl7Z7A6y.mjs → temporal-DgPS8S4x.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +12 -11
- package/dist/testing/mod.mjs +2 -2
- package/dist/{testing-Dbr21vZk.mjs → testing-_9kJHvqh.mjs} +1 -1
- package/dist/utils/docloader.test.mjs +2 -2
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +6 -6
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { r as createRequestContext } from "../context-
|
|
4
|
+
import { r as createRequestContext } from "../context-A-Nde3u-.mjs";
|
|
5
5
|
import { t as MemoryKvStore } from "../kv-DCHkaJ9-.mjs";
|
|
6
6
|
import { t as assertEquals } from "../assert_equals-Z6IcEbWU.mjs";
|
|
7
7
|
import { t as assertNotEquals } from "../assert_not_equals-CpPK2t89.mjs";
|
|
8
8
|
import "../std__assert-DvMDRPes.mjs";
|
|
9
|
-
import { o as createFederation, s as handleWebFinger } from "../middleware-
|
|
9
|
+
import { o as createFederation, s as handleWebFinger } from "../middleware-CREOtfQu.mjs";
|
|
10
10
|
import { Image, Link, Person, Tombstone } from "@fedify/vocab";
|
|
11
11
|
import { parseIri } from "@fedify/vocab-runtime";
|
|
12
12
|
import { createTestMeterProvider, test } from "@fedify/fixture";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
2
|
const require_rolldown_runtime = require("./rolldown-runtime-Dmm3t92W.cjs");
|
|
3
3
|
const require_transformers = require("./transformers-BalCrSsr.cjs");
|
|
4
|
-
const require_http = require("./http-
|
|
4
|
+
const require_http = require("./http-DRIP8OAf.cjs");
|
|
5
5
|
const require_types = require("./types-hKCCjii0.cjs");
|
|
6
|
-
const require_portable_collection = require("./portable-collection-
|
|
7
|
-
const require_kv_cache = require("./kv-cache-
|
|
6
|
+
const require_portable_collection = require("./portable-collection-CnaKW3o7.cjs");
|
|
7
|
+
const require_kv_cache = require("./kv-cache-Dzr88ylV.cjs");
|
|
8
8
|
let _logtape_logtape = require("@logtape/logtape");
|
|
9
9
|
let _fedify_uri_template = require("@fedify/uri-template");
|
|
10
10
|
let _fedify_vocab = require("@fedify/vocab");
|
|
@@ -2859,7 +2859,7 @@ function normalizeActorId(id) {
|
|
|
2859
2859
|
* @internal
|
|
2860
2860
|
*/
|
|
2861
2861
|
function principalAuthenticates(principal, actorId) {
|
|
2862
|
-
if (principal.kind === "
|
|
2862
|
+
if (principal.kind === "portable-authority") {
|
|
2863
2863
|
if (!require_http.isPortableId(actorId)) return false;
|
|
2864
2864
|
const did = require_http.getPortableDid(actorId);
|
|
2865
2865
|
return did != null && did === require_http.getPortableDid(principal.id);
|
|
@@ -2897,11 +2897,45 @@ function principalAuthenticates(principal, actorId) {
|
|
|
2897
2897
|
function isActorAuthenticated(evidence, actorId, options = {}) {
|
|
2898
2898
|
return getEffectivePrincipals(evidence, options.scope).some((principal) => principalAuthenticates(principal, actorId));
|
|
2899
2899
|
}
|
|
2900
|
+
const SERIALIZED_KINDS = {
|
|
2901
|
+
actor: "actor",
|
|
2902
|
+
"portable-authority": "portableAuthority"
|
|
2903
|
+
};
|
|
2904
|
+
const PUBLIC_KINDS = {
|
|
2905
|
+
actor: "actor",
|
|
2906
|
+
portableAuthority: "portable-authority"
|
|
2907
|
+
};
|
|
2908
|
+
const SERIALIZED_MECHANISMS = {
|
|
2909
|
+
"http-signatures": "httpSignatures",
|
|
2910
|
+
"linked-data-signatures": "linkedDataSignatures",
|
|
2911
|
+
"object-integrity-proofs": "objectIntegrityProofs",
|
|
2912
|
+
origin: "origin"
|
|
2913
|
+
};
|
|
2914
|
+
const PUBLIC_MECHANISMS = {
|
|
2915
|
+
httpSignatures: "http-signatures",
|
|
2916
|
+
linkedDataSignatures: "linked-data-signatures",
|
|
2917
|
+
objectIntegrityProofs: "object-integrity-proofs",
|
|
2918
|
+
origin: "origin"
|
|
2919
|
+
};
|
|
2920
|
+
/**
|
|
2921
|
+
* Converts an internal proof signer to the public authentication principal.
|
|
2922
|
+
* @param signer The authenticated signer.
|
|
2923
|
+
* @returns The public principal.
|
|
2924
|
+
* @internal
|
|
2925
|
+
*/
|
|
2926
|
+
function toProofPrincipal(signer) {
|
|
2927
|
+
return {
|
|
2928
|
+
kind: PUBLIC_KINDS[signer.kind],
|
|
2929
|
+
id: signer.id,
|
|
2930
|
+
mechanism: "object-integrity-proofs",
|
|
2931
|
+
keyId: signer.keyId
|
|
2932
|
+
};
|
|
2933
|
+
}
|
|
2900
2934
|
function serializePrincipal(principal) {
|
|
2901
2935
|
return {
|
|
2902
|
-
kind: principal.kind,
|
|
2936
|
+
kind: SERIALIZED_KINDS[principal.kind],
|
|
2903
2937
|
id: principal.id.href,
|
|
2904
|
-
mechanism: principal.mechanism,
|
|
2938
|
+
mechanism: SERIALIZED_MECHANISMS[principal.mechanism],
|
|
2905
2939
|
keyId: principal.keyId?.href ?? null
|
|
2906
2940
|
};
|
|
2907
2941
|
}
|
|
@@ -2917,22 +2951,15 @@ function serializeAuthentication(evidence) {
|
|
|
2917
2951
|
originAuthenticated: evidence.originAuthenticated.map(serializePrincipal)
|
|
2918
2952
|
};
|
|
2919
2953
|
}
|
|
2920
|
-
const KINDS = /* @__PURE__ */ new Set(["actor", "portableAuthority"]);
|
|
2921
|
-
const MECHANISMS = /* @__PURE__ */ new Set([
|
|
2922
|
-
"httpSignatures",
|
|
2923
|
-
"linkedDataSignatures",
|
|
2924
|
-
"objectIntegrityProofs",
|
|
2925
|
-
"origin"
|
|
2926
|
-
]);
|
|
2927
2954
|
function deserializePrincipals(value) {
|
|
2928
2955
|
if (!Array.isArray(value)) return null;
|
|
2929
2956
|
const principals = [];
|
|
2930
2957
|
for (const item of value) {
|
|
2931
|
-
if (item == null || typeof item !== "object" || !
|
|
2958
|
+
if (item == null || typeof item !== "object" || !(typeof item.kind === "string" && Object.hasOwn(PUBLIC_KINDS, item.kind)) || !(typeof item.mechanism === "string" && Object.hasOwn(PUBLIC_MECHANISMS, item.mechanism)) || typeof item.id !== "string" || !URL.canParse(item.id) || item.keyId != null && (typeof item.keyId !== "string" || !URL.canParse(item.keyId))) return null;
|
|
2932
2959
|
principals.push(Object.freeze({
|
|
2933
|
-
kind: item.kind,
|
|
2960
|
+
kind: PUBLIC_KINDS[item.kind],
|
|
2934
2961
|
id: new URL(item.id),
|
|
2935
|
-
mechanism: item.mechanism,
|
|
2962
|
+
mechanism: PUBLIC_MECHANISMS[item.mechanism],
|
|
2936
2963
|
keyId: item.keyId == null ? null : new URL(item.keyId)
|
|
2937
2964
|
}));
|
|
2938
2965
|
}
|
|
@@ -5567,13 +5594,13 @@ function recordCollectionMetrics(meterProvider, base, result, options = {}) {
|
|
|
5567
5594
|
* @param parameters The parameters for handling the collection.
|
|
5568
5595
|
* @returns A promise that resolves to an HTTP response.
|
|
5569
5596
|
*/
|
|
5570
|
-
async function handleCollection(request, { name: name$
|
|
5571
|
-
const spanName = name$
|
|
5597
|
+
async function handleCollection(request, { name: name$1, identifier, uriGetter, filter, filterPredicate, context, collectionCallbacks, portable, tracerProvider, meterProvider, onUnauthorized, onNotFound }) {
|
|
5598
|
+
const spanName = name$1.trim().replace(/\s+/g, "_");
|
|
5572
5599
|
tracerProvider = tracerProvider ?? _opentelemetry_api.trace.getTracerProvider();
|
|
5573
5600
|
const tracer = tracerProvider.getTracer(require_http.name, require_http.version);
|
|
5574
5601
|
const cursor = new URL(request.url).searchParams.get("cursor");
|
|
5575
5602
|
const metricBase = {
|
|
5576
|
-
kind: getCollectionMetricKind(name$
|
|
5603
|
+
kind: getCollectionMetricKind(name$1),
|
|
5577
5604
|
page: cursor != null,
|
|
5578
5605
|
dispatcher: "built_in"
|
|
5579
5606
|
};
|
|
@@ -5619,7 +5646,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
5619
5646
|
span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
5620
5647
|
return await onNotFound(request);
|
|
5621
5648
|
}
|
|
5622
|
-
const items = filterCollectionItems(page.items, name$
|
|
5649
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
5623
5650
|
itemCount = items.length;
|
|
5624
5651
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
5625
5652
|
return items;
|
|
@@ -5661,7 +5688,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
5661
5688
|
} else {
|
|
5662
5689
|
const uri = new URL(portable == null ? baseUri : pageBase);
|
|
5663
5690
|
uri.searchParams.set("cursor", cursor);
|
|
5664
|
-
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$
|
|
5691
|
+
const pageOrResponse = await tracer.startActiveSpan(`activitypub.dispatch_collection_page ${name$1}`, {
|
|
5665
5692
|
kind: _opentelemetry_api.SpanKind.SERVER,
|
|
5666
5693
|
attributes: {
|
|
5667
5694
|
"activitypub.collection.id": uri.href,
|
|
@@ -5677,7 +5704,7 @@ async function handleCollection(request, { name: name$2, identifier, uriGetter,
|
|
|
5677
5704
|
span.setStatus({ code: _opentelemetry_api.SpanStatusCode.ERROR });
|
|
5678
5705
|
return await onNotFound(request);
|
|
5679
5706
|
}
|
|
5680
|
-
const items = filterCollectionItems(page.items, name$
|
|
5707
|
+
const items = filterCollectionItems(page.items, name$1, filterPredicate);
|
|
5681
5708
|
itemCount = items.length;
|
|
5682
5709
|
span.setAttribute("fedify.collection.items", itemCount);
|
|
5683
5710
|
return {
|
|
@@ -6503,7 +6530,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
6503
6530
|
if (ldSigKey?.ownerId != null) documentSigners = [{
|
|
6504
6531
|
kind: "actor",
|
|
6505
6532
|
id: ldSigKey.ownerId,
|
|
6506
|
-
mechanism: "
|
|
6533
|
+
mechanism: "linked-data-signatures",
|
|
6507
6534
|
keyId: ldSigKey.id
|
|
6508
6535
|
}];
|
|
6509
6536
|
if (await isActorlessCandidate(activity, viewSource)) {
|
|
@@ -6863,7 +6890,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
6863
6890
|
if (httpSigKey != null && !actorless && activity.actorId != null) requestSigners = [{
|
|
6864
6891
|
kind: "actor",
|
|
6865
6892
|
id: activity.actorId,
|
|
6866
|
-
mechanism: "
|
|
6893
|
+
mechanism: "http-signatures",
|
|
6867
6894
|
keyId: httpSigKey.id
|
|
6868
6895
|
}];
|
|
6869
6896
|
if (actorless) {
|
|
@@ -6879,7 +6906,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
6879
6906
|
if (deferredLdSignatureError != null) throw deferredLdSignatureError;
|
|
6880
6907
|
observation.authentication = {
|
|
6881
6908
|
status: "rejected",
|
|
6882
|
-
reason: { type: "
|
|
6909
|
+
reason: { type: "no-authenticated-principal" }
|
|
6883
6910
|
};
|
|
6884
6911
|
logger.error("The activity {activityId} declares no actor, and no principal is authenticated for it.", {
|
|
6885
6912
|
activity: json,
|
|
@@ -6899,7 +6926,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
6899
6926
|
observation.authentication = {
|
|
6900
6927
|
status: "rejected",
|
|
6901
6928
|
reason: {
|
|
6902
|
-
type: "
|
|
6929
|
+
type: "activity-origin-mismatch",
|
|
6903
6930
|
activityId: new URL(activity.id.href),
|
|
6904
6931
|
actorIds: check.principals.map((principal) => principal.id)
|
|
6905
6932
|
}
|
|
@@ -6983,7 +7010,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
6983
7010
|
observation.authentication = {
|
|
6984
7011
|
status: "rejected",
|
|
6985
7012
|
reason: {
|
|
6986
|
-
type: "
|
|
7013
|
+
type: "activity-origin-mismatch",
|
|
6987
7014
|
activityId: new URL(activity.id.href),
|
|
6988
7015
|
actorIds: activity.actorIds.map((id) => new URL(id.href))
|
|
6989
7016
|
}
|
|
@@ -7257,8 +7284,8 @@ var CustomCollectionHandler = class {
|
|
|
7257
7284
|
* @param CollectionPage The CollectionPage constructor.
|
|
7258
7285
|
* @param filterPredicate Optional filter predicate for items.
|
|
7259
7286
|
*/
|
|
7260
|
-
constructor(name$
|
|
7261
|
-
this.name = name$
|
|
7287
|
+
constructor(name$2, values, context, callbacks, tracerProvider = _opentelemetry_api.trace.getTracerProvider(), meterProvider, Collection, CollectionPage, filterPredicate, portable) {
|
|
7288
|
+
this.name = name$2;
|
|
7262
7289
|
this.values = values;
|
|
7263
7290
|
this.context = context;
|
|
7264
7291
|
this.callbacks = callbacks;
|
|
@@ -7770,12 +7797,7 @@ const MIN_COMPONENTS = [
|
|
|
7770
7797
|
* Turns the signers of verified Object Integrity Proofs into principals.
|
|
7771
7798
|
*/
|
|
7772
7799
|
function toProofPrincipals(signers) {
|
|
7773
|
-
return signers.map(
|
|
7774
|
-
kind: signer.kind,
|
|
7775
|
-
id: signer.id,
|
|
7776
|
-
mechanism: "objectIntegrityProofs",
|
|
7777
|
-
keyId: signer.keyId
|
|
7778
|
-
}));
|
|
7800
|
+
return signers.map(toProofPrincipal);
|
|
7779
7801
|
}
|
|
7780
7802
|
/**
|
|
7781
7803
|
* Gets the principal of an HTTP Signature key, whose owner was confirmed by
|
|
@@ -7788,7 +7810,7 @@ function getHttpKeyPrincipal(key) {
|
|
|
7788
7810
|
return {
|
|
7789
7811
|
kind: "actor",
|
|
7790
7812
|
id: (0, _fedify_vocab_runtime.parseIri)(evidence.ownerId),
|
|
7791
|
-
mechanism: "
|
|
7813
|
+
mechanism: "http-signatures",
|
|
7792
7814
|
keyId: key.id
|
|
7793
7815
|
};
|
|
7794
7816
|
} catch {
|
|
@@ -7798,7 +7820,7 @@ function getHttpKeyPrincipal(key) {
|
|
|
7798
7820
|
return {
|
|
7799
7821
|
kind: "actor",
|
|
7800
7822
|
id: key.ownerId,
|
|
7801
|
-
mechanism: "
|
|
7823
|
+
mechanism: "http-signatures",
|
|
7802
7824
|
keyId: key.id
|
|
7803
7825
|
};
|
|
7804
7826
|
}
|
|
@@ -12643,12 +12665,7 @@ var ContextImpl = class ContextImpl {
|
|
|
12643
12665
|
const result = verifications.get(candidate.document);
|
|
12644
12666
|
if (result?.verified === true && result.method === "proof") documentSigners = result.keys.flatMap((key) => {
|
|
12645
12667
|
const signer = require_http.getProofSigner(key);
|
|
12646
|
-
return signer == null ? [] : [
|
|
12647
|
-
kind: signer.kind,
|
|
12648
|
-
id: signer.id,
|
|
12649
|
-
mechanism: "objectIntegrityProofs",
|
|
12650
|
-
keyId: signer.keyId
|
|
12651
|
-
}];
|
|
12668
|
+
return signer == null ? [] : [toProofPrincipal(signer)];
|
|
12652
12669
|
});
|
|
12653
12670
|
} else originAuthenticated = fetched.actorIds.map((actorId) => ({
|
|
12654
12671
|
kind: "actor",
|
|
@@ -12662,12 +12679,7 @@ var ContextImpl = class ContextImpl {
|
|
|
12662
12679
|
activity: json
|
|
12663
12680
|
});
|
|
12664
12681
|
activity = verified.object;
|
|
12665
|
-
documentSigners = verified.signers.map(
|
|
12666
|
-
kind: signer.kind,
|
|
12667
|
-
id: signer.id,
|
|
12668
|
-
mechanism: "objectIntegrityProofs",
|
|
12669
|
-
keyId: signer.keyId
|
|
12670
|
-
}));
|
|
12682
|
+
documentSigners = verified.signers.map(toProofPrincipal);
|
|
12671
12683
|
viewSource = {
|
|
12672
12684
|
policy: "standard",
|
|
12673
12685
|
source: "activity",
|
|
@@ -3,12 +3,12 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { m as parseKeyIdString } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
6
|
-
import { n as version, t as name } from "./deno-
|
|
7
|
-
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-
|
|
6
|
+
import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
|
|
7
|
+
import { n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch } from "./metrics-DS2ZFVe-.mjs";
|
|
8
8
|
import { i as validateAcceptSignature, n as fulfillAcceptSignature, r as parseAcceptSignature } from "./accept-CPVqki78.mjs";
|
|
9
9
|
import { a as promoteKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
|
|
10
|
-
import { D as validateCryptoKey, b as bypassKeyCacheReads, w as fetchKeyDetailed } from "./ld-
|
|
11
|
-
import { n as resolvePortableActorKey, r as verifyPortableGatewayKeyDocument } from "./portable-key-
|
|
10
|
+
import { D as validateCryptoKey, b as bypassKeyCacheReads, w as fetchKeyDetailed } from "./ld-DrQTMLaI.mjs";
|
|
11
|
+
import { n as resolvePortableActorKey, r as verifyPortableGatewayKeyDocument } from "./portable-key-v1tXVIxd.mjs";
|
|
12
12
|
import { getLogger } from "@logtape/logtape";
|
|
13
13
|
import { CryptographicKey } from "@fedify/vocab";
|
|
14
14
|
import { SpanStatusCode, trace } from "@opentelemetry/api";
|
|
@@ -17,7 +17,7 @@ json_canon = require_rolldown_runtime.__toESM(json_canon, 1);
|
|
|
17
17
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
18
18
|
//#region deno.json
|
|
19
19
|
var name = "@fedify/fedify";
|
|
20
|
-
var version = "2.5.0-dev.
|
|
20
|
+
var version = "2.5.0-dev.2496+e18c05f8";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/sig/portable-key-id.ts
|
|
23
23
|
const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
|
|
@@ -15,7 +15,7 @@ import serialize from "json-canon";
|
|
|
15
15
|
import { ATTR_HTTP_REQUEST_HEADER, ATTR_HTTP_REQUEST_METHOD, ATTR_URL_FULL } from "@opentelemetry/semantic-conventions";
|
|
16
16
|
//#region deno.json
|
|
17
17
|
var name = "@fedify/fedify";
|
|
18
|
-
var version = "2.5.0-dev.
|
|
18
|
+
var version = "2.5.0-dev.2496+e18c05f8";
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/sig/portable-key-id.ts
|
|
21
21
|
const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
|
|
@@ -2,9 +2,9 @@ import { Temporal } from "temporal-polyfill";
|
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { t as getAuthenticationOrigin } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
|
-
import { o as serializeAuthentication, r as getEffectivePrincipals } from "./inbox-authentication-
|
|
6
|
-
import { n as version, t as name } from "./deno-
|
|
7
|
-
import { g as recordInboxActivity, n as getDurationMs, r as getFederationMetrics } from "./metrics-
|
|
5
|
+
import { o as serializeAuthentication, r as getEffectivePrincipals } from "./inbox-authentication-CgonVRkg.mjs";
|
|
6
|
+
import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
|
|
7
|
+
import { g as recordInboxActivity, n as getDurationMs, r as getFederationMetrics } from "./metrics-DS2ZFVe-.mjs";
|
|
8
8
|
import { getLogger } from "@logtape/logtape";
|
|
9
9
|
import { getTypeId } from "@fedify/vocab";
|
|
10
10
|
import { SpanKind, SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
@@ -49,7 +49,7 @@ function normalizeActorId(id) {
|
|
|
49
49
|
* @internal
|
|
50
50
|
*/
|
|
51
51
|
function principalAuthenticates(principal, actorId) {
|
|
52
|
-
if (principal.kind === "
|
|
52
|
+
if (principal.kind === "portable-authority") {
|
|
53
53
|
if (!isPortableId(actorId)) return false;
|
|
54
54
|
const did = getPortableDid(actorId);
|
|
55
55
|
return did != null && did === getPortableDid(principal.id);
|
|
@@ -87,11 +87,45 @@ function principalAuthenticates(principal, actorId) {
|
|
|
87
87
|
function isActorAuthenticated(evidence, actorId, options = {}) {
|
|
88
88
|
return getEffectivePrincipals(evidence, options.scope).some((principal) => principalAuthenticates(principal, actorId));
|
|
89
89
|
}
|
|
90
|
+
const SERIALIZED_KINDS = {
|
|
91
|
+
actor: "actor",
|
|
92
|
+
"portable-authority": "portableAuthority"
|
|
93
|
+
};
|
|
94
|
+
const PUBLIC_KINDS = {
|
|
95
|
+
actor: "actor",
|
|
96
|
+
portableAuthority: "portable-authority"
|
|
97
|
+
};
|
|
98
|
+
const SERIALIZED_MECHANISMS = {
|
|
99
|
+
"http-signatures": "httpSignatures",
|
|
100
|
+
"linked-data-signatures": "linkedDataSignatures",
|
|
101
|
+
"object-integrity-proofs": "objectIntegrityProofs",
|
|
102
|
+
origin: "origin"
|
|
103
|
+
};
|
|
104
|
+
const PUBLIC_MECHANISMS = {
|
|
105
|
+
httpSignatures: "http-signatures",
|
|
106
|
+
linkedDataSignatures: "linked-data-signatures",
|
|
107
|
+
objectIntegrityProofs: "object-integrity-proofs",
|
|
108
|
+
origin: "origin"
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Converts an internal proof signer to the public authentication principal.
|
|
112
|
+
* @param signer The authenticated signer.
|
|
113
|
+
* @returns The public principal.
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
function toProofPrincipal(signer) {
|
|
117
|
+
return {
|
|
118
|
+
kind: PUBLIC_KINDS[signer.kind],
|
|
119
|
+
id: signer.id,
|
|
120
|
+
mechanism: "object-integrity-proofs",
|
|
121
|
+
keyId: signer.keyId
|
|
122
|
+
};
|
|
123
|
+
}
|
|
90
124
|
function serializePrincipal(principal) {
|
|
91
125
|
return {
|
|
92
|
-
kind: principal.kind,
|
|
126
|
+
kind: SERIALIZED_KINDS[principal.kind],
|
|
93
127
|
id: principal.id.href,
|
|
94
|
-
mechanism: principal.mechanism,
|
|
128
|
+
mechanism: SERIALIZED_MECHANISMS[principal.mechanism],
|
|
95
129
|
keyId: principal.keyId?.href ?? null
|
|
96
130
|
};
|
|
97
131
|
}
|
|
@@ -107,22 +141,15 @@ function serializeAuthentication(evidence) {
|
|
|
107
141
|
originAuthenticated: evidence.originAuthenticated.map(serializePrincipal)
|
|
108
142
|
};
|
|
109
143
|
}
|
|
110
|
-
const KINDS = /* @__PURE__ */ new Set(["actor", "portableAuthority"]);
|
|
111
|
-
const MECHANISMS = /* @__PURE__ */ new Set([
|
|
112
|
-
"httpSignatures",
|
|
113
|
-
"linkedDataSignatures",
|
|
114
|
-
"objectIntegrityProofs",
|
|
115
|
-
"origin"
|
|
116
|
-
]);
|
|
117
144
|
function deserializePrincipals(value) {
|
|
118
145
|
if (!Array.isArray(value)) return null;
|
|
119
146
|
const principals = [];
|
|
120
147
|
for (const item of value) {
|
|
121
|
-
if (item == null || typeof item !== "object" || !
|
|
148
|
+
if (item == null || typeof item !== "object" || !(typeof item.kind === "string" && Object.hasOwn(PUBLIC_KINDS, item.kind)) || !(typeof item.mechanism === "string" && Object.hasOwn(PUBLIC_MECHANISMS, item.mechanism)) || typeof item.id !== "string" || !URL.canParse(item.id) || item.keyId != null && (typeof item.keyId !== "string" || !URL.canParse(item.keyId))) return null;
|
|
122
149
|
principals.push(Object.freeze({
|
|
123
|
-
kind: item.kind,
|
|
150
|
+
kind: PUBLIC_KINDS[item.kind],
|
|
124
151
|
id: new URL(item.id),
|
|
125
|
-
mechanism: item.mechanism,
|
|
152
|
+
mechanism: PUBLIC_MECHANISMS[item.mechanism],
|
|
126
153
|
keyId: item.keyId == null ? null : new URL(item.keyId)
|
|
127
154
|
}));
|
|
128
155
|
}
|
|
@@ -168,4 +195,4 @@ function createAuthenticationEvidence(evidence) {
|
|
|
168
195
|
});
|
|
169
196
|
}
|
|
170
197
|
//#endregion
|
|
171
|
-
export { isActorAuthenticated as a, getEmptyAuthenticationEvidence as i, deserializeAuthentication as n, serializeAuthentication as o, getEffectivePrincipals as r, createAuthenticationEvidence as t };
|
|
198
|
+
export { isActorAuthenticated as a, getEmptyAuthenticationEvidence as i, deserializeAuthentication as n, serializeAuthentication as o, getEffectivePrincipals as r, toProofPrincipal as s, createAuthenticationEvidence as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { c as getNormalizationContextLoader, p as markEffectiveContextLoader, s as detachSignature, y as wrapContextLoaderForJsonLd } from "./ld-
|
|
4
|
+
import { c as getNormalizationContextLoader, p as markEffectiveContextLoader, s as detachSignature, y as wrapContextLoaderForJsonLd } from "./ld-DrQTMLaI.mjs";
|
|
5
5
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
6
6
|
import { encodeHex } from "byte-encodings/hex";
|
|
7
7
|
import jsonld from "@fedify/vocab-runtime/jsonld";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
|
-
import { X as validateCryptoKey, dt as recordDocumentCache, t as doubleKnockScoped } from "./http-
|
|
3
|
+
import { X as validateCryptoKey, dt as recordDocumentCache, t as doubleKnockScoped } from "./http-DU8SkmyD.js";
|
|
4
4
|
import { getLogger } from "@logtape/logtape";
|
|
5
5
|
import { FetchError, UrlError, createActivityPubRequest, getRemoteDocument, logRequest, preloadedContexts, resolveDocumentLoaderTimeout, withDocumentLoaderTimeout } from "@fedify/vocab-runtime";
|
|
6
6
|
import { curry } from "es-toolkit";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { URLPattern } = require("urlpattern-polyfill");
|
|
2
|
-
const require_http = require("./http-
|
|
2
|
+
const require_http = require("./http-DRIP8OAf.cjs");
|
|
3
3
|
let _logtape_logtape = require("@logtape/logtape");
|
|
4
4
|
let _fedify_vocab_runtime = require("@fedify/vocab-runtime");
|
|
5
5
|
let es_toolkit = require("es-toolkit");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Temporal } from "temporal-polyfill";
|
|
2
2
|
import { URLPattern } from "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { p as recordDocumentCache } from "./metrics-
|
|
4
|
+
import { p as recordDocumentCache } from "./metrics-DS2ZFVe-.mjs";
|
|
5
5
|
import { getLogger } from "@logtape/logtape";
|
|
6
6
|
import { preloadedContexts } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/utils/kv-cache.ts
|
|
@@ -3,8 +3,8 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { c as isPortableActorDocument, d as isPortableUri, l as isPortableId, m as parseKeyIdString, s as isCompatibleKeyId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { a as verificationObservation, i as triedKey, n as observeCheck, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
6
|
-
import { n as version, t as name } from "./deno-
|
|
7
|
-
import { _ as recordKeyLookup, n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch, t as classifyFetchError } from "./metrics-
|
|
6
|
+
import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
|
|
7
|
+
import { _ as recordKeyLookup, n as getDurationMs, r as getFederationMetrics, s as measureSignatureKeyFetch, t as classifyFetchError } from "./metrics-DS2ZFVe-.mjs";
|
|
8
8
|
import { n as attachKeyOwnerEvidence, t as MAX_PORTABLE_KEY_TTL } from "./key-owner-evidence-APB6NpSk.mjs";
|
|
9
9
|
import { getLogger } from "@logtape/logtape";
|
|
10
10
|
import { Activity, CryptographicKey, Multikey, Object as Object$1, getTypeId, isActor } from "@fedify/vocab";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "temporal-polyfill";
|
|
2
2
|
import "urlpattern-polyfill";
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
|
-
import { n as version, t as name } from "./deno-
|
|
4
|
+
import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
|
|
5
5
|
import { metrics } from "@opentelemetry/api";
|
|
6
6
|
import { FetchError } from "@fedify/vocab-runtime";
|
|
7
7
|
//#region src/federation/metrics.ts
|
|
@@ -3,32 +3,32 @@ import "urlpattern-polyfill";
|
|
|
3
3
|
globalThis.addEventListener = () => {};
|
|
4
4
|
import { d as isPortableUri, f as isSameObjectId, i as getPortableDid, l as isPortableId, n as getCanonicalPortableId, o as hasPortableActor, r as getGatewayKeyBase, s as isCompatibleKeyId, t as getAuthenticationOrigin, u as isPortableKeyId } from "./portable-key-id-Ca30-hOa.mjs";
|
|
5
5
|
import { n as isPubliclyAddressedNode, t as isInAudience } from "./audience-CHQ-FlLD.mjs";
|
|
6
|
-
import { i as getEmptyAuthenticationEvidence, n as deserializeAuthentication, t as createAuthenticationEvidence } from "./inbox-authentication-
|
|
6
|
+
import { i as getEmptyAuthenticationEvidence, n as deserializeAuthentication, s as toProofPrincipal, t as createAuthenticationEvidence } from "./inbox-authentication-CgonVRkg.mjs";
|
|
7
7
|
import { a as verificationObservation, r as snapshotKey, t as observeAttempt } from "./verification-Dpfcw8ml.mjs";
|
|
8
|
-
import { n as version, t as name } from "./deno-
|
|
9
|
-
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-
|
|
8
|
+
import { n as version, t as name } from "./deno-Bd6U_y-w.mjs";
|
|
9
|
+
import { a as instrumentDocumentLoader, b as recordWebFingerHandle, c as recordCircuitBreakerStateChange, d as recordCollectionRequest, f as recordCollectionTotalItems, g as recordInboxActivity, h as recordFanoutRecipients, i as getRemoteHost, l as recordCollectionDispatchDuration, n as getDurationMs, o as isAbortError, r as getFederationMetrics, u as recordCollectionPageItems, v as recordOutboxActivity, x as registerQueueDepthGauge, y as recordOutboxEnqueue } from "./metrics-DS2ZFVe-.mjs";
|
|
10
10
|
import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
|
|
11
11
|
import { r as getVerifiedKeyOwnerEvidence } from "./key-owner-evidence-APB6NpSk.mjs";
|
|
12
|
-
import { D as validateCryptoKey, E as importJwk, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, g as verifyCompactJsonLdDetailed, l as hasSignature, m as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike, x as exportJwk, y as wrapContextLoaderForJsonLd } from "./ld-
|
|
12
|
+
import { D as validateCryptoKey, E as importJwk, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, g as verifyCompactJsonLdDetailed, l as hasSignature, m as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike, x as exportJwk, y as wrapContextLoaderForJsonLd } from "./ld-DrQTMLaI.mjs";
|
|
13
13
|
import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-4IJqPYos.mjs";
|
|
14
|
-
import { a as hasProofLike, d as verifyPortableObjectProof, i as getProofSigner, l as verifyObject, p as verifyPortableObjectProofWithRoot, s as signObject, t as InvalidPortableObjectIdError, u as verifyObjectDetailed } from "./proof-
|
|
15
|
-
import { c as parseRfc9421SignatureInput, f as validateMaxSignatures, l as selectRequestSignature, m as verifyRequestDetailed, o as listRequestSignatures, p as verifyRequest } from "./http-
|
|
16
|
-
import { n as getAuthenticatedDocumentLoader } from "./docloader-
|
|
17
|
-
import { n as kvCache } from "./kv-cache-
|
|
14
|
+
import { a as hasProofLike, d as verifyPortableObjectProof, i as getProofSigner, l as verifyObject, p as verifyPortableObjectProofWithRoot, s as signObject, t as InvalidPortableObjectIdError, u as verifyObjectDetailed } from "./proof-CzS2dAmn.mjs";
|
|
15
|
+
import { c as parseRfc9421SignatureInput, f as validateMaxSignatures, l as selectRequestSignature, m as verifyRequestDetailed, o as listRequestSignatures, p as verifyRequest } from "./http-Bexcl2MP.mjs";
|
|
16
|
+
import { n as getAuthenticatedDocumentLoader } from "./docloader-CDPwFfMf.mjs";
|
|
17
|
+
import { n as kvCache } from "./kv-cache-fvy2JeOS.mjs";
|
|
18
18
|
import { d as MAX_BODY_SIZE, f as readBoundedText, t as getNodeInfo, u as BodyTooLargeError } from "./client-5SIFzW3q.mjs";
|
|
19
19
|
import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
|
|
20
|
-
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-
|
|
21
|
-
import { t as verifyPortableObject } from "./portable-collection-
|
|
22
|
-
import { a as sendActivityThroughGateways, i as sendActivity, n as extractInboxes, o as getOrderingDestination, t as SendActivityError } from "./send-
|
|
23
|
-
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-
|
|
20
|
+
import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-56YVyohg.mjs";
|
|
21
|
+
import { t as verifyPortableObject } from "./portable-collection-baJxIrh8.mjs";
|
|
22
|
+
import { a as sendActivityThroughGateways, i as sendActivity, n as extractInboxes, o as getOrderingDestination, t as SendActivityError } from "./send-BqrsM02_.mjs";
|
|
23
|
+
import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-CUVoluZR.mjs";
|
|
24
24
|
import { t as CircuitBreaker } from "./circuit-breaker-XJ53md4S.mjs";
|
|
25
25
|
import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
|
|
26
|
-
import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-
|
|
27
|
-
import { a as isActorlessActivityAuthenticated, i as getInboxIdempotencyKey, n as checkActorlessActivity, o as isInboxActivityProcessed, s as routeActivity, t as actorsHaveSameOrigin } from "./inbox-
|
|
28
|
-
import { c as expandDocument, d as parseSerializedVerifiedActivityView, f as restoreVerifiedActivityView, i as createReleasableLoader, l as getActorPresence, n as buildVerifiedActivityView, o as deepFreeze, r as createContextSnapshot, t as ContextSnapshotMissError } from "./inbox-view-
|
|
26
|
+
import { a as inspectCompoundPortableObjectApplicability, c as verifyServedPortableObjects, i as findUnsupportedCompoundProofShape, o as verifyCompoundPortableObjectProofs, r as findEmbeddedProofWithoutContext, t as containsCompoundPortableObject } from "./compound-proof-DSHBRvPr.mjs";
|
|
27
|
+
import { a as isActorlessActivityAuthenticated, i as getInboxIdempotencyKey, n as checkActorlessActivity, o as isInboxActivityProcessed, s as routeActivity, t as actorsHaveSameOrigin } from "./inbox-DzY3wS80.mjs";
|
|
28
|
+
import { c as expandDocument, d as parseSerializedVerifiedActivityView, f as restoreVerifiedActivityView, i as createReleasableLoader, l as getActorPresence, n as buildVerifiedActivityView, o as deepFreeze, r as createContextSnapshot, t as ContextSnapshotMissError } from "./inbox-view-CXoRpTuL.mjs";
|
|
29
29
|
import { t as KvKeyCache } from "./keycache-N2opu4-3.mjs";
|
|
30
30
|
import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
|
|
31
|
-
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-
|
|
31
|
+
import { t as hasMalformedKnownTemporalLiteral } from "./temporal-DgPS8S4x.mjs";
|
|
32
32
|
import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
|
|
33
33
|
import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
|
|
34
34
|
import { getLogger, withContext } from "@logtape/logtape";
|
|
@@ -2507,7 +2507,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
2507
2507
|
if (ldSigKey?.ownerId != null) documentSigners = [{
|
|
2508
2508
|
kind: "actor",
|
|
2509
2509
|
id: ldSigKey.ownerId,
|
|
2510
|
-
mechanism: "
|
|
2510
|
+
mechanism: "linked-data-signatures",
|
|
2511
2511
|
keyId: ldSigKey.id
|
|
2512
2512
|
}];
|
|
2513
2513
|
if (await isActorlessCandidate(activity, viewSource)) {
|
|
@@ -2867,7 +2867,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
2867
2867
|
if (httpSigKey != null && !actorless && activity.actorId != null) requestSigners = [{
|
|
2868
2868
|
kind: "actor",
|
|
2869
2869
|
id: activity.actorId,
|
|
2870
|
-
mechanism: "
|
|
2870
|
+
mechanism: "http-signatures",
|
|
2871
2871
|
keyId: httpSigKey.id
|
|
2872
2872
|
}];
|
|
2873
2873
|
if (actorless) {
|
|
@@ -2883,7 +2883,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
2883
2883
|
if (deferredLdSignatureError != null) throw deferredLdSignatureError;
|
|
2884
2884
|
observation.authentication = {
|
|
2885
2885
|
status: "rejected",
|
|
2886
|
-
reason: { type: "
|
|
2886
|
+
reason: { type: "no-authenticated-principal" }
|
|
2887
2887
|
};
|
|
2888
2888
|
logger.error("The activity {activityId} declares no actor, and no principal is authenticated for it.", {
|
|
2889
2889
|
activity: json,
|
|
@@ -2903,7 +2903,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
2903
2903
|
observation.authentication = {
|
|
2904
2904
|
status: "rejected",
|
|
2905
2905
|
reason: {
|
|
2906
|
-
type: "
|
|
2906
|
+
type: "activity-origin-mismatch",
|
|
2907
2907
|
activityId: new URL(activity.id.href),
|
|
2908
2908
|
actorIds: check.principals.map((principal) => principal.id)
|
|
2909
2909
|
}
|
|
@@ -2987,7 +2987,7 @@ async function handleInboxInternal(request, parameters, span, snapshot) {
|
|
|
2987
2987
|
observation.authentication = {
|
|
2988
2988
|
status: "rejected",
|
|
2989
2989
|
reason: {
|
|
2990
|
-
type: "
|
|
2990
|
+
type: "activity-origin-mismatch",
|
|
2991
2991
|
activityId: new URL(activity.id.href),
|
|
2992
2992
|
actorIds: activity.actorIds.map((id) => new URL(id.href))
|
|
2993
2993
|
}
|
|
@@ -3774,12 +3774,7 @@ const MIN_COMPONENTS = [
|
|
|
3774
3774
|
* Turns the signers of verified Object Integrity Proofs into principals.
|
|
3775
3775
|
*/
|
|
3776
3776
|
function toProofPrincipals(signers) {
|
|
3777
|
-
return signers.map(
|
|
3778
|
-
kind: signer.kind,
|
|
3779
|
-
id: signer.id,
|
|
3780
|
-
mechanism: "objectIntegrityProofs",
|
|
3781
|
-
keyId: signer.keyId
|
|
3782
|
-
}));
|
|
3777
|
+
return signers.map(toProofPrincipal);
|
|
3783
3778
|
}
|
|
3784
3779
|
/**
|
|
3785
3780
|
* Gets the principal of an HTTP Signature key, whose owner was confirmed by
|
|
@@ -3792,7 +3787,7 @@ function getHttpKeyPrincipal(key) {
|
|
|
3792
3787
|
return {
|
|
3793
3788
|
kind: "actor",
|
|
3794
3789
|
id: parseIri(evidence.ownerId),
|
|
3795
|
-
mechanism: "
|
|
3790
|
+
mechanism: "http-signatures",
|
|
3796
3791
|
keyId: key.id
|
|
3797
3792
|
};
|
|
3798
3793
|
} catch {
|
|
@@ -3802,7 +3797,7 @@ function getHttpKeyPrincipal(key) {
|
|
|
3802
3797
|
return {
|
|
3803
3798
|
kind: "actor",
|
|
3804
3799
|
id: key.ownerId,
|
|
3805
|
-
mechanism: "
|
|
3800
|
+
mechanism: "http-signatures",
|
|
3806
3801
|
keyId: key.id
|
|
3807
3802
|
};
|
|
3808
3803
|
}
|
|
@@ -8147,12 +8142,7 @@ var ContextImpl = class ContextImpl {
|
|
|
8147
8142
|
const result = verifications.get(candidate.document);
|
|
8148
8143
|
if (result?.verified === true && result.method === "proof") documentSigners = result.keys.flatMap((key) => {
|
|
8149
8144
|
const signer = getProofSigner(key);
|
|
8150
|
-
return signer == null ? [] : [
|
|
8151
|
-
kind: signer.kind,
|
|
8152
|
-
id: signer.id,
|
|
8153
|
-
mechanism: "objectIntegrityProofs",
|
|
8154
|
-
keyId: signer.keyId
|
|
8155
|
-
}];
|
|
8145
|
+
return signer == null ? [] : [toProofPrincipal(signer)];
|
|
8156
8146
|
});
|
|
8157
8147
|
} else originAuthenticated = fetched.actorIds.map((actorId) => ({
|
|
8158
8148
|
kind: "actor",
|
|
@@ -8166,12 +8156,7 @@ var ContextImpl = class ContextImpl {
|
|
|
8166
8156
|
activity: json
|
|
8167
8157
|
});
|
|
8168
8158
|
activity = verified.object;
|
|
8169
|
-
documentSigners = verified.signers.map(
|
|
8170
|
-
kind: signer.kind,
|
|
8171
|
-
id: signer.id,
|
|
8172
|
-
mechanism: "objectIntegrityProofs",
|
|
8173
|
-
keyId: signer.keyId
|
|
8174
|
-
}));
|
|
8159
|
+
documentSigners = verified.signers.map(toProofPrincipal);
|
|
8175
8160
|
viewSource = {
|
|
8176
8161
|
policy: "standard",
|
|
8177
8162
|
source: "activity",
|