@tinycloud/operations 0.7.7-beta.13 → 0.7.7-beta.15

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/coverage.json CHANGED
@@ -3,6 +3,7 @@
3
3
  "source": "packages/cli/src/command-registry.ts",
4
4
  "commands": [
5
5
  { "command": "init", "status": "legacy" },
6
+ { "command": "onboard", "status": "excluded", "reason": "Local composition of the existing OpenKey scoped login and grant flows (key-only profile, then one approval per space); adds no storage operation." },
6
7
  { "command": "context", "status": "excluded", "reason": "Read-only local CLI context diagnostics; performs no storage operation." },
7
8
  { "command": "enable", "status": "legacy" },
8
9
  { "command": "enable share", "status": "legacy" },
@@ -173,6 +173,7 @@ var import_zod = require("zod");
173
173
  // ../sdk-core/src/manifest.ts
174
174
  var import_ms = __toESM(require_ms(), 1);
175
175
  var import_sdk_services = require("@tinycloud/sdk-services");
176
+ var import_resource = require("@tinycloud/sdk-services/encryption/resource");
176
177
  var DEFAULT_MANIFEST_SPACE = "applications";
177
178
  var SERVICE_SHORT_TO_LONG = Object.freeze({
178
179
  kv: "tinycloud.kv",
@@ -202,6 +203,7 @@ var KEY_APP_ID = new RegExp(`^${KEY_SEGMENT}$`);
202
203
  var KEY_PATH = new RegExp(`^${KEY_SEGMENT}(?:/${KEY_SEGMENT}){2,7}$`);
203
204
 
204
205
  // ../sdk-core/src/capabilities.ts
206
+ var import_resource2 = require("@tinycloud/sdk-services/encryption/resource");
205
207
  function normalizeSpace(space) {
206
208
  if (!space.startsWith("tinycloud:")) {
207
209
  return space;
@@ -225,10 +227,9 @@ function isCapabilitySubset(requested, granted) {
225
227
  const grantedActions = matchingScope.flatMap(
226
228
  (entry) => expandActionShortNames(entry.service, entry.actions)
227
229
  );
230
+ const namedKeyRequest = req.service === "tinycloud.encryption" && req.path.startsWith("urn:tinycloud:encryption:") && req.path.includes("/");
228
231
  const covered = requestedActions.every(
229
- (requestedAction) => grantedActions.some(
230
- (grantedAction) => actionContains(grantedAction, requestedAction)
231
- )
232
+ (requestedAction) => grantedActions.some((grantedAction) => namedKeyRequest ? grantedAction === requestedAction : actionContains(grantedAction, requestedAction))
232
233
  );
233
234
  if (!covered) {
234
235
  missing.push(cloneEntry(req));
@@ -243,7 +244,9 @@ function canonicalizeEntryScopeMatches(requested, granted) {
243
244
  if (normalizeSpace(requested.space ?? DEFAULT_MANIFEST_SPACE) !== normalizeSpace(granted.space ?? DEFAULT_MANIFEST_SPACE)) {
244
245
  return false;
245
246
  }
246
- if (!pathContains(granted.path, requested.path)) {
247
+ const namedKeyRequest = requested.service === "tinycloud.encryption" && requested.path.startsWith("urn:tinycloud:encryption:") && requested.path.includes("/");
248
+ const coveredPath = namedKeyRequest ? (0, import_resource2.encryptionResourceContains)(granted.path, requested.path) : pathContains(granted.path, requested.path);
249
+ if (!coveredPath) {
247
250
  return false;
248
251
  }
249
252
  if (!recapCaveatsEqual(requested.caveats, granted.caveats)) {