@fedify/fedify 0.11.0-dev.244 → 0.11.0-dev.245

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/CHANGES.md CHANGED
@@ -162,6 +162,10 @@ To be released.
162
162
  - Renamed `InboxListenerSetter` interface to `InboxListenerSetters`.
163
163
  - Added `InboxListenerSetters.setSharedKeyDispatcher()` method.
164
164
 
165
+ - Followed up the [change in `eddsa-jcs-2022` specification][eddsa-jcs-2022]
166
+ for Object Integrity Proofs. [[FEP-8b32], [#54]]
167
+
168
+ [eddsa-jcs-2022]: https://codeberg.org/fediverse/fep/pulls/338
165
169
  [#71]: https://github.com/dahlia/fedify/issues/71
166
170
  [#74]: https://github.com/dahlia/fedify/issues/74
167
171
  [#76]: https://github.com/dahlia/fedify/pull/76
package/esm/sig/proof.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
+ import { Activity, Multikey } from "../vocab/mod.js";
3
+ import { getLogger } from "@logtape/logtape";
2
4
  // @ts-ignore: json-canon is not typed
3
5
  import serialize from "json-canon";
4
6
  import { DataIntegrityProof } from "../vocab/vocab.js";
5
7
  import { fetchKey, validateCryptoKey } from "./key.js";
6
- import { Activity, Multikey } from "../vocab/mod.js";
7
- import { getLogger } from "@logtape/logtape";
8
8
  const logger = getLogger(["fedify", "sig", "proof"]);
9
9
  /**
10
10
  * Creates a proof for the given object.
@@ -32,13 +32,8 @@ export async function createProof(object, privateKey, keyId, { contextLoader, co
32
32
  const msgDigest = await dntShim.crypto.subtle.digest("SHA-256", msgBytes);
33
33
  created ??= dntShim.Temporal.Now.instant();
34
34
  const proofConfig = {
35
- // The below commented out line is needed according to section 3.3.1 of
36
- // the Data Integrity EdDSA Cryptosuites v1.0 spec, the FEP-8b32 spec does
37
- // not reflect this step; however, the FEP-8b32 spec will be updated to
38
- // be consistent with the Data Integrity EdDSA Cryptosuites v1.0 spec
39
- // some time soon. Before that happens, the below line is commented out.
40
- // See also: https://socialhub.activitypub.rocks/t/fep-8b32-object-integrity-proofs/2725/91?u=hongminhee
41
- // "@context": (compactMsg as any)["@context"],
35
+ // deno-lint-ignore no-explicit-any
36
+ "@context": compactMsg["@context"],
42
37
  type: "DataIntegrityProof",
43
38
  cryptosuite: "eddsa-jcs-2022",
44
39
  verificationMethod: keyId.href,
@@ -98,13 +93,8 @@ export async function verifyProof(jsonLd, proof, options = {}) {
98
93
  return null;
99
94
  const publicKeyPromise = fetchKey(proof.verificationMethodId, Multikey, options);
100
95
  const proofConfig = {
101
- // The below commented out line is needed according to section 3.3.1 of
102
- // the Data Integrity EdDSA Cryptosuites v1.0 spec, the FEP-8b32 spec does
103
- // not reflect this step; however, the FEP-8b32 spec will be updated to
104
- // be consistent with the Data Integrity EdDSA Cryptosuites v1.0 spec
105
- // some time soon. Before that happens, the below line is commented out.
106
- // See also: https://socialhub.activitypub.rocks/t/fep-8b32-object-integrity-proofs/2725/91?u=hongminhee
107
- // "@context": (jsonLd as any)["@context"],
96
+ // deno-lint-ignore no-explicit-any
97
+ "@context": jsonLd["@context"],
108
98
  type: "DataIntegrityProof",
109
99
  cryptosuite: proof.cryptosuite,
110
100
  verificationMethod: proof.verificationMethodId.href,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.11.0-dev.244+df5e9468",
3
+ "version": "0.11.0-dev.245+3d6cea3b",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
  import * as dntShim from "../_dnt.shims.js";
3
+ import { Multikey } from "../vocab/mod.js";
3
4
  import type { DocumentLoader } from "../runtime/docloader.js";
4
5
  import { DataIntegrityProof, type Object } from "../vocab/vocab.js";
5
- import { Multikey } from "../vocab/mod.js";
6
6
  /**
7
7
  * Options for {@link createProof}.
8
8
  * @since 0.10.0
@@ -1 +1 @@
1
- {"version":3,"file":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