@tinycloud/node-sdk 3.9.0 → 3.9.1-beta.0

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/core.cjs CHANGED
@@ -460,6 +460,7 @@ function pkhSpaceIdentity(spaceId) {
460
460
  }
461
461
  var DECRYPT_ACTION = import_sdk_core5.ENCRYPTION.DECRYPT;
462
462
  var NETWORK_CREATE_ACTION = import_sdk_core5.ENCRYPTION.NETWORK_CREATE;
463
+ var KEY_CREATE_ACTION = "tinycloud.encryption/key.create";
463
464
  function describeHostFailure(result) {
464
465
  const text = result.error?.trim();
465
466
  return text ? `${result.status} - ${text}` : `${result.status}`;
@@ -1101,7 +1102,7 @@ var NodeUserAuthorization = class {
1101
1102
  return true;
1102
1103
  }
1103
1104
  const parsed = entry.path.includes("/") ? (0, import_resource.parseEncryptionResource)(entry.path) : { ...(0, import_sdk_services2.parseNetworkId)(entry.path), kind: "network" };
1104
- const sharePrefix = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share" && entry.actions.length === 1 && entry.actions[0] === DECRYPT_ACTION && didPrincipalMatches(parsed.ownerDid, currentDid);
1105
+ const sharePrefix = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share" && entry.actions.length > 0 && entry.actions.every((action) => action === DECRYPT_ACTION || action === KEY_CREATE_ACTION) && didPrincipalMatches(parsed.ownerDid, currentDid);
1105
1106
  if (parsed.kind !== "network" && !sharePrefix) {
1106
1107
  throw new import_sdk_core5.ManifestValidationError("named keys go in manifest.keys");
1107
1108
  }