mindoodb 0.0.96 → 0.0.98

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.
Files changed (133) hide show
  1. package/README.md +1 -0
  2. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts +7 -0
  3. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.d.ts.map +1 -1
  4. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js +17 -9
  5. package/dist/appendonlystores/network/ClientNetworkContentAddressedStore.js.map +1 -1
  6. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts +12 -0
  7. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.d.ts.map +1 -1
  8. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js +19 -0
  9. package/dist/appendonlystores/network/ServerNetworkContentAddressedStore.js.map +1 -1
  10. package/dist/browser/index.mjs +73 -0
  11. package/dist/core/BaseMindooDB.d.ts +2 -0
  12. package/dist/core/BaseMindooDB.d.ts.map +1 -1
  13. package/dist/core/BaseMindooDB.js +73 -53
  14. package/dist/core/BaseMindooDB.js.map +1 -1
  15. package/dist/core/BaseMindooTenant.d.ts +33 -1
  16. package/dist/core/BaseMindooTenant.d.ts.map +1 -1
  17. package/dist/core/BaseMindooTenant.js +141 -41
  18. package/dist/core/BaseMindooTenant.js.map +1 -1
  19. package/dist/core/BaseMindooTenantDirectory.d.ts +24 -1
  20. package/dist/core/BaseMindooTenantDirectory.d.ts.map +1 -1
  21. package/dist/core/BaseMindooTenantDirectory.js +161 -90
  22. package/dist/core/BaseMindooTenantDirectory.js.map +1 -1
  23. package/dist/core/accesscontrol/directoryProjection.d.ts +7 -1
  24. package/dist/core/accesscontrol/directoryProjection.d.ts.map +1 -1
  25. package/dist/core/accesscontrol/directoryProjection.js +24 -0
  26. package/dist/core/accesscontrol/directoryProjection.js.map +1 -1
  27. package/dist/core/accesscontrol/types.d.ts +42 -2
  28. package/dist/core/accesscontrol/types.d.ts.map +1 -1
  29. package/dist/core/accesscontrol/types.js +77 -0
  30. package/dist/core/accesscontrol/types.js.map +1 -1
  31. package/dist/core/builtinDbInvariants.d.ts +26 -1
  32. package/dist/core/builtinDbInvariants.d.ts.map +1 -1
  33. package/dist/core/builtinDbInvariants.js +52 -2
  34. package/dist/core/builtinDbInvariants.js.map +1 -1
  35. package/dist/core/index.d.ts +3 -1
  36. package/dist/core/index.d.ts.map +1 -1
  37. package/dist/core/index.js +11 -5
  38. package/dist/core/index.js.map +1 -1
  39. package/dist/core/joinrequests/crypto.d.ts +110 -0
  40. package/dist/core/joinrequests/crypto.d.ts.map +1 -0
  41. package/dist/core/joinrequests/crypto.js +340 -0
  42. package/dist/core/joinrequests/crypto.js.map +1 -0
  43. package/dist/core/joinrequests/index.d.ts +4 -0
  44. package/dist/core/joinrequests/index.d.ts.map +1 -0
  45. package/dist/core/joinrequests/index.js +29 -0
  46. package/dist/core/joinrequests/index.js.map +1 -0
  47. package/dist/core/joinrequests/invitations.d.ts +257 -0
  48. package/dist/core/joinrequests/invitations.d.ts.map +1 -0
  49. package/dist/core/joinrequests/invitations.js +703 -0
  50. package/dist/core/joinrequests/invitations.js.map +1 -0
  51. package/dist/core/joinrequests/types.d.ts +208 -0
  52. package/dist/core/joinrequests/types.d.ts.map +1 -0
  53. package/dist/core/joinrequests/types.js +43 -0
  54. package/dist/core/joinrequests/types.js.map +1 -0
  55. package/dist/core/recovery/PaperRescueDevice.d.ts +92 -0
  56. package/dist/core/recovery/PaperRescueDevice.d.ts.map +1 -0
  57. package/dist/core/recovery/PaperRescueDevice.js +182 -0
  58. package/dist/core/recovery/PaperRescueDevice.js.map +1 -0
  59. package/dist/core/recovery/RecoveryContactsDocument.d.ts +91 -0
  60. package/dist/core/recovery/RecoveryContactsDocument.d.ts.map +1 -0
  61. package/dist/core/recovery/RecoveryContactsDocument.js +92 -0
  62. package/dist/core/recovery/RecoveryContactsDocument.js.map +1 -0
  63. package/dist/core/recovery/RecoveryContactsManager.d.ts +95 -0
  64. package/dist/core/recovery/RecoveryContactsManager.d.ts.map +1 -0
  65. package/dist/core/recovery/RecoveryContactsManager.js +322 -0
  66. package/dist/core/recovery/RecoveryContactsManager.js.map +1 -0
  67. package/dist/core/recovery/index.d.ts +8 -0
  68. package/dist/core/recovery/index.d.ts.map +1 -0
  69. package/dist/core/recovery/index.js +41 -0
  70. package/dist/core/recovery/index.js.map +1 -0
  71. package/dist/core/recovery/recoverWithContacts.d.ts +36 -0
  72. package/dist/core/recovery/recoverWithContacts.d.ts.map +1 -0
  73. package/dist/core/recovery/recoverWithContacts.js +103 -0
  74. package/dist/core/recovery/recoverWithContacts.js.map +1 -0
  75. package/dist/core/recovery/recoveryPackage.d.ts +72 -0
  76. package/dist/core/recovery/recoveryPackage.d.ts.map +1 -0
  77. package/dist/core/recovery/recoveryPackage.js +181 -0
  78. package/dist/core/recovery/recoveryPackage.js.map +1 -0
  79. package/dist/core/recovery/rescueDevice.d.ts +51 -0
  80. package/dist/core/recovery/rescueDevice.d.ts.map +1 -0
  81. package/dist/core/recovery/rescueDevice.js +201 -0
  82. package/dist/core/recovery/rescueDevice.js.map +1 -0
  83. package/dist/core/recovery/shamir.d.ts +30 -0
  84. package/dist/core/recovery/shamir.d.ts.map +1 -0
  85. package/dist/core/recovery/shamir.js +133 -0
  86. package/dist/core/recovery/shamir.js.map +1 -0
  87. package/dist/core/types.d.ts +80 -2
  88. package/dist/core/types.d.ts.map +1 -1
  89. package/dist/core/types.js.map +1 -1
  90. package/dist/core/userkeys/UserKeyManager.d.ts +29 -0
  91. package/dist/core/userkeys/UserKeyManager.d.ts.map +1 -1
  92. package/dist/core/userkeys/UserKeyManager.js +76 -8
  93. package/dist/core/userkeys/UserKeyManager.js.map +1 -1
  94. package/dist/core/userkeys/generationSignature.d.ts +6 -0
  95. package/dist/core/userkeys/generationSignature.d.ts.map +1 -1
  96. package/dist/core/userkeys/generationSignature.js +1 -0
  97. package/dist/core/userkeys/generationSignature.js.map +1 -1
  98. package/dist/core/userkeys/resolveUserKeyDocument.d.ts.map +1 -1
  99. package/dist/core/userkeys/resolveUserKeyDocument.js +6 -6
  100. package/dist/core/userkeys/resolveUserKeyDocument.js.map +1 -1
  101. package/dist/core/userkeys/validateUserKeyDocument.d.ts +11 -1
  102. package/dist/core/userkeys/validateUserKeyDocument.d.ts.map +1 -1
  103. package/dist/core/userkeys/validateUserKeyDocument.js +18 -5
  104. package/dist/core/userkeys/validateUserKeyDocument.js.map +1 -1
  105. package/dist/node/server/MindooDBServer.d.ts +2 -0
  106. package/dist/node/server/MindooDBServer.d.ts.map +1 -1
  107. package/dist/node/server/MindooDBServer.js +46 -0
  108. package/dist/node/server/MindooDBServer.js.map +1 -1
  109. package/dist/node/server/StoreFactory.d.ts.map +1 -1
  110. package/dist/node/server/StoreFactory.js +4 -1
  111. package/dist/node/server/StoreFactory.js.map +1 -1
  112. package/dist/node/server/server.js +2 -0
  113. package/dist/node/server/server.js.map +1 -1
  114. package/dist/server/JoinRequestService.d.ts +108 -0
  115. package/dist/server/JoinRequestService.d.ts.map +1 -0
  116. package/dist/server/JoinRequestService.js +454 -0
  117. package/dist/server/JoinRequestService.js.map +1 -0
  118. package/dist/server/TenantManager.d.ts +50 -0
  119. package/dist/server/TenantManager.d.ts.map +1 -1
  120. package/dist/server/TenantManager.js +271 -33
  121. package/dist/server/TenantManager.js.map +1 -1
  122. package/dist/server/http/MindooDBServerCore.d.ts +18 -0
  123. package/dist/server/http/MindooDBServerCore.d.ts.map +1 -1
  124. package/dist/server/http/MindooDBServerCore.js +229 -137
  125. package/dist/server/http/MindooDBServerCore.js.map +1 -1
  126. package/dist/server/serverConfig.d.ts.map +1 -1
  127. package/dist/server/serverConfig.js +17 -0
  128. package/dist/server/serverConfig.js.map +1 -1
  129. package/dist/server/types.d.ts +15 -0
  130. package/dist/server/types.d.ts.map +1 -1
  131. package/dist/server/types.js +6 -0
  132. package/dist/server/types.js.map +1 -1
  133. package/package.json +1 -1
@@ -87,6 +87,8 @@ export declare class BaseMindooTenant implements MindooTenant {
87
87
  /** Fire-and-forget work of this tenant; see {@link whenBackgroundIdle}. */
88
88
  private readonly backgroundTasks;
89
89
  private readonly userKeys;
90
+ private readonly recoveryContacts;
91
+ private readonly paperRescue;
90
92
  private readonly sealedGenerations;
91
93
  /** Per sealed key id: the bundle of the recipient block last opened. */
92
94
  private readonly sealedBlocks;
@@ -196,6 +198,25 @@ export declare class BaseMindooTenant implements MindooTenant {
196
198
  fingerprint: string;
197
199
  certificate: import("./userkeys/deviceCertificate").DeviceCertificatePayload;
198
200
  }>>;
201
+ setupRecoveryContacts(contacts: string[], options?: import("./recovery/RecoveryContactsManager").SetupRecoveryContactsOptions): Promise<import("./recovery/RecoveryContactsDocument").RecoveryContactsSetup>;
202
+ getRecoveryContactsSetup(): Promise<import("./recovery/RecoveryContactsDocument").RecoveryContactsSetup | null>;
203
+ removeRecoveryContacts(options?: {
204
+ withdrawRescueDevices?: string[];
205
+ }): Promise<number>;
206
+ listRecoveryContactRequests(): Promise<import("./recovery/RecoveryContactsManager").RecoveryContactRequest[]>;
207
+ createRecoveryHelperPackage(person: string, options?: {
208
+ serverUrl?: string;
209
+ }): Promise<import("./recovery/recoveryPackage").RecoveryHelperPackage>;
210
+ canIssueDeviceCertificates(): Promise<boolean>;
211
+ listRescueDeviceSigningKeys(): Promise<Array<{
212
+ username: string;
213
+ signingPublicKey: string;
214
+ }>>;
215
+ createPaperRescueDevice(options?: {
216
+ label?: string;
217
+ }): Promise<import("./recovery/PaperRescueDevice").PaperRescueSecret>;
218
+ listPaperRescueDevices(): Promise<import("./recovery/PaperRescueDevice").PaperRescueRecord[]>;
219
+ removePaperRescueDevices(): Promise<number>;
199
220
  reconcileUserKeys(options?: {
200
221
  allowSelfCreate?: boolean;
201
222
  }): Promise<UserKeyEnrollmentStatus>;
@@ -372,7 +393,18 @@ export declare class BaseMindooTenant implements MindooTenant {
372
393
  * string. See {@link importedVerifyKeyCache}.
373
394
  */
374
395
  private importVerifyKeyCached;
375
- verifyEntrySignature(entry: StoreEntryMetadata, encryptedData: Uint8Array): Promise<boolean>;
396
+ /** Server keys allowed to sign `jr_` documents, cached briefly (docs/invitations.md). */
397
+ private joinRequestServerKeys;
398
+ /**
399
+ * Whether `publicKey` may sign join-request documents in `joinrequests`
400
+ * (docs/invitations.md): a trusted witness of the tenant, or the server an
401
+ * admin named in an invitation (`serverSigningPublicKey` of an `invite_`
402
+ * document in `directory`). Never consulted for any other database.
403
+ */
404
+ isJoinRequestServerKey(publicKey: string): Promise<boolean>;
405
+ verifyEntrySignature(entry: StoreEntryMetadata, encryptedData: Uint8Array, options?: {
406
+ dbId?: string;
407
+ }): Promise<boolean>;
376
408
  /**
377
409
  * Whether the storage-format floor (`requireMetadataSignatureSince`) requires
378
410
  * `entry` to carry the v2 metadata-binding signature, based on the entry's
@@ -1 +1 @@
1
- {"version":3,"file":"BaseMindooTenant.d.ts","sourceRoot":"","sources":["../../src/core/BaseMindooTenant.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,qBAAqB,EACrB,4BAA4B,EAE5B,SAAS,EACT,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,YAAY,EAGZ,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EAEtB,sBAAsB,EAIvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAkB,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAA2B,MAAM,eAAe,CAAC;AAIhE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EACV,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;A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AmB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ7D;;;;;OAKG;IACG,sBAAsB,CAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,KAAK,CAAC;QAAE,KAAK,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAchF;;;;;;;;OAQG;IACG,wCAAwC,CAC5C,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,MAAM,CAAC;IAiClB,oEAAoE;IACpE,OAAO,CAAC,4BAA4B;IAKpC;;;;;;OAMG;cACa,eAAe,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IA8B7E;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,qCAAqC,IAAI,OAAO;IAI1D;;;;;;;;;;OAUG;IACG,wBAAwB,CAC5B,OAAO,EAAE,UAAU,EACnB,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,UAAU,CAAC;IAgEtB;;;;;;;OAOG;IACG,wBAAwB,CAC5B,gBAAgB,EAAE,UAAU,EAC5B,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,UAAU,CAAC;CA2DvB"}
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseMindooTenant = void 0;
4
- const types_1 = require("./types");
4
+ const types_1 = require("./joinrequests/types");
5
+ const types_2 = require("./types");
5
6
  const userid_1 = require("./userid");
6
7
  const AuthChallenge_1 = require("./crypto/AuthChallenge");
7
8
  const BaseMindooDB_1 = require("./BaseMindooDB");
8
9
  const BaseMindooTenantDirectory_1 = require("./BaseMindooTenantDirectory");
9
10
  const grantKeys_1 = require("./accesscontrol/grantKeys");
11
+ const PaperRescueDevice_1 = require("./recovery/PaperRescueDevice");
12
+ const RecoveryContactsManager_1 = require("./recovery/RecoveryContactsManager");
10
13
  const UserKeyManager_1 = require("./userkeys/UserKeyManager");
11
- const types_2 = require("./userkeys/types");
14
+ const types_3 = require("./userkeys/types");
12
15
  const validateUserKeyDocument_1 = require("./userkeys/validateUserKeyDocument");
13
16
  const sealedTypes_1 = require("./userkeys/sealedTypes");
14
17
  const recipients_1 = require("./userkeys/recipients");
@@ -123,6 +126,8 @@ class BaseMindooTenant {
123
126
  /** Fire-and-forget work of this tenant; see {@link whenBackgroundIdle}. */
124
127
  this.backgroundTasks = new BackgroundTaskTracker_1.BackgroundTaskTracker();
125
128
  this.userKeys = new UserKeyManager_1.UserKeyManager(this);
129
+ this.recoveryContacts = new RecoveryContactsManager_1.RecoveryContactsManager(this, this.userKeys);
130
+ this.paperRescue = new PaperRescueDevice_1.PaperRescueManager(this, this.userKeys);
126
131
  this.sealedGenerations = new Map();
127
132
  /** Per sealed key id: the bundle of the recipient block last opened. */
128
133
  this.sealedBlocks = new Map();
@@ -146,6 +151,8 @@ class BaseMindooTenant {
146
151
  this.directoryAdminResolver = null;
147
152
  /** Public keys derived from admin private keys handed to directory methods. */
148
153
  this.adminPublicKeyByPrivateKey = new WeakMap();
154
+ /** Server keys allowed to sign `jr_` documents, cached briefly (docs/invitations.md). */
155
+ this.joinRequestServerKeys = null;
149
156
  this.factory = factory;
150
157
  this.tenantId = tenantId;
151
158
  this.administrationPublicKey = administrationPublicKey;
@@ -399,6 +406,41 @@ class BaseMindooTenant {
399
406
  async listOwnDeviceCertificates() {
400
407
  return this.userKeys.listOwnDeviceCertificates();
401
408
  }
409
+ // ==================== Recovery contacts (docs/userkeys.md §12) ====================
410
+ async setupRecoveryContacts(contacts, options) {
411
+ return this.recoveryContacts.setup(contacts, options);
412
+ }
413
+ async getRecoveryContactsSetup() {
414
+ return this.recoveryContacts.getSetup();
415
+ }
416
+ async removeRecoveryContacts(options) {
417
+ return this.recoveryContacts.remove(options);
418
+ }
419
+ async listRecoveryContactRequests() {
420
+ return this.recoveryContacts.listRequests();
421
+ }
422
+ async createRecoveryHelperPackage(person, options) {
423
+ return this.recoveryContacts.createHelperPackage(person, options);
424
+ }
425
+ async canIssueDeviceCertificates() {
426
+ return this.userKeys.canIssueDeviceCertificates();
427
+ }
428
+ async listRescueDeviceSigningKeys() {
429
+ const paper = (await this.paperRescue.listAll()).map((r) => ({
430
+ username: r.payload.username,
431
+ signingPublicKey: r.payload.rescueDevice.signingPublicKey,
432
+ }));
433
+ return [...(await this.recoveryContacts.rescueDeviceSigningKeys()), ...paper];
434
+ }
435
+ async createPaperRescueDevice(options) {
436
+ return this.paperRescue.create(options);
437
+ }
438
+ async listPaperRescueDevices() {
439
+ return this.paperRescue.list();
440
+ }
441
+ async removePaperRescueDevices() {
442
+ return this.paperRescue.remove();
443
+ }
402
444
  async reconcileUserKeys(options) {
403
445
  return this.userKeys.reconcile(options);
404
446
  }
@@ -660,7 +702,7 @@ class BaseMindooTenant {
660
702
  if (!this.directoryAdminResolver) {
661
703
  // Opening the directory registers the resolver. Never awaited from the
662
704
  // directory's own load path: that path uses its resolver directly.
663
- await this.openDB(types_1.DIRECTORY_DB_ID, { adminOnlyDb: true });
705
+ await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
664
706
  }
665
707
  if (!this.directoryAdminResolver)
666
708
  return false;
@@ -786,9 +828,9 @@ class BaseMindooTenant {
786
828
  else {
787
829
  if (debugEnabled)
788
830
  this.logger.debug(`Resolving tenant encryption key from KeyBag`);
789
- const tenantKey = await this.keyBag.get("doc", this.tenantId, types_1.DEFAULT_TENANT_KEY_ID);
831
+ const tenantKey = await this.keyBag.get("doc", this.tenantId, types_2.DEFAULT_TENANT_KEY_ID);
790
832
  if (!tenantKey) {
791
- throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}`);
833
+ throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}`);
792
834
  }
793
835
  symmetricKey = tenantKey;
794
836
  this.decryptedTenantKeyCache = symmetricKey;
@@ -886,7 +928,7 @@ class BaseMindooTenant {
886
928
  // version is overwhelmingly the common case, so it is tried first.
887
929
  const candidates = await this.getDecryptionKeyCandidates(decryptionKeyId);
888
930
  if (candidates.length === 0) {
889
- throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
931
+ throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
890
932
  }
891
933
  const subtle = this.cryptoAdapter.getSubtle();
892
934
  let lastError = undefined;
@@ -927,7 +969,7 @@ class BaseMindooTenant {
927
969
  if ((0, sealedTypes_1.isSealedKeyId)(decryptionKeyId)) {
928
970
  return this.sealedGenerations.get(decryptionKeyId) ?? [];
929
971
  }
930
- const id = decryptionKeyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
972
+ const id = decryptionKeyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
931
973
  const versions = await this.keyBag.getAllKeys("doc", this.tenantId, id);
932
974
  if (decryptionKeyId === "default" && versions.length > 0) {
933
975
  this.decryptedTenantKeyCache = versions[0];
@@ -1053,7 +1095,57 @@ class BaseMindooTenant {
1053
1095
  this.importedVerifyKeyCache.set(publicKeyPem, cryptoKey);
1054
1096
  return cryptoKey;
1055
1097
  }
1056
- async verifyEntrySignature(entry, encryptedData) {
1098
+ /**
1099
+ * Whether `publicKey` may sign join-request documents in `joinrequests`
1100
+ * (docs/invitations.md): a trusted witness of the tenant, or the server an
1101
+ * admin named in an invitation (`serverSigningPublicKey` of an `invite_`
1102
+ * document in `directory`). Never consulted for any other database.
1103
+ */
1104
+ async isJoinRequestServerKey(publicKey) {
1105
+ const normalized = publicKey.replace(/\s+/g, "");
1106
+ const now = Date.now();
1107
+ const lookup = async () => {
1108
+ const keys = new Set();
1109
+ const directory = await this.openDirectory();
1110
+ try {
1111
+ if (typeof directory.getTrustedWitnessKeysAt === "function") {
1112
+ for (const key of await directory.getTrustedWitnessKeysAt(Number.MAX_SAFE_INTEGER)) {
1113
+ keys.add(key.replace(/\s+/g, ""));
1114
+ }
1115
+ }
1116
+ }
1117
+ catch (error) {
1118
+ this.logger.debug(`isJoinRequestServerKey: witness lookup failed: ${error}`);
1119
+ }
1120
+ try {
1121
+ const directoryDb = await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
1122
+ for (const docId of await directoryDb.getAllDocumentIds()) {
1123
+ if (!docId.startsWith(types_1.INVITATION_DOC_ID_PREFIX))
1124
+ continue;
1125
+ const doc = await directoryDb.getDocument(docId).catch(() => null);
1126
+ const key = doc?.getData()?.serverSigningPublicKey;
1127
+ if (typeof key === "string" && key)
1128
+ keys.add(key.replace(/\s+/g, ""));
1129
+ }
1130
+ }
1131
+ catch (error) {
1132
+ this.logger.debug(`isJoinRequestServerKey: invitation lookup failed: ${error}`);
1133
+ }
1134
+ return keys;
1135
+ };
1136
+ if (!this.joinRequestServerKeys || now - this.joinRequestServerKeys.loadedAt > 30000) {
1137
+ this.joinRequestServerKeys = { loadedAt: now, keys: await lookup() };
1138
+ }
1139
+ if (this.joinRequestServerKeys.keys.has(normalized))
1140
+ return true;
1141
+ // A just-synced invitation: refresh once, at most every few seconds.
1142
+ if (now - this.joinRequestServerKeys.loadedAt > 3000) {
1143
+ this.joinRequestServerKeys = { loadedAt: now, keys: await lookup() };
1144
+ return this.joinRequestServerKeys.keys.has(normalized);
1145
+ }
1146
+ return false;
1147
+ }
1148
+ async verifyEntrySignature(entry, encryptedData, options) {
1057
1149
  // The author key must be trusted by the tenant directory.
1058
1150
  const directory = await this.openDirectory();
1059
1151
  // A delegated admin key (docs/accesscontrol.md §6.13) holds no grant. It is
@@ -1070,6 +1162,9 @@ class BaseMindooTenant {
1070
1162
  if (!isTrusted) {
1071
1163
  isTrusted = await directory.validatePublicSigningKey(entry.createdByPublicKey);
1072
1164
  }
1165
+ if (!isTrusted && options?.dbId === types_1.JOIN_REQUESTS_DB_ID) {
1166
+ isTrusted = await this.isJoinRequestServerKey(entry.createdByPublicKey);
1167
+ }
1073
1168
  if (!isTrusted) {
1074
1169
  this.logger.warn(`Public key not trusted: ${entry.createdByPublicKey}`);
1075
1170
  return false;
@@ -1224,8 +1319,8 @@ class BaseMindooTenant {
1224
1319
  // Every local database belonging to this tenant: the directory plus any
1225
1320
  // opened/known data databases. Wipe is a whole-tenant operation.
1226
1321
  const dbIds = new Set([
1227
- types_1.DIRECTORY_DB_ID,
1228
- types_1.USER_DIRECTORY_DB_ID,
1322
+ types_2.DIRECTORY_DB_ID,
1323
+ types_2.USER_DIRECTORY_DB_ID,
1229
1324
  ...this.databaseCache.keys(),
1230
1325
  ...(additionalDbIds ?? []),
1231
1326
  ]);
@@ -1281,13 +1376,17 @@ class BaseMindooTenant {
1281
1376
  }
1282
1377
  }
1283
1378
  async assertCurrentUserCanOpenDB(id) {
1284
- if (id === types_1.DIRECTORY_DB_ID || id === types_1.USER_DIRECTORY_DB_ID) {
1379
+ if (id === types_2.DIRECTORY_DB_ID || id === types_2.USER_DIRECTORY_DB_ID) {
1285
1380
  return;
1286
1381
  }
1287
1382
  const currentUser = await this.getCurrentUserId();
1288
1383
  if (await this.isAdminSigningKeyAt(currentUser.userSigningPublicKey, (0, timeSource_1.semanticNow)())) {
1289
1384
  return;
1290
1385
  }
1386
+ // The server's own tenant instance stores join requests (docs/invitations.md).
1387
+ if (id === types_1.JOIN_REQUESTS_DB_ID && (await this.isJoinRequestServerKey(currentUser.userSigningPublicKey))) {
1388
+ return;
1389
+ }
1291
1390
  const directory = await this.openDirectory();
1292
1391
  // Multi-device grants (§6.5) list several signing/encryption pairs. Matching
1293
1392
  // only the primary pair from getUserPublicKeys() rejects every later device.
@@ -1354,7 +1453,7 @@ class BaseMindooTenant {
1354
1453
  const validDbId = (0, databaseIdValidation_1.validateDatabaseId)(id, "dbId");
1355
1454
  // Enforce admin-only mode for directory database - this is a security invariant
1356
1455
  // The directory database must only accept entries signed by the admin key
1357
- const effectiveOptions = validDbId === types_1.DIRECTORY_DB_ID
1456
+ const effectiveOptions = validDbId === types_2.DIRECTORY_DB_ID
1358
1457
  ? { ...options, adminOnlyDb: true }
1359
1458
  : options ?? {};
1360
1459
  const normalizedTimeTravelDate = this.normalizeTimeTravelDate(effectiveOptions.timeTravelDate);
@@ -1364,7 +1463,7 @@ class BaseMindooTenant {
1364
1463
  await this.assertCurrentUserCanOpenDB(validDbId);
1365
1464
  const cached = this.databaseCache.get(databaseCacheKey);
1366
1465
  if (cached) {
1367
- if (validDbId === types_1.DIRECTORY_DB_ID && !cached.isAdminOnlyDb()) {
1466
+ if (validDbId === types_2.DIRECTORY_DB_ID && !cached.isAdminOnlyDb()) {
1368
1467
  throw new Error("Directory database was cached without adminOnlyDb - this should never happen");
1369
1468
  }
1370
1469
  if (normalizedTimeTravelDate == null) {
@@ -1623,7 +1722,7 @@ class BaseMindooTenant {
1623
1722
  continue;
1624
1723
  }
1625
1724
  sawTenantDocKeyChange = true;
1626
- if (event.keyId === types_1.DEFAULT_TENANT_KEY_ID) {
1725
+ if (event.keyId === types_2.DEFAULT_TENANT_KEY_ID) {
1627
1726
  // The cached plaintext default key may now refer to a rotated
1628
1727
  // or removed version; drop it so the next access re-resolves.
1629
1728
  this.decryptedTenantKeyCache = undefined;
@@ -1724,7 +1823,7 @@ class BaseMindooTenant {
1724
1823
  return { keyId, versions };
1725
1824
  }
1726
1825
  resolveJoinResponseDocKeyIds(_options) {
1727
- return [types_1.PUBLIC_INFOS_KEY_ID];
1826
+ return [types_2.PUBLIC_INFOS_KEY_ID];
1728
1827
  }
1729
1828
  async approveJoinRequest(joinRequest, options) {
1730
1829
  // Parse the join request if it's a URI string
@@ -1793,7 +1892,7 @@ class BaseMindooTenant {
1793
1892
  signingKeyPassword: options.adminPassword,
1794
1893
  });
1795
1894
  const payload = (0, validateUserKeyDocument_1.asUserKeyPayload)(userKeyDoc.getData());
1796
- const epoch = payload ? (0, types_2.currentUserKeyEpoch)(payload) : null;
1895
+ const epoch = payload ? (0, types_3.currentUserKeyEpoch)(payload) : null;
1797
1896
  const publishedPublicKey = epoch ? payload?.userKeys[epoch]?.publicKey : undefined;
1798
1897
  // First device: wrap the granted keys to the join-request User-Key
1799
1898
  // (pending is OK). Additional device: wrap to the already-published
@@ -1802,7 +1901,7 @@ class BaseMindooTenant {
1802
1901
  // (historical) or explicitly included it. A directory-only grant
1803
1902
  // (`[$publicinfos]`) must not quietly hand out the tenant key.
1804
1903
  const wrapDefault = options.sharedDocKeyIds === undefined ||
1805
- options.sharedDocKeyIds.includes(types_1.DEFAULT_TENANT_KEY_ID);
1904
+ options.sharedDocKeyIds.includes(types_2.DEFAULT_TENANT_KEY_ID);
1806
1905
  // The person's first device brings their device self-grant key. Only
1807
1906
  // then is it the person's own key; an additional device's request
1808
1907
  // carries a key nobody else holds (docs/userkeys.md §9).
@@ -1813,10 +1912,10 @@ class BaseMindooTenant {
1813
1912
  await directory.setDeviceSelfGrant(username, selfGrantKey, options.adminSigningKey, options.adminPassword);
1814
1913
  }
1815
1914
  if (wrapDefault && publishedPublicKey === userPublicKey) {
1816
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword, userPublicKey);
1915
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword, userPublicKey);
1817
1916
  }
1818
1917
  else if (wrapDefault && publishedPublicKey) {
1819
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1918
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1820
1919
  }
1821
1920
  }
1822
1921
  else {
@@ -1825,9 +1924,9 @@ class BaseMindooTenant {
1825
1924
  throw new Error("Cannot approve join request: it carries no userPublicKey and the person has no published User-Key. Generate a User-Key on the joining device first.");
1826
1925
  }
1827
1926
  const wrapDefault = options.sharedDocKeyIds === undefined ||
1828
- options.sharedDocKeyIds.includes(types_1.DEFAULT_TENANT_KEY_ID);
1927
+ options.sharedDocKeyIds.includes(types_2.DEFAULT_TENANT_KEY_ID);
1829
1928
  if (wrapDefault) {
1830
- await directory.autoDistributeKeysToUser(username, [types_1.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1929
+ await directory.autoDistributeKeysToUser(username, [types_2.DEFAULT_TENANT_KEY_ID], options.adminSigningKey, options.adminPassword);
1831
1930
  }
1832
1931
  }
1833
1932
  // Same person: wrap the published User-Key to this device's encryption
@@ -1956,7 +2055,7 @@ class BaseMindooTenant {
1956
2055
  ...(label ? { label } : {}),
1957
2056
  ...(typeof options.validFrom === "number" ? { validFrom: options.validFrom } : {}),
1958
2057
  }, options.adminSigningKey, options.adminPassword);
1959
- const encryptedDocKeys = await Promise.all([types_1.DEFAULT_TENANT_KEY_ID, types_1.PUBLIC_INFOS_KEY_ID].map((keyId) => this.exportJoinResponseDocKeyVersions(keyId, request.encryptionPublicKey)));
2058
+ const encryptedDocKeys = await Promise.all([types_2.DEFAULT_TENANT_KEY_ID, types_2.PUBLIC_INFOS_KEY_ID].map((keyId) => this.exportJoinResponseDocKeyVersions(keyId, request.encryptionPublicKey)));
1960
2059
  const response = {
1961
2060
  v: 1,
1962
2061
  tenantId: this.tenantId,
@@ -1976,7 +2075,7 @@ class BaseMindooTenant {
1976
2075
  }
1977
2076
  else {
1978
2077
  try {
1979
- const directoryDb = await this.openDB(types_1.DIRECTORY_DB_ID, { adminOnlyDb: true });
2078
+ const directoryDb = await this.openDB(types_2.DIRECTORY_DB_ID, { adminOnlyDb: true });
1980
2079
  const setupLabel = await (0, tenantSetup_1.readTenantSetupLabel)(directoryDb, this);
1981
2080
  if (setupLabel)
1982
2081
  response.tenantLabel = setupLabel;
@@ -2009,7 +2108,7 @@ class BaseMindooTenant {
2009
2108
  }
2010
2109
  const baseUrl = serverUrl.replace(/\/$/, "");
2011
2110
  // Export the $publicinfos key so the server can read the directory DB
2012
- const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_1.PUBLIC_INFOS_KEY_ID);
2111
+ const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_2.PUBLIC_INFOS_KEY_ID);
2013
2112
  if (!publicInfosKeyBytes) {
2014
2113
  throw new Error(`Cannot publish to server: $publicinfos key not found in KeyBag`);
2015
2114
  }
@@ -2144,7 +2243,7 @@ class BaseMindooTenant {
2144
2243
  const transport = new IrohNetworkTransport(target.io, target.ticket, {
2145
2244
  tenantId: this.tenantId,
2146
2245
  });
2147
- const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_1.PUBLIC_INFOS_KEY_ID);
2246
+ const publicInfosKeyBytes = await this.keyBag.get("doc", this.tenantId, types_2.PUBLIC_INFOS_KEY_ID);
2148
2247
  if (!publicInfosKeyBytes) {
2149
2248
  throw new Error(`Cannot publish to server: $publicinfos key not found in KeyBag`);
2150
2249
  }
@@ -2251,13 +2350,13 @@ class BaseMindooTenant {
2251
2350
  /**
2252
2351
  * Create a remote store connected to a MindooDB server, ready for sync.
2253
2352
  */
2254
- async connectToServer(serverUrl, dbId, storeKind = types_1.StoreKind.docs, options) {
2353
+ async connectToServer(serverUrl, dbId, storeKind = types_2.StoreKind.docs, options) {
2255
2354
  const validDbId = (0, databaseIdValidation_1.validateDatabaseId)(dbId, "dbId");
2256
2355
  console.log(`[connectToServer] Connecting to server: ${serverUrl}, db: ${validDbId}, storeKind: ${storeKind}`);
2257
2356
  this.logger.info(`Connecting to server: ${serverUrl}, db: ${validDbId}, storeKind: ${storeKind}`);
2258
2357
  const normalizedServerUrl = serverUrl.replace(/\/$/, "");
2259
2358
  const irohTarget = this.resolveIrohDial(serverUrl, options);
2260
- const cacheKey = `${normalizedServerUrl}::${validDbId}::${storeKind}${irohTarget ? `::iroh:${irohTarget.ticket}` : ""}`;
2359
+ const cacheKey = `${normalizedServerUrl}::${validDbId}::${storeKind}${irohTarget ? `::iroh:${irohTarget.ticket}` : ""}${options?.authAs ? `::as:${options.authAs.signingPublicKey.replace(/\s+/g, "")}` : ""}`;
2261
2360
  const cachedStore = this.remoteStoreCache.get(cacheKey);
2262
2361
  if (cachedStore) {
2263
2362
  this.logger.debug(`Reusing cached remote store for ${normalizedServerUrl}, db: ${validDbId}`);
@@ -2278,13 +2377,14 @@ class BaseMindooTenant {
2278
2377
  dbId: validDbId,
2279
2378
  storeKind,
2280
2379
  }, this.logger.createChild("HttpTransport"));
2281
- // Get the current user's decrypted signing key
2282
- const signingKey = await this.getDecryptedSigningKey();
2380
+ // Get the current user's decrypted signing key (or the override's)
2381
+ const authAs = options?.authAs;
2382
+ const signingKey = authAs ? authAs.signingKey : await this.getDecryptedSigningKey();
2283
2383
  // Get the current user's decrypted RSA encryption private key (for decrypting entries)
2284
- const decryptedEncryptionKey = await this.getDecryptedEncryptionKey();
2384
+ const decryptedEncryptionKey = authAs ? authAs.encryptionKey : await this.getDecryptedEncryptionKey();
2285
2385
  // Create the client network store. Pass the device signing public key so
2286
2386
  // auth challenges can identify this specific device on multi-device grants.
2287
- const store = new ClientNetworkContentAddressedStore(validDbId, storeKind, transport, this.cryptoAdapter, this.currentUser.username, signingKey, decryptedEncryptionKey, this.logger.createChild(`ClientNetworkStore:${validDbId}:${storeKind}`), this.currentUser.userSigningKeyPair.publicKey);
2387
+ const store = new ClientNetworkContentAddressedStore(validDbId, storeKind, transport, this.cryptoAdapter, authAs ? (authAs.username ?? `$adminkey:${authAs.signingPublicKey.replace(/\s+/g, "")}`) : this.currentUser.username, signingKey, decryptedEncryptionKey, this.logger.createChild(`ClientNetworkStore:${validDbId}:${storeKind}`), authAs ? authAs.signingPublicKey : this.currentUser.userSigningKeyPair.publicKey);
2288
2388
  console.log(`[connectToServer] ✓ Connected to server for db "${validDbId}"`);
2289
2389
  this.logger.info(`Connected to server for db "${validDbId}"`);
2290
2390
  return store;
@@ -2522,7 +2622,7 @@ class BaseMindooTenant {
2522
2622
  * Returns true if a key was removed.
2523
2623
  */
2524
2624
  async removeNamedDecryptionKey(decryptionKeyId) {
2525
- if (decryptionKeyId === types_1.PUBLIC_INFOS_KEY_ID) {
2625
+ if (decryptionKeyId === types_2.PUBLIC_INFOS_KEY_ID) {
2526
2626
  this.logger.debug(`removeNamedDecryptionKey: refusing to delete the public-infos key`);
2527
2627
  return false;
2528
2628
  }
@@ -2598,7 +2698,7 @@ class BaseMindooTenant {
2598
2698
  }
2599
2699
  }
2600
2700
  let adoptedUsername;
2601
- if (imported.includes(types_1.DEFAULT_TENANT_KEY_ID) ||
2701
+ if (imported.includes(types_2.DEFAULT_TENANT_KEY_ID) ||
2602
2702
  imported.includes("default")) {
2603
2703
  adoptedUsername = await this.adoptRegisteredUsernameFromGrant(directory);
2604
2704
  }
@@ -2654,7 +2754,7 @@ class BaseMindooTenant {
2654
2754
  * run this — never the admin who later publishes the wrapped bytes.
2655
2755
  */
2656
2756
  async exportDecryptionKeyForDelivery(decryptionKeyId) {
2657
- const id = decryptionKeyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
2757
+ const id = decryptionKeyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : decryptionKeyId;
2658
2758
  const versions = await this.keyBag.getAllKeyVersions("doc", this.tenantId, id);
2659
2759
  if (versions.length === 0) {
2660
2760
  return null;
@@ -2680,7 +2780,7 @@ class BaseMindooTenant {
2680
2780
  * versions actually imported.
2681
2781
  */
2682
2782
  async importDeliveredDecryptionKeyVersions(keyId, versions) {
2683
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2783
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2684
2784
  const scopedKeyId = `doc:${this.tenantId}:${id}`;
2685
2785
  const existing = await this.keyBag.listKeyDetails();
2686
2786
  const haveStamps = new Set(existing.filter((d) => d.scopedKeyId === scopedKeyId).map((d) => d.createdAt ?? 0));
@@ -2715,7 +2815,7 @@ class BaseMindooTenant {
2715
2815
  * caller's KeyBag lacks the key.
2716
2816
  */
2717
2817
  async fingerprintKeyVersions(keyId) {
2718
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2818
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2719
2819
  const versions = await this.keyBag.getAllKeyVersions("doc", this.tenantId, id);
2720
2820
  const result = [];
2721
2821
  for (const v of versions) {
@@ -2737,14 +2837,14 @@ class BaseMindooTenant {
2737
2837
  * Returns the number of versions removed.
2738
2838
  */
2739
2839
  async removeDecryptionKeyVersionsByFingerprint(keyId, fingerprints) {
2740
- if (keyId === types_1.PUBLIC_INFOS_KEY_ID) {
2840
+ if (keyId === types_2.PUBLIC_INFOS_KEY_ID) {
2741
2841
  this.logger.debug(`removeDecryptionKeyVersionsByFingerprint: refusing protected key ${keyId}`);
2742
2842
  return 0;
2743
2843
  }
2744
2844
  const target = new Set(fingerprints);
2745
2845
  if (target.size === 0)
2746
2846
  return 0;
2747
- const id = keyId === "default" ? types_1.DEFAULT_TENANT_KEY_ID : keyId;
2847
+ const id = keyId === "default" ? types_2.DEFAULT_TENANT_KEY_ID : keyId;
2748
2848
  let removed = 0;
2749
2849
  // Re-read versions each pass: deleteKeyVersion is index-based against the
2750
2850
  // current sorted list, which shifts as entries are removed.
@@ -2795,9 +2895,9 @@ class BaseMindooTenant {
2795
2895
  if (this.decryptedTenantKeyCache) {
2796
2896
  return this.decryptedTenantKeyCache;
2797
2897
  }
2798
- const tenantKey = await this.keyBag.get("doc", this.tenantId, types_1.DEFAULT_TENANT_KEY_ID);
2898
+ const tenantKey = await this.keyBag.get("doc", this.tenantId, types_2.DEFAULT_TENANT_KEY_ID);
2799
2899
  if (!tenantKey) {
2800
- throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}`);
2900
+ throw new errors_1.SymmetricKeyNotFoundError(`doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}`);
2801
2901
  }
2802
2902
  const symmetricKey = tenantKey;
2803
2903
  this.decryptedTenantKeyCache = symmetricKey;
@@ -2913,7 +3013,7 @@ class BaseMindooTenant {
2913
3013
  // encrypted under an earlier rotation of the key still decrypt.
2914
3014
  const candidates = await this.getDecryptionKeyCandidates(decryptionKeyId);
2915
3015
  if (candidates.length === 0) {
2916
- throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_1.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
3016
+ throw new errors_1.SymmetricKeyNotFoundError(decryptionKeyId === "default" ? `doc:${this.tenantId}:${types_2.DEFAULT_TENANT_KEY_ID}` : decryptionKeyId);
2917
3017
  }
2918
3018
  const subtle = this.cryptoAdapter.getSubtle();
2919
3019
  let lastError = undefined;