@lifeready/core 8.0.2 → 8.0.3

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.
@@ -10775,22 +10775,31 @@
10775
10775
  var directoryKey, sharedCipherData, wrappedItemKey;
10776
10776
  return __generator(this, function (_a) {
10777
10777
  switch (_a.label) {
10778
- case 0: return [4 /*yield*/, this.itemService.getDirectoryKey(options.directoryId, options.directoryKeyId)];
10779
- case 1:
10778
+ case 0:
10779
+ if (!(options.accessRole == exports.AccessRoleChoice.DENY)) return [3 /*break*/, 1];
10780
+ // Cryptographic access to item is not required.
10781
+ return [2 /*return*/, {
10782
+ directoryId: options.directoryId,
10783
+ accessRole: options.accessRole,
10784
+ wrappedItemKey: null,
10785
+ sharedCipherData: null,
10786
+ }];
10787
+ case 1: return [4 /*yield*/, this.itemService.getDirectoryKey(options.directoryId, options.directoryKeyId)];
10788
+ case 2:
10780
10789
  directoryKey = _a.sent();
10781
10790
  return [4 /*yield*/, this.keyGraph.encryptToString(receiverSharedKey, options.sharedCipherDataClearJson || '')];
10782
- case 2:
10791
+ case 3:
10783
10792
  sharedCipherData = _a.sent();
10784
10793
  return [4 /*yield*/, this.keyGraph.encryptToString(receiverSharedKey, directoryKey.jwk.toJSON(true))];
10785
- case 3:
10794
+ case 4:
10786
10795
  wrappedItemKey = _a.sent();
10787
10796
  return [4 /*yield*/, this.keyGraph.encryptToString(assemblyKey, wrappedItemKey)];
10788
- case 4:
10797
+ case 5:
10789
10798
  wrappedItemKey = _a.sent();
10790
10799
  return [2 /*return*/, {
10791
10800
  directoryId: options.directoryId,
10792
- wrappedItemKey: wrappedItemKey,
10793
10801
  accessRole: options.accessRole,
10802
+ wrappedItemKey: wrappedItemKey,
10794
10803
  sharedCipherData: sharedCipherData,
10795
10804
  }];
10796
10805
  }