@tinycloud/node-sdk 3.3.0-beta.33 → 3.3.0-beta.35

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
@@ -2280,24 +2280,17 @@ function signedAuthorityFromCompactUcan(authorization) {
2280
2280
  ));
2281
2281
  continue;
2282
2282
  }
2283
- const nativeMatch = /^(tinycloud:[^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
2284
- const policyMatch = /^tinycloud:\/\/([^/]+)\/(kv|sql|duckdb|hooks)\/(.*)$/.exec(resource);
2285
- const match = nativeMatch ?? policyMatch;
2283
+ const match = /^(?:tinycloud:\/\/([^/]+)|(tinycloud:[^/]+))\/(kv|sql|duckdb|hooks)(?:\/|$)(.*)$/.exec(resource);
2286
2284
  if (!match) {
2287
2285
  throw new Error(
2288
2286
  `Validated runtime delegation has an unsupported signed resource '${resource}'.`
2289
2287
  );
2290
2288
  }
2291
- const [, space, shortService, path] = match;
2289
+ const [, policySpace, nativeSpace, shortService, path] = match;
2292
2290
  const service = SERVICE_BY_SHORT_NAME[shortService];
2293
- if (service === void 0) {
2294
- throw new Error(
2295
- `Validated runtime delegation has an unsupported signed service '${shortService}'.`
2296
- );
2297
- }
2298
2291
  permissions.push(...groupedSignedEntries(
2299
2292
  service,
2300
- space,
2293
+ nativeSpace ?? policySpace,
2301
2294
  path,
2302
2295
  abilities
2303
2296
  ));