@tinycloud/node-sdk 3.3.0-beta.31 → 3.3.0-beta.34

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/index.cjs CHANGED
@@ -18243,24 +18243,17 @@ function signedAuthorityFromCompactUcan(authorization) {
18243
18243
  ));
18244
18244
  continue;
18245
18245
  }
18246
- const nativeMatch = /^(tinycloud:[^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
18247
- const policyMatch = /^tinycloud:\/\/([^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
18248
- const match = nativeMatch ?? policyMatch;
18246
+ const match = /^(?:tinycloud:\/\/([^/]+)|(tinycloud:[^/]+))\/(kv|sql|duckdb|hooks)(?:\/|$)(.*)$/.exec(resource);
18249
18247
  if (!match) {
18250
18248
  throw new Error(
18251
18249
  `Validated runtime delegation has an unsupported signed resource '${resource}'.`
18252
18250
  );
18253
18251
  }
18254
- const [, space, shortService, path] = match;
18252
+ const [, policySpace, nativeSpace, shortService, path] = match;
18255
18253
  const service = SERVICE_BY_SHORT_NAME[shortService];
18256
- if (service === void 0) {
18257
- throw new Error(
18258
- `Validated runtime delegation has an unsupported signed service '${shortService}'.`
18259
- );
18260
- }
18261
18254
  permissions.push(...groupedSignedEntries(
18262
18255
  service,
18263
- space,
18256
+ nativeSpace ?? policySpace,
18264
18257
  path,
18265
18258
  abilities
18266
18259
  ));