@tinycloud/sdk-core 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/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.js.map +1 -1
- package/dist/index.cjs +21 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -7925,6 +7925,10 @@ function expandEncryptionPermissionEntry(entry) {
|
|
|
7925
7925
|
normalizedActions.push("tinycloud.encryption/network.revoke");
|
|
7926
7926
|
continue;
|
|
7927
7927
|
}
|
|
7928
|
+
if (sharePrefix && (action === "key.create" || action === "tinycloud.encryption/key.create")) {
|
|
7929
|
+
normalizedActions.push("tinycloud.encryption/key.create");
|
|
7930
|
+
continue;
|
|
7931
|
+
}
|
|
7928
7932
|
if (action.includes("/")) {
|
|
7929
7933
|
throw new ManifestValidationError(
|
|
7930
7934
|
`unknown encryption action ${JSON.stringify(action)}; expected decrypt, network.create, or network.revoke`
|
|
@@ -7942,8 +7946,20 @@ function expandEncryptionPermissionEntry(entry) {
|
|
|
7942
7946
|
seen.add(a);
|
|
7943
7947
|
}
|
|
7944
7948
|
}
|
|
7945
|
-
if (sharePrefix && dedupedActions.some((action) => action !== "tinycloud.encryption/decrypt")) {
|
|
7946
|
-
throw new ManifestValidationError("share prefix only supports decrypt");
|
|
7949
|
+
if (sharePrefix && dedupedActions.some((action) => action !== "tinycloud.encryption/decrypt" && action !== "tinycloud.encryption/key.create")) {
|
|
7950
|
+
throw new ManifestValidationError("share prefix only supports decrypt and key.create");
|
|
7951
|
+
}
|
|
7952
|
+
if (dedupedActions.includes("tinycloud.encryption/key.create")) {
|
|
7953
|
+
let canonical = false;
|
|
7954
|
+
try {
|
|
7955
|
+
const parsed = (0, import_resource.parseEncryptionResource)(entry.path);
|
|
7956
|
+
canonical = parsed.kind === "prefix" && parsed.network === "default" && parsed.prefix === "share";
|
|
7957
|
+
} catch {
|
|
7958
|
+
canonical = false;
|
|
7959
|
+
}
|
|
7960
|
+
if (!canonical) {
|
|
7961
|
+
throw new ManifestValidationError("share prefix key.create requires the canonical owner address (EIP-55 checksummed) on the default network");
|
|
7962
|
+
}
|
|
7947
7963
|
}
|
|
7948
7964
|
return [
|
|
7949
7965
|
{
|
|
@@ -7962,6 +7978,9 @@ function expandPermissionEntries(entries) {
|
|
|
7962
7978
|
}
|
|
7963
7979
|
function expandRuntimePermissionEntries(entries, ownerDid) {
|
|
7964
7980
|
return entries.flatMap((entry) => {
|
|
7981
|
+
if (entry.service === ENCRYPTION_PERMISSION_SERVICE && typeof entry.path === "string" && entry.path.endsWith("/share/") && Array.isArray(entry.actions) && entry.actions.some((action) => action === "key.create" || action === "tinycloud.encryption/key.create")) {
|
|
7982
|
+
throw new ManifestValidationError("runtime Share key creation requires the current owner's exact default/share/<id> key and key.create only");
|
|
7983
|
+
}
|
|
7965
7984
|
if (entry.service !== ENCRYPTION_PERMISSION_SERVICE || typeof entry.path !== "string" || !entry.path.includes("/") || entry.path.endsWith("/share/")) {
|
|
7966
7985
|
return expandPermissionEntry(entry);
|
|
7967
7986
|
}
|