@fedify/fedify 2.4.0-dev.1964 → 2.4.0-dev.1995

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 (94) hide show
  1. package/dist/{builder-B4zpKIFU.mjs → builder-D0DxgOV5.mjs} +2 -2
  2. package/dist/{client-CtxvmazV.mjs → client-DpnpgjyX.mjs} +78 -4
  3. package/dist/compat/mod.d.cts +1 -1
  4. package/dist/compat/mod.d.ts +1 -1
  5. package/dist/compat/transformers.test.mjs +1 -1
  6. package/dist/compound-proof-CJnWc6c-.mjs +495 -0
  7. package/dist/{context-COLwHogJ.d.cts → context-BeDnDuF3.d.cts} +4 -3
  8. package/dist/{context-DiiCt4S7.d.ts → context-uyRUWoZQ.d.ts} +4 -3
  9. package/dist/{deno-CtG93ohj.mjs → deno-CABhzCb_.mjs} +1 -1
  10. package/dist/{docloader-dk_k3S8d.mjs → docloader-BbGSL0Xq.mjs} +2 -2
  11. package/dist/federation/builder.test.mjs +1 -1
  12. package/dist/federation/handler-compound-proof.test.d.mts +2 -0
  13. package/dist/federation/handler-compound-proof.test.mjs +152 -0
  14. package/dist/federation/handler.test.mjs +122 -4
  15. package/dist/federation/idempotency.test.mjs +2 -2
  16. package/dist/federation/keycache.test.mjs +52 -9
  17. package/dist/federation/metrics.test.mjs +1 -1
  18. package/dist/federation/middleware.test.mjs +111 -15
  19. package/dist/federation/mod.cjs +1 -1
  20. package/dist/federation/mod.d.cts +2 -2
  21. package/dist/federation/mod.d.ts +2 -2
  22. package/dist/federation/mod.js +1 -1
  23. package/dist/federation/send.test.mjs +139 -4
  24. package/dist/federation/tasks/enqueue.test.mjs +1 -1
  25. package/dist/federation/tasks/tasks.test.mjs +2 -2
  26. package/dist/federation/temporal.test.mjs +1 -1
  27. package/dist/federation/webfinger.test.mjs +1 -1
  28. package/dist/{federation-Drjlrrax.cjs → federation-DCEHQk4G.cjs} +632 -57
  29. package/dist/{http-6TI0tI03.d.cts → http-65PYi9jY.d.ts} +34 -2
  30. package/dist/{http-Dj4s1UQ0.js → http-9WyuldYh.js} +170 -8
  31. package/dist/{http-CdrSn2ip.d.ts → http-CP-7OdSq.d.cts} +34 -2
  32. package/dist/{http-B3skRvGo.cjs → http-CRFns-UE.cjs} +181 -7
  33. package/dist/{http-D7LX-BL9.mjs → http-D9urSO2D.mjs} +3 -3
  34. package/dist/{key-BVjgbs_9.mjs → key-Ccs8cnd7.mjs} +169 -7
  35. package/dist/{keycache-ZLqIfrkL.mjs → keycache-BUDHB5rY.mjs} +12 -4
  36. package/dist/{kv-cache-DtsjH_bY.cjs → kv-cache-DXT9vmIg.cjs} +2 -2
  37. package/dist/{kv-cache-tGNbvDCF.js → kv-cache-DtmXhPXG.js} +2 -2
  38. package/dist/{kv-cache-xRcC_xxP.mjs → kv-cache-lKyFn_Dn.mjs} +1 -1
  39. package/dist/{ld-OuCeQFny.mjs → ld-qup__MAW.mjs} +3 -3
  40. package/dist/map-local-context-conflict-DOYEEJ3u.mjs +204 -0
  41. package/dist/map-local-create-note-B0SeXJms.mjs +214 -0
  42. package/dist/{metrics-B9N27cCB.mjs → metrics-CISXCvB1.mjs} +1 -1
  43. package/dist/{middleware-TeLjzoxn.mjs → middleware-CzvJvPHK.mjs} +58 -15
  44. package/dist/{middleware-Cd_vPqDH.mjs → middleware-DkrU2WhY.mjs} +1 -1
  45. package/dist/{middleware-CPTDFMmJ.js → middleware-DsfWajaD.js} +593 -18
  46. package/dist/{mod-DypxPS9H.d.ts → mod-C0BYc0OU.d.ts} +1 -1
  47. package/dist/{mod-CnGLNoVw.d.cts → mod-CbKDOnCt.d.cts} +1 -1
  48. package/dist/{mod-CLHkCwLm.d.cts → mod-CyiSjRkk.d.cts} +1 -1
  49. package/dist/{mod-CSH1Ee-I.d.ts → mod-D882_Xsg.d.ts} +1 -1
  50. package/dist/{mod-DzRXACM5.d.ts → mod-UDwMjuHM.d.ts} +1 -1
  51. package/dist/{mod-BZldCEU0.d.cts → mod-x9W0d0Pk.d.cts} +1 -1
  52. package/dist/mod.cjs +20 -20
  53. package/dist/mod.d.cts +6 -6
  54. package/dist/mod.d.ts +6 -6
  55. package/dist/mod.js +5 -5
  56. package/dist/nodeinfo/client.test.mjs +28 -1
  57. package/dist/nodeinfo/handler.test.mjs +1 -1
  58. package/dist/nodeinfo/mod.cjs +1 -1
  59. package/dist/nodeinfo/mod.js +1 -1
  60. package/dist/{owner-DGSfntI-.d.ts → owner-BF0L9cMt.d.cts} +12 -1
  61. package/dist/{proof-BO_esQii.js → owner-BIPEZGiU.js} +1255 -1098
  62. package/dist/{owner-r_waTiQj.d.cts → owner-BSzr5-I8.d.ts} +12 -1
  63. package/dist/owner-CRoq8Spb.mjs +175 -0
  64. package/dist/{proof-Dua0d906.cjs → owner-CVA7L9MA.cjs} +1266 -1097
  65. package/dist/{proof-D5Ajk4DJ.mjs → proof-BDxNVZ3E.mjs} +186 -83
  66. package/dist/{send-DVXyUqhO.mjs → send-BzM5GLyn.mjs} +68 -11
  67. package/dist/sig/compound-proof-discovery.test.d.mts +2 -0
  68. package/dist/sig/compound-proof-discovery.test.mjs +331 -0
  69. package/dist/sig/compound-proof-verification.test.d.mts +2 -0
  70. package/dist/sig/compound-proof-verification.test.mjs +465 -0
  71. package/dist/sig/compound-proof.test.d.mts +2 -0
  72. package/dist/sig/compound-proof.test.mjs +324 -0
  73. package/dist/sig/http.test.mjs +2 -2
  74. package/dist/sig/key.test.mjs +169 -2
  75. package/dist/sig/ld.test.mjs +55 -2
  76. package/dist/sig/mod.cjs +17 -17
  77. package/dist/sig/mod.d.cts +3 -3
  78. package/dist/sig/mod.d.ts +3 -3
  79. package/dist/sig/mod.js +2 -2
  80. package/dist/sig/owner.test.mjs +103 -4
  81. package/dist/sig/proof.test.mjs +120 -1
  82. package/dist/{temporal-BoDw51A-.mjs → temporal-Dv6Qv-8k.mjs} +1 -1
  83. package/dist/testing/kv.test.mjs +1 -1
  84. package/dist/testing/mod.d.mts +2 -1
  85. package/dist/{types-RXm5YxpC.cjs → types-Be2zbyeG.cjs} +94 -2
  86. package/dist/{types-Dtyf8lVj.js → types-C_cNlNVK.js} +78 -4
  87. package/dist/utils/docloader.test.mjs +27 -3
  88. package/dist/utils/kv-cache.test.mjs +1 -1
  89. package/dist/utils/mod.cjs +1 -1
  90. package/dist/utils/mod.d.cts +1 -1
  91. package/dist/utils/mod.d.ts +1 -1
  92. package/dist/utils/mod.js +1 -1
  93. package/package.json +6 -6
  94. package/dist/owner-DTEqTzSr.mjs +0 -120
@@ -0,0 +1,214 @@
1
+ import "temporal-polyfill";
2
+ import "urlpattern-polyfill";
3
+ globalThis.addEventListener = () => {};
4
+ //#region test-vectors/fep-8b32/map-local-create-note.json
5
+ var map_local_create_note_default = {
6
+ id: "fedify-fep-8b32-map-local-create-note-v1",
7
+ profile: "Fedify map-local compound proof profile",
8
+ cryptosuite: "eddsa-jcs-2022",
9
+ notes: [
10
+ "Each map has one direct literal proof property.",
11
+ "Each map has an explicit local context.",
12
+ "The outer unsecured document retains the complete secured inner map.",
13
+ "Combined inputs concatenate proof-configuration SHA-256 first and document SHA-256 second."
14
+ ],
15
+ keys: {
16
+ "outer": {
17
+ "controller": "did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
18
+ "verificationMethod": "did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
19
+ "publicKeyMultibase": "z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
20
+ "publicKeyJwk": {
21
+ "kty": "OKP",
22
+ "crv": "Ed25519",
23
+ "x": "sA2Nk45_dz1RVlqtNqYj9TRPf10ZYPnPPo4SYg6igQ8",
24
+ "key_ops": ["verify"],
25
+ "ext": true
26
+ },
27
+ "testPrivateKeyJwk": {
28
+ "kty": "OKP",
29
+ "crv": "Ed25519",
30
+ "d": "yW756hDF5BTEcXI6_53nLDX6W3D66X6IMuysfS4rjtY",
31
+ "x": "sA2Nk45_dz1RVlqtNqYj9TRPf10ZYPnPPo4SYg6igQ8",
32
+ "key_ops": ["sign"],
33
+ "ext": true
34
+ }
35
+ },
36
+ "inner": {
37
+ "controller": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
38
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
39
+ "publicKeyMultibase": "z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
40
+ "publicKeyJwk": {
41
+ "kty": "OKP",
42
+ "crv": "Ed25519",
43
+ "x": "LR8epAGDe-cVq5p2Tx49CCfphpk1rNhkNoY9i-XEUfg",
44
+ "key_ops": ["verify"],
45
+ "ext": true
46
+ },
47
+ "testPrivateKeyJwk": {
48
+ "kty": "OKP",
49
+ "crv": "Ed25519",
50
+ "d": "LledL195fP9TQGQrkE2l2Y2k48UvqCzYI9M1zXyh7zQ",
51
+ "x": "LR8epAGDe-cVq5p2Tx49CCfphpk1rNhkNoY9i-XEUfg",
52
+ "key_ops": ["sign"],
53
+ "ext": true
54
+ }
55
+ }
56
+ },
57
+ documents: {
58
+ "finalSecuredCompound": {
59
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
60
+ "id": "ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/activities/1",
61
+ "type": "Create",
62
+ "actor": "ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/actor",
63
+ "object": {
64
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
65
+ "id": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1",
66
+ "type": "Note",
67
+ "attributedTo": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor",
68
+ "content": "A portable note",
69
+ "proof": {
70
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
71
+ "type": "DataIntegrityProof",
72
+ "cryptosuite": "eddsa-jcs-2022",
73
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
74
+ "proofPurpose": "assertionMethod",
75
+ "created": "2023-02-24T23:36:38Z",
76
+ "proofValue": "z2GCde7JjRjsTipz43CEeCjiDF7NCGbAcvqAkwuywq2u1mQTXs7U9WeT3jXmi6ib6uqpdiT53CxFrkSPLsHiQxhk7"
77
+ }
78
+ },
79
+ "proof": {
80
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
81
+ "type": "DataIntegrityProof",
82
+ "cryptosuite": "eddsa-jcs-2022",
83
+ "verificationMethod": "did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
84
+ "proofPurpose": "assertionMethod",
85
+ "created": "2023-02-24T23:36:38Z",
86
+ "proofValue": "z5KEH1yoB2DsDs39emBhGJM2GqgM9waar91Mj34gqaa238KgyyEvyTrVvBTWKxHxR5Xin6X8tPYr4Ucb6WDzBkMMz"
87
+ }
88
+ },
89
+ "securedInner": {
90
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
91
+ "id": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1",
92
+ "type": "Note",
93
+ "attributedTo": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor",
94
+ "content": "A portable note",
95
+ "proof": {
96
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
97
+ "type": "DataIntegrityProof",
98
+ "cryptosuite": "eddsa-jcs-2022",
99
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
100
+ "proofPurpose": "assertionMethod",
101
+ "created": "2023-02-24T23:36:38Z",
102
+ "proofValue": "z2GCde7JjRjsTipz43CEeCjiDF7NCGbAcvqAkwuywq2u1mQTXs7U9WeT3jXmi6ib6uqpdiT53CxFrkSPLsHiQxhk7"
103
+ }
104
+ },
105
+ "outerUnsecuredDocument": {
106
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
107
+ "id": "ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/activities/1",
108
+ "type": "Create",
109
+ "actor": "ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/actor",
110
+ "object": {
111
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
112
+ "id": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1",
113
+ "type": "Note",
114
+ "attributedTo": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor",
115
+ "content": "A portable note",
116
+ "proof": {
117
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
118
+ "type": "DataIntegrityProof",
119
+ "cryptosuite": "eddsa-jcs-2022",
120
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
121
+ "proofPurpose": "assertionMethod",
122
+ "created": "2023-02-24T23:36:38Z",
123
+ "proofValue": "z2GCde7JjRjsTipz43CEeCjiDF7NCGbAcvqAkwuywq2u1mQTXs7U9WeT3jXmi6ib6uqpdiT53CxFrkSPLsHiQxhk7"
124
+ }
125
+ }
126
+ },
127
+ "innerUnsecuredDocument": {
128
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
129
+ "id": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1",
130
+ "type": "Note",
131
+ "attributedTo": "ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor",
132
+ "content": "A portable note"
133
+ },
134
+ "outerProofConfiguration": {
135
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
136
+ "type": "DataIntegrityProof",
137
+ "cryptosuite": "eddsa-jcs-2022",
138
+ "verificationMethod": "did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2",
139
+ "proofPurpose": "assertionMethod",
140
+ "created": "2023-02-24T23:36:38Z"
141
+ },
142
+ "innerProofConfiguration": {
143
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
144
+ "type": "DataIntegrityProof",
145
+ "cryptosuite": "eddsa-jcs-2022",
146
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
147
+ "proofPurpose": "assertionMethod",
148
+ "created": "2023-02-24T23:36:38Z"
149
+ },
150
+ "replacementInnerProof": {
151
+ "@context": ["https://www.w3.org/ns/activitystreams", "https://w3id.org/security/data-integrity/v1"],
152
+ "type": "DataIntegrityProof",
153
+ "cryptosuite": "eddsa-jcs-2022",
154
+ "verificationMethod": "did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3",
155
+ "proofPurpose": "assertionMethod",
156
+ "created": "2023-02-25T23:36:38Z",
157
+ "proofValue": "z2fmC2UAoxpesDmSJ6LWoRReCRhPGCKTHgBCsq1491B2Hx2SN8MszWgfcgJkF1poPnyhFAEGrpeqGWchiw261np9z"
158
+ }
159
+ },
160
+ canonicalization: {
161
+ "outer": {
162
+ "documentJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"actor\":\"ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/actor\",\"id\":\"ap+ef61://did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2/activities/1\",\"object\":{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"attributedTo\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor\",\"content\":\"A portable note\",\"id\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1\",\"proof\":{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"created\":\"2023-02-24T23:36:38Z\",\"cryptosuite\":\"eddsa-jcs-2022\",\"proofPurpose\":\"assertionMethod\",\"proofValue\":\"z2GCde7JjRjsTipz43CEeCjiDF7NCGbAcvqAkwuywq2u1mQTXs7U9WeT3jXmi6ib6uqpdiT53CxFrkSPLsHiQxhk7\",\"type\":\"DataIntegrityProof\",\"verificationMethod\":\"did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3\"},\"type\":\"Note\"},\"type\":\"Create\"}",
163
+ "proofConfigurationJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"created\":\"2023-02-24T23:36:38Z\",\"cryptosuite\":\"eddsa-jcs-2022\",\"proofPurpose\":\"assertionMethod\",\"type\":\"DataIntegrityProof\",\"verificationMethod\":\"did:key:z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2#z6MkrJVnaZkeFzdQyMZu1cgjg7k1pZZ6pvBQ7XJPt4swbTQ2\"}"
164
+ },
165
+ "inner": {
166
+ "documentJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"attributedTo\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor\",\"content\":\"A portable note\",\"id\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1\",\"type\":\"Note\"}",
167
+ "proofConfigurationJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"created\":\"2023-02-24T23:36:38Z\",\"cryptosuite\":\"eddsa-jcs-2022\",\"proofPurpose\":\"assertionMethod\",\"type\":\"DataIntegrityProof\",\"verificationMethod\":\"did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3\"}"
168
+ },
169
+ "replacementInner": {
170
+ "documentJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"attributedTo\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/actor\",\"content\":\"A portable note\",\"id\":\"ap+ef61://did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3/objects/1\",\"type\":\"Note\"}",
171
+ "proofConfigurationJcs": "{\"@context\":[\"https://www.w3.org/ns/activitystreams\",\"https://w3id.org/security/data-integrity/v1\"],\"created\":\"2023-02-25T23:36:38Z\",\"cryptosuite\":\"eddsa-jcs-2022\",\"proofPurpose\":\"assertionMethod\",\"type\":\"DataIntegrityProof\",\"verificationMethod\":\"did:key:z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3#z6MkhVPuyvgG1RkMv67azDqDCDERPXVrUg1i3qchXY5EACE3\"}"
172
+ }
173
+ },
174
+ hashes: {
175
+ "outer": {
176
+ "documentSha256": "f49f8c592c02d0ee85b7f7182fd593ddf6e7f432d8388843e4d086238f45bafc",
177
+ "proofConfigurationSha256": "c9842a6bca0a0594e99f1525344ce4f0c8c6096f5a832525a05205aacd8791e0",
178
+ "combinedSigningInput": "c9842a6bca0a0594e99f1525344ce4f0c8c6096f5a832525a05205aacd8791e0f49f8c592c02d0ee85b7f7182fd593ddf6e7f432d8388843e4d086238f45bafc"
179
+ },
180
+ "inner": {
181
+ "documentSha256": "9c9ffa1efcc871d219b8622e98253168ac65867ee76d6e4183ee0ca0226c2fd3",
182
+ "proofConfigurationSha256": "1ebdc71cb480bd324b030f85c02dc6f8db879716faf0f7ee0f05df4c395d71b4",
183
+ "combinedSigningInput": "1ebdc71cb480bd324b030f85c02dc6f8db879716faf0f7ee0f05df4c395d71b49c9ffa1efcc871d219b8622e98253168ac65867ee76d6e4183ee0ca0226c2fd3"
184
+ },
185
+ "replacementInner": {
186
+ "documentSha256": "9c9ffa1efcc871d219b8622e98253168ac65867ee76d6e4183ee0ca0226c2fd3",
187
+ "proofConfigurationSha256": "00da7da35af5e922313de14cf0f8f63c9a27152205b1eb5ef049a7f6023589ad",
188
+ "combinedSigningInput": "00da7da35af5e922313de14cf0f8f63c9a27152205b1eb5ef049a7f6023589ad9c9ffa1efcc871d219b8622e98253168ac65867ee76d6e4183ee0ca0226c2fd3"
189
+ }
190
+ },
191
+ proofValues: {
192
+ "outer": "z5KEH1yoB2DsDs39emBhGJM2GqgM9waar91Mj34gqaa238KgyyEvyTrVvBTWKxHxR5Xin6X8tPYr4Ucb6WDzBkMMz",
193
+ "inner": "z2GCde7JjRjsTipz43CEeCjiDF7NCGbAcvqAkwuywq2u1mQTXs7U9WeT3jXmi6ib6uqpdiT53CxFrkSPLsHiQxhk7",
194
+ "replacementInner": "z2fmC2UAoxpesDmSJ6LWoRReCRhPGCKTHgBCsq1491B2Hx2SN8MszWgfcgJkF1poPnyhFAEGrpeqGWchiw261np9z"
195
+ },
196
+ expectedVerification: {
197
+ "original": {
198
+ "inner": true,
199
+ "outer": true
200
+ },
201
+ "tamperedInnerContent": {
202
+ "inner": false,
203
+ "outer": false
204
+ },
205
+ "replacedInnerProof": {
206
+ "inner": true,
207
+ "outer": false
208
+ },
209
+ "standaloneInner": true,
210
+ "standaloneOuter": true
211
+ }
212
+ };
213
+ //#endregion
214
+ export { map_local_create_note_default as t };
@@ -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-CtG93ohj.mjs";
4
+ import { n as version, t as name } from "./deno-CABhzCb_.mjs";
5
5
  import { metrics } from "@opentelemetry/api";
6
6
  import { FetchError } from "@fedify/vocab-runtime";
7
7
  //#region src/federation/metrics.ts
@@ -1,26 +1,27 @@
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-CtG93ohj.mjs";
5
- 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-B9N27cCB.mjs";
4
+ import { n as version, t as name } from "./deno-CABhzCb_.mjs";
5
+ 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-CISXCvB1.mjs";
6
6
  import { t as formatAcceptSignature } from "./accept-CPVqki78.mjs";
7
- import { a as importJwk, o as validateCryptoKey, t as exportJwk } from "./key-BVjgbs_9.mjs";
8
- import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-D7LX-BL9.mjs";
9
- import { t as getAuthenticatedDocumentLoader } from "./docloader-dk_k3S8d.mjs";
10
- import { n as kvCache } from "./kv-cache-xRcC_xxP.mjs";
7
+ import { o as importJwk, s as validateCryptoKey, t as exportJwk } from "./key-Ccs8cnd7.mjs";
8
+ import { l as verifyRequest, o as parseRfc9421SignatureInput, u as verifyRequestDetailed } from "./http-D9urSO2D.mjs";
9
+ import { t as getAuthenticatedDocumentLoader } from "./docloader-BbGSL0Xq.mjs";
10
+ import { n as kvCache } from "./kv-cache-lKyFn_Dn.mjs";
11
11
  import { r as normalizeOutgoingActivityJsonLd } from "./outgoing-jsonld-B5Ne7JoL.mjs";
12
- import { t as getNodeInfo } from "./client-CtxvmazV.mjs";
12
+ import { d as readBoundedText, l as BodyTooLargeError, t as getNodeInfo, u as MAX_BODY_SIZE } from "./client-DpnpgjyX.mjs";
13
13
  import { t as nodeInfoToJson } from "./types-DE_LV1JB.mjs";
14
- import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-OuCeQFny.mjs";
15
- import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-DTEqTzSr.mjs";
16
- import { i as verifyObject, n as hasProofLike, r as signObject } from "./proof-D5Ajk4DJ.mjs";
17
- import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-DVXyUqhO.mjs";
18
- import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-B4zpKIFU.mjs";
14
+ import { _ as wrapContextLoaderForJsonLd, a as compactJsonLd, c as getNormalizationContextLoader, d as isClearlyMalformedContextReference, f as isInvalidUrlTypeError, l as hasSignature, m as verifyCompactJsonLd, p as signJsonLd, r as assertSafeJsonLd, s as detachSignature, t as InvalidContextReferenceError, u as hasSignatureLike } from "./ld-qup__MAW.mjs";
15
+ import { n as getKeyOwner, t as doesActorOwnKey } from "./owner-CRoq8Spb.mjs";
16
+ import { a as verifyObject, n as hasProofLike, r as signObject } from "./proof-BDxNVZ3E.mjs";
17
+ import { n as extractInboxes, r as sendActivity, t as SendActivityError } from "./send-BzM5GLyn.mjs";
18
+ import { n as FederationBuilderImpl, t as ACTOR_ALIAS_PREFIX } from "./builder-D0DxgOV5.mjs";
19
19
  import { t as CircuitBreaker } from "./circuit-breaker-C5NqoLBJ.mjs";
20
20
  import { t as buildCollectionSynchronizationHeader } from "./collection-CnnP1UAv.mjs";
21
- import { t as KvKeyCache } from "./keycache-ZLqIfrkL.mjs";
21
+ import { n as inspectCompoundPortableObjectApplicability, r as verifyCompoundPortableObjectProofs } from "./compound-proof-CJnWc6c-.mjs";
22
+ import { t as KvKeyCache } from "./keycache-BUDHB5rY.mjs";
22
23
  import { t as acceptsJsonLd } from "./negotiation-CCocWT_N.mjs";
23
- import { t as hasMalformedKnownTemporalLiteral } from "./temporal-BoDw51A-.mjs";
24
+ import { t as hasMalformedKnownTemporalLiteral } from "./temporal-Dv6Qv-8k.mjs";
24
25
  import { t as createExponentialBackoffPolicy } from "./retry-zX5xw5e0.mjs";
25
26
  import { t as TaskCodec } from "./codec-C6rTrpIp.mjs";
26
27
  import { getLogger, withContext } from "@logtape/logtape";
@@ -513,6 +514,12 @@ async function routeActivity({ context: ctx, json, originalJson, normalizedActiv
513
514
  //#endregion
514
515
  //#region src/federation/handler.ts
515
516
  const rawInboxContextFactorySymbol = Symbol("fedify.rawInboxContextFactory");
517
+ const INBOX_COMPOUND_PROOF_LIMITS = {
518
+ maxDepth: 64,
519
+ maxMaps: 1e4,
520
+ maxProofs: 32,
521
+ maxBytes: 10 * 1024 * 1024
522
+ };
516
523
  function isRemoteContextLoadingFailure$1(error) {
517
524
  return error instanceof Error && typeof error.details === "object" && error.details != null && error.details.code === "loading remote context failed";
518
525
  }
@@ -1293,8 +1300,16 @@ async function handleInboxInternal(request, parameters, span) {
1293
1300
  }
1294
1301
  let json;
1295
1302
  try {
1296
- json = await request.clone().json();
1303
+ json = JSON.parse(await readBoundedText(request.clone(), MAX_BODY_SIZE, request.url));
1297
1304
  } catch (error) {
1305
+ if (error instanceof BodyTooLargeError) {
1306
+ request.body?.cancel(error).catch(() => {});
1307
+ span.setStatus({
1308
+ code: SpanStatusCode.ERROR,
1309
+ message: String(error)
1310
+ });
1311
+ return new Response("Inbox body too large.", { status: 413 });
1312
+ }
1298
1313
  logger.error("Failed to parse JSON:\n{error}", {
1299
1314
  recipient,
1300
1315
  error
@@ -1626,6 +1641,31 @@ async function handleInboxInternal(request, parameters, span) {
1626
1641
  headers: { "Content-Type": "text/plain; charset=utf-8" }
1627
1642
  });
1628
1643
  }
1644
+ if (!skipSignatureVerification) {
1645
+ if (inspectCompoundPortableObjectApplicability(json, INBOX_COMPOUND_PROOF_LIMITS) !== "absent") {
1646
+ const compoundProof = await verifyCompoundPortableObjectProofs(json, INBOX_COMPOUND_PROOF_LIMITS, {
1647
+ documentLoader: ctx.documentLoader,
1648
+ keyCache,
1649
+ meterProvider,
1650
+ tracerProvider
1651
+ });
1652
+ if (compoundProof.status !== "ok" || !compoundProof.verified) {
1653
+ logger.error("Failed to verify compound portable Object Integrity Proofs.", {
1654
+ recipient,
1655
+ activity: json,
1656
+ reason: compoundProof.status === "unsupported" ? compoundProof.reason.type : "invalidProof"
1657
+ });
1658
+ span.setStatus({
1659
+ code: SpanStatusCode.ERROR,
1660
+ message: "Failed to verify compound portable Object Integrity Proofs."
1661
+ });
1662
+ return new Response("Failed to verify compound portable Object Integrity Proofs.", {
1663
+ status: 401,
1664
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
1665
+ });
1666
+ }
1667
+ }
1668
+ }
1629
1669
  if (pendingNonceLabel != null) {
1630
1670
  if (!await verifySignatureNonce(request, kv, kvPrefixes.acceptSignatureNonce, pendingNonceLabel)) {
1631
1671
  getFederationMetrics(parameters.meterProvider).recordSignatureVerificationFailure("invalidNonce", httpSigKey?.id == null ? void 0 : getRemoteHost(httpSigKey.id));
@@ -3357,6 +3397,7 @@ var FederationImpl = class extends FederationBuilderImpl {
3357
3397
  if (decision.stateChange != null) recordCircuitBreakerSpanEvent(span, remoteHost, decision.stateChange);
3358
3398
  }
3359
3399
  await sendActivity({
3400
+ allowPrivateAddress: this.allowPrivateAddress,
3360
3401
  keys,
3361
3402
  activity: message.activity,
3362
3403
  activityId: message.activityId,
@@ -3978,6 +4019,7 @@ var FederationImpl = class extends FederationBuilderImpl {
3978
4019
  });
3979
4020
  const promises = [];
3980
4021
  for (const inbox in inboxes) promises.push(sendActivity({
4022
+ allowPrivateAddress: this.allowPrivateAddress,
3981
4023
  keys,
3982
4024
  activity: jsonLd,
3983
4025
  activityId: activity.id?.href,
@@ -5312,6 +5354,7 @@ async function forwardActivityInternal(ctx, loggerCategory, forwarder, recipient
5312
5354
  else logger.debug("Forwarding activity immediately without queue since queue is not set.");
5313
5355
  const promises = [];
5314
5356
  for (const inbox in inboxes) promises.push(sendActivity({
5357
+ allowPrivateAddress: ctx.federation.allowPrivateAddress,
5315
5358
  keys,
5316
5359
  activity: ctx.activity,
5317
5360
  activityId: ctx.activityId,
@@ -1,5 +1,5 @@
1
1
  import "temporal-polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as FederationImpl } from "./middleware-TeLjzoxn.mjs";
4
+ import { n as FederationImpl } from "./middleware-CzvJvPHK.mjs";
5
5
  export { FederationImpl };