@tinycloud/node-sdk 3.1.0-beta.3 → 3.1.0-beta.5

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
@@ -24892,6 +24892,9 @@ async function activateValidatedRuntimeDelegation(node, delegation, options) {
24892
24892
  if (!resourcesMatch(declaredResources, signed2.resources)) {
24893
24893
  throw new Error("Runtime delegation resources do not match signed authority.");
24894
24894
  }
24895
+ if (options.authorize !== void 0 && !options.authorize(signed2.permissions)) {
24896
+ throw new Error("Runtime delegation is not authorized for this runtime.");
24897
+ }
24895
24898
  const previouslyInstalled = node.getRuntimePermissionDelegations().find((candidate) => candidate.cid === cid);
24896
24899
  if (previouslyInstalled !== void 0 && previouslyInstalled.delegationHeader.Authorization !== authorization) {
24897
24900
  throw new Error(