@tinycloud/node-sdk 3.3.0-beta.33 → 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/core.js CHANGED
@@ -2216,24 +2216,17 @@ function signedAuthorityFromCompactUcan(authorization) {
2216
2216
  ));
2217
2217
  continue;
2218
2218
  }
2219
- const nativeMatch = /^(tinycloud:[^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
2220
- const policyMatch = /^tinycloud:\/\/([^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
2221
- const match = nativeMatch ?? policyMatch;
2219
+ const match = /^(?:tinycloud:\/\/([^/]+)|(tinycloud:[^/]+))\/(kv|sql|duckdb|hooks)(?:\/|$)(.*)$/.exec(resource);
2222
2220
  if (!match) {
2223
2221
  throw new Error(
2224
2222
  `Validated runtime delegation has an unsupported signed resource '${resource}'.`
2225
2223
  );
2226
2224
  }
2227
- const [, space, shortService, path] = match;
2225
+ const [, policySpace, nativeSpace, shortService, path] = match;
2228
2226
  const service = SERVICE_BY_SHORT_NAME[shortService];
2229
- if (service === void 0) {
2230
- throw new Error(
2231
- `Validated runtime delegation has an unsupported signed service '${shortService}'.`
2232
- );
2233
- }
2234
2227
  permissions.push(...groupedSignedEntries(
2235
2228
  service,
2236
- space,
2229
+ nativeSpace ?? policySpace,
2237
2230
  path,
2238
2231
  abilities
2239
2232
  ));