@tinycloud/node-sdk 2.4.0-beta.2 → 2.4.0-beta.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/{core-BucTrpWH.d.cts → core-ClOKiSR_.d.cts} +2 -0
- package/dist/{core-BucTrpWH.d.ts → core-ClOKiSR_.d.ts} +2 -0
- package/dist/core.cjs +17 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +17 -1
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1538,6 +1538,8 @@ declare class TinyCloudNode {
|
|
|
1538
1538
|
private findGrantForOperation;
|
|
1539
1539
|
private pruneExpiredRuntimePermissionGrants;
|
|
1540
1540
|
private operationCovers;
|
|
1541
|
+
private spaceIdsEqual;
|
|
1542
|
+
private normalizeSpaceAddress;
|
|
1541
1543
|
private actionContains;
|
|
1542
1544
|
private invocationServiceName;
|
|
1543
1545
|
private isEncryptionNetworkOperation;
|
|
@@ -1538,6 +1538,8 @@ declare class TinyCloudNode {
|
|
|
1538
1538
|
private findGrantForOperation;
|
|
1539
1539
|
private pruneExpiredRuntimePermissionGrants;
|
|
1540
1540
|
private operationCovers;
|
|
1541
|
+
private spaceIdsEqual;
|
|
1542
|
+
private normalizeSpaceAddress;
|
|
1541
1543
|
private actionContains;
|
|
1542
1544
|
private invocationServiceName;
|
|
1543
1545
|
private isEncryptionNetworkOperation;
|
package/dist/core.cjs
CHANGED
|
@@ -4088,7 +4088,23 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
4088
4088
|
if (granted.resource !== void 0 || requested.resource !== void 0) {
|
|
4089
4089
|
return granted.resource !== void 0 && requested.resource !== void 0 && granted.resource === requested.resource && this.pathContains(granted.path, requested.path);
|
|
4090
4090
|
}
|
|
4091
|
-
return granted.spaceId !== void 0 && requested.spaceId !== void 0 && granted.spaceId
|
|
4091
|
+
return granted.spaceId !== void 0 && requested.spaceId !== void 0 && this.spaceIdsEqual(granted.spaceId, requested.spaceId) && this.pathContains(granted.path, requested.path);
|
|
4092
|
+
}
|
|
4093
|
+
// Space IDs are `tinycloud:pkh:eip155:<chain>:<0xADDR>:<name>`. The embedded
|
|
4094
|
+
// EIP-155 address is case-insensitive, but the CLI canonicalizes it to
|
|
4095
|
+
// lowercase when building a space URI while stored runtime delegations keep
|
|
4096
|
+
// the EIP-55 checksummed form — so a byte-for-byte compare spuriously rejects
|
|
4097
|
+
// an otherwise-valid grant. Lowercase ONLY the `eip155:<chain>:0x<addr>`
|
|
4098
|
+
// segment and leave everything else (crucially the case-sensitive space NAME)
|
|
4099
|
+
// byte-exact. Mirrors the CLI's `normalizeSpaceForCompare` (OPENKEY_SCOPE_MISMATCH fix).
|
|
4100
|
+
spaceIdsEqual(a, b) {
|
|
4101
|
+
return this.normalizeSpaceAddress(a) === this.normalizeSpaceAddress(b);
|
|
4102
|
+
}
|
|
4103
|
+
normalizeSpaceAddress(space) {
|
|
4104
|
+
return space.replace(
|
|
4105
|
+
/(eip155:\d+:)(0x[0-9a-fA-F]{40})/,
|
|
4106
|
+
(_match, prefix, addr) => prefix + addr.toLowerCase()
|
|
4107
|
+
);
|
|
4092
4108
|
}
|
|
4093
4109
|
actionContains(grantedAction, requestedAction) {
|
|
4094
4110
|
if (grantedAction === requestedAction) {
|