@storacha/clawracha 0.3.1 → 0.3.3
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/sync.d.ts.map +1 -1
- package/dist/sync.js +3 -3
- package/dist/utils/crypto.js +2 -2
- package/package.json +1 -1
package/dist/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAEV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAEV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAS1B,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA2BxE,qBAAa,UAAU;IACrB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,KAAK,CAAiD;IAC9D,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,QAAQ,CAAoC;IACpD,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,gBAAgB,CAAC,CAAmB;IAC5C,OAAO,CAAC,eAAe,CAAC,CAAkB;gBAE9B,SAAS,EAAE,MAAM;IAK7B;;;OAGG;IACG,IAAI,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IA+D/C;;OAEG;IACH,OAAO,CAAC,cAAc;IAOtB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;;OAGG;IACG,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgB1D;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YAMb,UAAU;IAwDxB;;OAEG;YACW,iBAAiB;IAe/B;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC;IAc5C;;OAEG;YACW,kBAAkB;IAYhC;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;YAMrB,gBAAgB;IA4B9B;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC;QACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACpB,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC/B,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC5D,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;IAkBI,MAAM,IAAI,OAAO,CAAC,SAAS,CAAC;IAW5B,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;YAM5B,WAAW;CAK1B"}
|
package/dist/sync.js
CHANGED
|
@@ -19,7 +19,7 @@ import { makeTempCar } from "./utils/tempcar.js";
|
|
|
19
19
|
import { createStorachaClient } from "./utils/client.js";
|
|
20
20
|
import { decodeDelegation, encodeDelegation } from "./utils/delegation.js";
|
|
21
21
|
import { extract } from "@storacha/client/delegation";
|
|
22
|
-
import { makeEncryptionConfig, makeDecryptionConfig, getEncryptedClient } from "./utils/crypto.js";
|
|
22
|
+
import { makeEncryptionConfig, makeDecryptionConfig, getEncryptedClient, } from "./utils/crypto.js";
|
|
23
23
|
export class SyncEngine {
|
|
24
24
|
workspace;
|
|
25
25
|
blocks;
|
|
@@ -71,12 +71,12 @@ export class SyncEngine {
|
|
|
71
71
|
const { ok: planDel } = await extract(planBytes);
|
|
72
72
|
if (!planDel)
|
|
73
73
|
throw new Error("Failed to extract plan delegation");
|
|
74
|
-
this.encryptionConfig = makeEncryptionConfig(agent, config.spaceDID, [planDel]);
|
|
75
|
-
// For decrypt, uploadDelegation covers space/content/decrypt
|
|
76
74
|
const uploadBytes = decodeDelegation(config.uploadDelegation);
|
|
77
75
|
const { ok: uploadDel } = await extract(uploadBytes);
|
|
78
76
|
if (!uploadDel)
|
|
79
77
|
throw new Error("Failed to extract upload delegation");
|
|
78
|
+
this.encryptionConfig = makeEncryptionConfig(agent, config.spaceDID, [planDel, uploadDel]);
|
|
79
|
+
// For decrypt, uploadDelegation covers space/content/decrypt
|
|
80
80
|
this.decryptionConfig = makeDecryptionConfig(config.spaceDID, uploadDel);
|
|
81
81
|
this.encryptedClient = await getEncryptedClient(storachaClient);
|
|
82
82
|
}
|
package/dist/utils/crypto.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { createGenericKMSAdapter } from "@storacha/encrypt-upload-client/factories.node";
|
|
6
6
|
import { create as createEncryptedClient } from "@storacha/encrypt-upload-client";
|
|
7
7
|
import { encryptFile, encryptedBlockStream, } from "@storacha/encrypt-upload-client/utils/encrypt";
|
|
8
|
-
const KMS_SERVICE_URL = "https://kms.
|
|
9
|
-
const KMS_SERVICE_DID = "did:
|
|
8
|
+
const KMS_SERVICE_URL = "https://ucan-kms-production.protocol-labs.workers.dev";
|
|
9
|
+
const KMS_SERVICE_DID = "did:key:z6MksQJobJmBfPhjHWgFXVppqM6Fcjc1k7xu4z6xvusVrtKv";
|
|
10
10
|
let cachedAdapter = null;
|
|
11
11
|
export function getKMSCryptoAdapter() {
|
|
12
12
|
if (cachedAdapter)
|