@brightchain/brightchain-api-lib 0.14.0 → 0.15.0
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/package.json +5 -5
- package/src/index.d.ts +3 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js +5 -0
- package/src/index.js.map +1 -1
- package/src/lib/application.d.ts +1 -0
- package/src/lib/application.d.ts.map +1 -1
- package/src/lib/application.js +23 -0
- package/src/lib/application.js.map +1 -1
- package/src/lib/auth/aclEnforcedAvailability.d.ts +57 -0
- package/src/lib/auth/aclEnforcedAvailability.d.ts.map +1 -0
- package/src/lib/auth/aclEnforcedAvailability.js +87 -0
- package/src/lib/auth/aclEnforcedAvailability.js.map +1 -0
- package/src/lib/auth/aclEnforcedBlockStore.d.ts +66 -0
- package/src/lib/auth/aclEnforcedBlockStore.d.ts.map +1 -0
- package/src/lib/auth/aclEnforcedBlockStore.js +83 -0
- package/src/lib/auth/aclEnforcedBlockStore.js.map +1 -0
- package/src/lib/auth/ecdsaNodeAuthenticator.d.ts +46 -0
- package/src/lib/auth/ecdsaNodeAuthenticator.d.ts.map +1 -0
- package/src/lib/auth/ecdsaNodeAuthenticator.js +110 -0
- package/src/lib/auth/ecdsaNodeAuthenticator.js.map +1 -0
- package/src/lib/auth/index.d.ts +7 -0
- package/src/lib/auth/index.d.ts.map +1 -0
- package/src/lib/auth/index.js +13 -0
- package/src/lib/auth/index.js.map +1 -0
- package/src/lib/auth/poolAclBootstrap.d.ts +36 -0
- package/src/lib/auth/poolAclBootstrap.d.ts.map +1 -0
- package/src/lib/auth/poolAclBootstrap.js +64 -0
- package/src/lib/auth/poolAclBootstrap.js.map +1 -0
- package/src/lib/auth/poolAclStore.d.ts +77 -0
- package/src/lib/auth/poolAclStore.d.ts.map +1 -0
- package/src/lib/auth/poolAclStore.js +189 -0
- package/src/lib/auth/poolAclStore.js.map +1 -0
- package/src/lib/auth/poolAclUpdater.d.ts +79 -0
- package/src/lib/auth/poolAclUpdater.d.ts.map +1 -0
- package/src/lib/auth/poolAclUpdater.js +144 -0
- package/src/lib/auth/poolAclUpdater.js.map +1 -0
- package/src/lib/availability/availabilityService.d.ts +2 -2
- package/src/lib/availability/availabilityService.d.ts.map +1 -1
- package/src/lib/availability/availabilityService.js +12 -5
- package/src/lib/availability/availabilityService.js.map +1 -1
- package/src/lib/availability/blockRegistry.d.ts +45 -3
- package/src/lib/availability/blockRegistry.d.ts.map +1 -1
- package/src/lib/availability/blockRegistry.js +123 -5
- package/src/lib/availability/blockRegistry.js.map +1 -1
- package/src/lib/availability/discoveryProtocol.d.ts +30 -1
- package/src/lib/availability/discoveryProtocol.d.ts.map +1 -1
- package/src/lib/availability/discoveryProtocol.js +76 -0
- package/src/lib/availability/discoveryProtocol.js.map +1 -1
- package/src/lib/availability/gossipService.d.ts +45 -6
- package/src/lib/availability/gossipService.d.ts.map +1 -1
- package/src/lib/availability/gossipService.js +177 -5
- package/src/lib/availability/gossipService.js.map +1 -1
- package/src/lib/availability/reconciliationService.d.ts +88 -1
- package/src/lib/availability/reconciliationService.d.ts.map +1 -1
- package/src/lib/availability/reconciliationService.js +246 -48
- package/src/lib/availability/reconciliationService.js.map +1 -1
- package/src/lib/blockFetch/blockFetcher.d.ts +100 -0
- package/src/lib/blockFetch/blockFetcher.d.ts.map +1 -0
- package/src/lib/blockFetch/blockFetcher.js +279 -0
- package/src/lib/blockFetch/blockFetcher.js.map +1 -0
- package/src/lib/blockFetch/fetchQueue.d.ts +88 -0
- package/src/lib/blockFetch/fetchQueue.d.ts.map +1 -0
- package/src/lib/blockFetch/fetchQueue.js +204 -0
- package/src/lib/blockFetch/fetchQueue.js.map +1 -0
- package/src/lib/blockFetch/httpBlockFetchTransport.d.ts +65 -0
- package/src/lib/blockFetch/httpBlockFetchTransport.d.ts.map +1 -0
- package/src/lib/blockFetch/httpBlockFetchTransport.js +104 -0
- package/src/lib/blockFetch/httpBlockFetchTransport.js.map +1 -0
- package/src/lib/blockFetch/index.d.ts +10 -0
- package/src/lib/blockFetch/index.d.ts.map +1 -0
- package/src/lib/blockFetch/index.js +13 -0
- package/src/lib/blockFetch/index.js.map +1 -0
- package/src/lib/controllers/api/brightpass.d.ts +72 -0
- package/src/lib/controllers/api/brightpass.d.ts.map +1 -0
- package/src/lib/controllers/api/brightpass.js +577 -0
- package/src/lib/controllers/api/brightpass.js.map +1 -0
- package/src/lib/controllers/api/channels.d.ts +122 -0
- package/src/lib/controllers/api/channels.d.ts.map +1 -0
- package/src/lib/controllers/api/channels.js +701 -0
- package/src/lib/controllers/api/channels.js.map +1 -0
- package/src/lib/controllers/api/conversations.d.ts +89 -0
- package/src/lib/controllers/api/conversations.d.ts.map +1 -0
- package/src/lib/controllers/api/conversations.js +259 -0
- package/src/lib/controllers/api/conversations.js.map +1 -0
- package/src/lib/controllers/api/emails.d.ts +122 -0
- package/src/lib/controllers/api/emails.d.ts.map +1 -0
- package/src/lib/controllers/api/emails.js +494 -0
- package/src/lib/controllers/api/emails.js.map +1 -0
- package/src/lib/controllers/api/explodingMessages.d.ts +79 -0
- package/src/lib/controllers/api/explodingMessages.d.ts.map +1 -0
- package/src/lib/controllers/api/explodingMessages.js +378 -0
- package/src/lib/controllers/api/explodingMessages.js.map +1 -0
- package/src/lib/controllers/api/groups.d.ts +94 -0
- package/src/lib/controllers/api/groups.d.ts.map +1 -0
- package/src/lib/controllers/api/groups.js +484 -0
- package/src/lib/controllers/api/groups.js.map +1 -0
- package/src/lib/controllers/api/index.d.ts +6 -0
- package/src/lib/controllers/api/index.d.ts.map +1 -1
- package/src/lib/controllers/api/index.js +6 -0
- package/src/lib/controllers/api/index.js.map +1 -1
- package/src/lib/controllers/api/messages.d.ts.map +1 -1
- package/src/lib/controllers/api/messages.js +2 -1
- package/src/lib/controllers/api/messages.js.map +1 -1
- package/src/lib/controllers/api/sync.d.ts +38 -2
- package/src/lib/controllers/api/sync.d.ts.map +1 -1
- package/src/lib/controllers/api/sync.js +89 -0
- package/src/lib/controllers/api/sync.js.map +1 -1
- package/src/lib/controllers/crypto/gitController.d.ts +70 -0
- package/src/lib/controllers/crypto/gitController.d.ts.map +1 -0
- package/src/lib/controllers/crypto/gitController.js +306 -0
- package/src/lib/controllers/crypto/gitController.js.map +1 -0
- package/src/lib/controllers/crypto/index.d.ts +3 -0
- package/src/lib/controllers/crypto/index.d.ts.map +1 -0
- package/src/lib/controllers/crypto/index.js +6 -0
- package/src/lib/controllers/crypto/index.js.map +1 -0
- package/src/lib/controllers/crypto/walletController.d.ts +64 -0
- package/src/lib/controllers/crypto/walletController.d.ts.map +1 -0
- package/src/lib/controllers/crypto/walletController.js +260 -0
- package/src/lib/controllers/crypto/walletController.js.map +1 -0
- package/src/lib/controllers/identity/deviceController.d.ts +96 -0
- package/src/lib/controllers/identity/deviceController.d.ts.map +1 -0
- package/src/lib/controllers/identity/deviceController.js +355 -0
- package/src/lib/controllers/identity/deviceController.js.map +1 -0
- package/src/lib/controllers/identity/directoryController.d.ts +75 -0
- package/src/lib/controllers/identity/directoryController.d.ts.map +1 -0
- package/src/lib/controllers/identity/directoryController.js +288 -0
- package/src/lib/controllers/identity/directoryController.js.map +1 -0
- package/src/lib/controllers/identity/identityProofController.d.ts +94 -0
- package/src/lib/controllers/identity/identityProofController.d.ts.map +1 -0
- package/src/lib/controllers/identity/identityProofController.js +454 -0
- package/src/lib/controllers/identity/identityProofController.js.map +1 -0
- package/src/lib/controllers/identity/index.d.ts +4 -0
- package/src/lib/controllers/identity/index.d.ts.map +1 -0
- package/src/lib/controllers/identity/index.js +7 -0
- package/src/lib/controllers/identity/index.js.map +1 -0
- package/src/lib/controllers/index.d.ts +2 -0
- package/src/lib/controllers/index.d.ts.map +1 -1
- package/src/lib/controllers/index.js +2 -0
- package/src/lib/controllers/index.js.map +1 -1
- package/src/lib/encryption/encryptedMetadataService.d.ts +87 -0
- package/src/lib/encryption/encryptedMetadataService.d.ts.map +1 -0
- package/src/lib/encryption/encryptedMetadataService.js +224 -0
- package/src/lib/encryption/encryptedMetadataService.js.map +1 -0
- package/src/lib/encryption/encryptionAwareReplication.d.ts +76 -0
- package/src/lib/encryption/encryptionAwareReplication.d.ts.map +1 -0
- package/src/lib/encryption/encryptionAwareReplication.js +116 -0
- package/src/lib/encryption/encryptionAwareReplication.js.map +1 -0
- package/src/lib/encryption/errors.d.ts +49 -0
- package/src/lib/encryption/errors.d.ts.map +1 -0
- package/src/lib/encryption/errors.js +80 -0
- package/src/lib/encryption/errors.js.map +1 -0
- package/src/lib/encryption/index.d.ts +6 -0
- package/src/lib/encryption/index.d.ts.map +1 -0
- package/src/lib/encryption/index.js +9 -0
- package/src/lib/encryption/index.js.map +1 -0
- package/src/lib/encryption/poolEncryptionService.d.ts +94 -0
- package/src/lib/encryption/poolEncryptionService.d.ts.map +1 -0
- package/src/lib/encryption/poolEncryptionService.js +252 -0
- package/src/lib/encryption/poolEncryptionService.js.map +1 -0
- package/src/lib/encryption/poolKeyManager.d.ts +82 -0
- package/src/lib/encryption/poolKeyManager.d.ts.map +1 -0
- package/src/lib/encryption/poolKeyManager.js +156 -0
- package/src/lib/encryption/poolKeyManager.js.map +1 -0
- package/src/lib/environment.d.ts +3 -0
- package/src/lib/environment.d.ts.map +1 -1
- package/src/lib/environment.js +5 -0
- package/src/lib/environment.js.map +1 -1
- package/src/lib/interfaces/environment.d.ts +7 -1
- package/src/lib/interfaces/environment.d.ts.map +1 -1
- package/src/lib/interfaces/index.d.ts +0 -1
- package/src/lib/interfaces/index.d.ts.map +1 -1
- package/src/lib/interfaces/requests/getBlockDataRequest.d.ts +12 -0
- package/src/lib/interfaces/requests/getBlockDataRequest.d.ts.map +1 -0
- package/src/lib/interfaces/{blockStore.js → requests/getBlockDataRequest.js} +1 -1
- package/src/lib/interfaces/requests/getBlockDataRequest.js.map +1 -0
- package/src/lib/interfaces/requests/index.d.ts +1 -0
- package/src/lib/interfaces/requests/index.d.ts.map +1 -1
- package/src/lib/routers/api.d.ts +54 -1
- package/src/lib/routers/api.d.ts.map +1 -1
- package/src/lib/routers/api.js +77 -0
- package/src/lib/routers/api.js.map +1 -1
- package/src/lib/services/blockStore.d.ts +5 -2
- package/src/lib/services/blockStore.d.ts.map +1 -1
- package/src/lib/services/blockStore.js +4 -0
- package/src/lib/services/blockStore.js.map +1 -1
- package/src/lib/services/brightpass/auditLogger.d.ts +77 -0
- package/src/lib/services/brightpass/auditLogger.d.ts.map +1 -0
- package/src/lib/services/brightpass/auditLogger.js +184 -0
- package/src/lib/services/brightpass/auditLogger.js.map +1 -0
- package/src/lib/services/brightpass/vaultEncryption.d.ts +82 -0
- package/src/lib/services/brightpass/vaultEncryption.d.ts.map +1 -0
- package/src/lib/services/brightpass/vaultEncryption.js +144 -0
- package/src/lib/services/brightpass/vaultEncryption.js.map +1 -0
- package/src/lib/services/brightpass.d.ts +294 -0
- package/src/lib/services/brightpass.d.ts.map +1 -0
- package/src/lib/services/brightpass.js +1260 -0
- package/src/lib/services/brightpass.js.map +1 -0
- package/src/lib/services/eventNotificationSystem.d.ts +69 -3
- package/src/lib/services/eventNotificationSystem.d.ts.map +1 -1
- package/src/lib/services/eventNotificationSystem.js +200 -0
- package/src/lib/services/eventNotificationSystem.js.map +1 -1
- package/src/lib/services/expirationScheduler.d.ts +90 -0
- package/src/lib/services/expirationScheduler.d.ts.map +1 -0
- package/src/lib/services/expirationScheduler.js +131 -0
- package/src/lib/services/expirationScheduler.js.map +1 -0
- package/src/lib/services/fecUsageExample.d.ts +2 -2
- package/src/lib/services/index.d.ts +2 -0
- package/src/lib/services/index.d.ts.map +1 -1
- package/src/lib/services/index.js +2 -0
- package/src/lib/services/index.js.map +1 -1
- package/src/lib/services/paginationService.d.ts +18 -0
- package/src/lib/services/paginationService.d.ts.map +1 -0
- package/src/lib/services/paginationService.js +32 -0
- package/src/lib/services/paginationService.js.map +1 -0
- package/src/lib/services/presenceService.d.ts +76 -0
- package/src/lib/services/presenceService.d.ts.map +1 -0
- package/src/lib/services/presenceService.js +143 -0
- package/src/lib/services/presenceService.js.map +1 -0
- package/src/lib/services/wireConversationPromotion.d.ts +23 -0
- package/src/lib/services/wireConversationPromotion.d.ts.map +1 -0
- package/src/lib/services/wireConversationPromotion.js +26 -0
- package/src/lib/services/wireConversationPromotion.js.map +1 -0
- package/src/lib/stores/availabilityAwareBlockStore.d.ts +115 -10
- package/src/lib/stores/availabilityAwareBlockStore.d.ts.map +1 -1
- package/src/lib/stores/availabilityAwareBlockStore.js +267 -23
- package/src/lib/stores/availabilityAwareBlockStore.js.map +1 -1
- package/src/lib/stores/diskBlockAsyncStore.d.ts +81 -2
- package/src/lib/stores/diskBlockAsyncStore.d.ts.map +1 -1
- package/src/lib/stores/diskBlockAsyncStore.js +297 -10
- package/src/lib/stores/diskBlockAsyncStore.js.map +1 -1
- package/src/lib/utils/communicationValidation.d.ts +44 -0
- package/src/lib/utils/communicationValidation.d.ts.map +1 -0
- package/src/lib/utils/communicationValidation.js +291 -0
- package/src/lib/utils/communicationValidation.js.map +1 -0
- package/src/lib/utils/emailValidation.d.ts +19 -0
- package/src/lib/utils/emailValidation.d.ts.map +1 -0
- package/src/lib/utils/emailValidation.js +232 -0
- package/src/lib/utils/emailValidation.js.map +1 -0
- package/src/lib/interfaces/blockStore.d.ts +0 -7
- package/src/lib/interfaces/blockStore.d.ts.map +0 -1
- package/src/lib/interfaces/blockStore.js.map +0 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BrightPassService — core vault operations for the BrightPass password manager.
|
|
3
|
+
*
|
|
4
|
+
* Manages vault lifecycle (create, open, list, delete), entry CRUD,
|
|
5
|
+
* search, sharing, emergency access, and import operations.
|
|
6
|
+
*
|
|
7
|
+
* Uses IBlockStore for persistent storage, VCBLService for VCBL operations,
|
|
8
|
+
* BlockService for encryption, and maintains a lightweight in-memory index
|
|
9
|
+
* for quick lookups.
|
|
10
|
+
*
|
|
11
|
+
* Requirements: 1.1–1.8, 2.1–2.9, 3.1–3.5, 4.1–4.4
|
|
12
|
+
*/
|
|
13
|
+
import { AttachmentReference, AuditLogEntry, AutofillPayload, BlockService, DecryptedVault, EmergencyAccessConfig, EncryptedShare, EntryPropertyRecord, EntrySearchQuery, IBlockStore, ImportFormat, ImportResult, VaultEntry, VaultMetadata, VCBLService } from '@brightchain/brightchain-lib';
|
|
14
|
+
import { Member, PlatformID } from '@digitaldefiance/ecies-lib';
|
|
15
|
+
/**
|
|
16
|
+
* Errors specific to BrightPass operations
|
|
17
|
+
*/
|
|
18
|
+
export declare class VaultNotFoundError extends Error {
|
|
19
|
+
constructor(vaultId: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class VaultAuthenticationError extends Error {
|
|
22
|
+
constructor();
|
|
23
|
+
}
|
|
24
|
+
export declare class VaultConflictError extends Error {
|
|
25
|
+
constructor(name: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class EntryNotFoundError extends Error {
|
|
28
|
+
constructor(entryId: string);
|
|
29
|
+
}
|
|
30
|
+
export declare class EmergencyAccessError extends Error {
|
|
31
|
+
constructor(message: string);
|
|
32
|
+
}
|
|
33
|
+
export declare class BrightPassService<TID extends PlatformID = Uint8Array> {
|
|
34
|
+
/** Block store for persistent storage (injected) */
|
|
35
|
+
private readonly blockStore;
|
|
36
|
+
/** VCBL service for vault operations (injected) */
|
|
37
|
+
private readonly vcblService;
|
|
38
|
+
/** Block service for encryption/decryption (injected) */
|
|
39
|
+
private readonly blockService;
|
|
40
|
+
/** Member for block creation (injected) */
|
|
41
|
+
private readonly member;
|
|
42
|
+
/** vaultId → StoredVault for vault data management */
|
|
43
|
+
private readonly vaults;
|
|
44
|
+
/** vaultId → VaultIndexEntry for lightweight lookups */
|
|
45
|
+
private readonly vaultIndex;
|
|
46
|
+
/** memberId → Set<vaultId> for quick listing */
|
|
47
|
+
private readonly memberVaults;
|
|
48
|
+
/**
|
|
49
|
+
* Create a new BrightPassService.
|
|
50
|
+
*
|
|
51
|
+
* @param blockStore - Block store for persistent storage (defaults to MemoryBlockStore)
|
|
52
|
+
* @param vcblService - VCBL service for vault operations
|
|
53
|
+
* @param blockService - Block service for encryption
|
|
54
|
+
* @param member - Member for block creation
|
|
55
|
+
*
|
|
56
|
+
* Requirements: 1.1, 1.5
|
|
57
|
+
*/
|
|
58
|
+
constructor(blockStore?: IBlockStore, vcblService?: VCBLService<TID>, blockService?: BlockService<TID>, member?: Member<TID>);
|
|
59
|
+
/** bcrypt cost factor - 12 rounds provides ~300ms hash time on modern hardware */
|
|
60
|
+
private static readonly BCRYPT_ROUNDS;
|
|
61
|
+
/**
|
|
62
|
+
* Hash a master password using bcrypt for secure storage and comparison.
|
|
63
|
+
* Uses bcrypt with 12 rounds for strong protection against brute-force attacks.
|
|
64
|
+
*
|
|
65
|
+
* Security: bcrypt includes salt automatically and is designed to be slow,
|
|
66
|
+
* making brute-force attacks computationally expensive.
|
|
67
|
+
*/
|
|
68
|
+
private hashMasterPasswordAsync;
|
|
69
|
+
/**
|
|
70
|
+
* Verify a master password against a stored bcrypt hash.
|
|
71
|
+
* Uses constant-time comparison internally via bcrypt.compare().
|
|
72
|
+
*/
|
|
73
|
+
private verifyMasterPassword;
|
|
74
|
+
/**
|
|
75
|
+
* Generate a new BIP39 mnemonic and seed for a vault.
|
|
76
|
+
* Each vault has its own independent mnemonic that can be cycled/regenerated.
|
|
77
|
+
*
|
|
78
|
+
* Security: Uses 256 bits of entropy for a 24-word mnemonic.
|
|
79
|
+
* The mnemonic should be stored encrypted and can be backed up separately.
|
|
80
|
+
*
|
|
81
|
+
* @returns Object containing the mnemonic (24 words) and derived seed (64 bytes)
|
|
82
|
+
*/
|
|
83
|
+
private generateVaultBip39;
|
|
84
|
+
/**
|
|
85
|
+
* Regenerate a vault's BIP39 seed (key rotation).
|
|
86
|
+
* This creates a new mnemonic and re-encrypts all entries with the new key.
|
|
87
|
+
*
|
|
88
|
+
* Security: This is a critical operation that should be used when:
|
|
89
|
+
* - A share has been revoked and the vault needs re-keying
|
|
90
|
+
* - The vault owner suspects key compromise
|
|
91
|
+
* - Periodic key rotation policy requires it
|
|
92
|
+
*
|
|
93
|
+
* @param vaultId - The vault to regenerate
|
|
94
|
+
* @param masterPassword - Current master password for verification
|
|
95
|
+
* @returns The new mnemonic (should be backed up by the user)
|
|
96
|
+
*/
|
|
97
|
+
regenerateVaultSeed(vaultId: string, masterPassword: string): Promise<string>;
|
|
98
|
+
/**
|
|
99
|
+
* Extract an EntryPropertyRecord from a VaultEntry.
|
|
100
|
+
*/
|
|
101
|
+
private entryToPropertyRecord;
|
|
102
|
+
/**
|
|
103
|
+
* Check if block store operations are safe to perform.
|
|
104
|
+
* Block store operations require the global service provider to be initialized.
|
|
105
|
+
* Returns false if the service provider is not available.
|
|
106
|
+
*/
|
|
107
|
+
private isBlockStoreOperationsSafe;
|
|
108
|
+
/**
|
|
109
|
+
* Get a vault or throw VaultNotFoundError.
|
|
110
|
+
*/
|
|
111
|
+
private getVaultOrThrow;
|
|
112
|
+
/**
|
|
113
|
+
* Update the VCBL in the block store after entry changes.
|
|
114
|
+
* Creates a new VCBL with updated property records and entry addresses,
|
|
115
|
+
* encrypts it, and stores it in the block store.
|
|
116
|
+
* Requirements: 2.2, 2.3, 2.4, 3.2
|
|
117
|
+
*/
|
|
118
|
+
private updateVcblInBlockStore;
|
|
119
|
+
/**
|
|
120
|
+
* Create a new vault.
|
|
121
|
+
* Generates a vault-specific BIP39 mnemonic and derives the vault key from it.
|
|
122
|
+
* Uses bcrypt for secure password hashing.
|
|
123
|
+
*
|
|
124
|
+
* Security: Each vault has its own independent BIP39 seed that can be
|
|
125
|
+
* regenerated/cycled without affecting other vaults or the member's identity.
|
|
126
|
+
*
|
|
127
|
+
* Requirements: 1.1, 3.1, 3.2
|
|
128
|
+
*/
|
|
129
|
+
createVault(memberId: string, name: string, masterPassword: string): Promise<VaultMetadata>;
|
|
130
|
+
/**
|
|
131
|
+
* Open an existing vault with the correct master password.
|
|
132
|
+
* Returns vault metadata and property records (no entry decryption).
|
|
133
|
+
* When VCBLService is available, retrieves and parses VCBL from block store.
|
|
134
|
+
* Requirements: 1.2, 1.3, 3.3, 3.4
|
|
135
|
+
*/
|
|
136
|
+
openVault(memberId: string, vaultId: string, masterPassword: string): Promise<DecryptedVault>;
|
|
137
|
+
/**
|
|
138
|
+
* List all vaults owned by or shared with a member.
|
|
139
|
+
* Returns metadata only — no decryption needed.
|
|
140
|
+
* Requirements: 1.4
|
|
141
|
+
*/
|
|
142
|
+
listVaults(memberId: string): Promise<VaultMetadata[]>;
|
|
143
|
+
/**
|
|
144
|
+
* Delete a vault and all its entries.
|
|
145
|
+
* Requirements: 1.5
|
|
146
|
+
*/
|
|
147
|
+
deleteVault(memberId: string, vaultId: string, masterPassword: string): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Add a new entry to a vault.
|
|
150
|
+
* Encrypts the entry using AES-256-GCM, stores in block store (when available),
|
|
151
|
+
* and appends block checksum + property record to VCBL parallel arrays.
|
|
152
|
+
* Requirements: 2.1, 2.2, 3.2
|
|
153
|
+
*/
|
|
154
|
+
addEntry(vaultId: string, entry: VaultEntry): Promise<VaultEntry>;
|
|
155
|
+
/**
|
|
156
|
+
* Get a single entry by ID from a vault.
|
|
157
|
+
* Retrieves from block store and decrypts the entry using AES-256-GCM.
|
|
158
|
+
* Requirements: 2.2, 2.3, 3.2
|
|
159
|
+
*/
|
|
160
|
+
getEntry(vaultId: string, entryId: string): Promise<VaultEntry>;
|
|
161
|
+
/**
|
|
162
|
+
* Update an existing entry in a vault.
|
|
163
|
+
* Decrypts, updates, re-encrypts using AES-256-GCM, stores in block store (when available),
|
|
164
|
+
* and updates the VCBL property record.
|
|
165
|
+
* Requirements: 2.3, 2.4, 3.2
|
|
166
|
+
*/
|
|
167
|
+
updateEntry(vaultId: string, entryId: string, updates: Partial<VaultEntry>): Promise<VaultEntry>;
|
|
168
|
+
/**
|
|
169
|
+
* Delete an entry from a vault.
|
|
170
|
+
* Removes the entry block from block store (when available), and removes from VCBL at the matching index.
|
|
171
|
+
* Requirements: 2.4
|
|
172
|
+
*/
|
|
173
|
+
deleteEntry(vaultId: string, entryId: string): Promise<void>;
|
|
174
|
+
/**
|
|
175
|
+
* Search entries in a vault by filtering VCBL property records.
|
|
176
|
+
* Requirements: 2.9
|
|
177
|
+
*/
|
|
178
|
+
searchEntries(vaultId: string, query: EntrySearchQuery): Promise<EntryPropertyRecord[]>;
|
|
179
|
+
/**
|
|
180
|
+
* Share a vault with one or more recipients.
|
|
181
|
+
* Updates the VCBL header shared list and tracks member→vault mapping.
|
|
182
|
+
* Requirements: 4.1, 4.2
|
|
183
|
+
*/
|
|
184
|
+
shareVault(vaultId: string, recipientMemberIds: string[]): Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Revoke a member's access to a shared vault.
|
|
187
|
+
* Removes from VCBL header shared list and re-keys the vault.
|
|
188
|
+
* Requirements: 4.3
|
|
189
|
+
*/
|
|
190
|
+
revokeShare(vaultId: string, memberId: string): Promise<void>;
|
|
191
|
+
/**
|
|
192
|
+
* Configure quorum governance for a shared vault.
|
|
193
|
+
* When threshold > 0, opening the vault requires that many member approvals.
|
|
194
|
+
* Requirements: 4.4
|
|
195
|
+
*/
|
|
196
|
+
configureQuorumGovernance(vaultId: string, threshold: number): Promise<void>;
|
|
197
|
+
/**
|
|
198
|
+
* Submit a quorum approval for a vault.
|
|
199
|
+
* The member must be the owner or a shared member.
|
|
200
|
+
* Returns true if the quorum threshold has been met.
|
|
201
|
+
* Requirements: 4.4
|
|
202
|
+
*/
|
|
203
|
+
approveQuorumAccess(vaultId: string, memberId: string): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Check whether the quorum threshold has been met for a vault.
|
|
206
|
+
*/
|
|
207
|
+
isQuorumMet(vaultId: string): boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Reset quorum approvals (e.g. after vault is closed or session ends).
|
|
210
|
+
*/
|
|
211
|
+
resetQuorumApprovals(vaultId: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Change the master password for a vault.
|
|
214
|
+
* Verifies old password, re-derives vault key with new password,
|
|
215
|
+
* decrypts all entries with old key, and re-encrypts with new key.
|
|
216
|
+
*
|
|
217
|
+
* Note: This only changes the password, not the vault's BIP39 seed.
|
|
218
|
+
* Use regenerateVaultSeed() for full key rotation.
|
|
219
|
+
*
|
|
220
|
+
* Requirements: 3.4, 3.2
|
|
221
|
+
*/
|
|
222
|
+
changeMasterPassword(memberId: string, vaultId: string, oldPassword: string, newPassword: string): Promise<void>;
|
|
223
|
+
/**
|
|
224
|
+
* Split the vault key into Shamir shares for emergency recovery.
|
|
225
|
+
* Uses proper Shamir Secret Sharing (polynomial interpolation over GF(256)).
|
|
226
|
+
* Each trustee receives an encrypted share; threshold shares are needed to reconstruct.
|
|
227
|
+
*
|
|
228
|
+
* Security: Uses @digitaldefiance/secrets library which implements proper
|
|
229
|
+
* Shamir Secret Sharing with cryptographically secure random coefficients.
|
|
230
|
+
*
|
|
231
|
+
* Requirements: 10.1, 10.2, 10.3
|
|
232
|
+
*/
|
|
233
|
+
configureEmergencyAccess(vaultId: string, threshold: number, trustees: string[]): Promise<EmergencyAccessConfig>;
|
|
234
|
+
/**
|
|
235
|
+
* Recover a vault using emergency shares.
|
|
236
|
+
* Uses proper Shamir Secret Sharing reconstruction (polynomial interpolation).
|
|
237
|
+
* Requires at least threshold shares to reconstruct the vault key.
|
|
238
|
+
*
|
|
239
|
+
* Security: The combine() function performs Lagrange interpolation over GF(256)
|
|
240
|
+
* to reconstruct the secret. With fewer than threshold shares, reconstruction
|
|
241
|
+
* is cryptographically impossible.
|
|
242
|
+
*
|
|
243
|
+
* Requirements: 10.2, 10.3, 10.4
|
|
244
|
+
*/
|
|
245
|
+
recoverWithShares(vaultId: string, shares: EncryptedShare[]): Promise<DecryptedVault>;
|
|
246
|
+
/**
|
|
247
|
+
* Revoke emergency access configuration, invalidating all existing shares.
|
|
248
|
+
* Requirements: 10.5
|
|
249
|
+
*/
|
|
250
|
+
revokeEmergencyAccess(vaultId: string): Promise<void>;
|
|
251
|
+
/**
|
|
252
|
+
* Get the encrypted shares for a vault's emergency access.
|
|
253
|
+
* In production, shares would be distributed to trustees via secure channels.
|
|
254
|
+
* Requirements: 10.2
|
|
255
|
+
*/
|
|
256
|
+
getEmergencyShares(vaultId: string): EncryptedShare[];
|
|
257
|
+
/**
|
|
258
|
+
* Get autofill payload for a given site URL.
|
|
259
|
+
* Searches VCBL property records by siteUrl, decrypts matching login entries,
|
|
260
|
+
* and includes TOTP code if configured.
|
|
261
|
+
* Requirements: 5.7
|
|
262
|
+
*/
|
|
263
|
+
getAutofillPayload(vaultId: string, siteUrl: string): Promise<AutofillPayload>;
|
|
264
|
+
/**
|
|
265
|
+
* Add an attachment to a vault entry.
|
|
266
|
+
* Stores the file as an encrypted block and adds a reference to the entry.
|
|
267
|
+
* Requirements: 1.7, 2.8
|
|
268
|
+
*/
|
|
269
|
+
addAttachment(vaultId: string, entryId: string, file: Buffer, filename: string, mimeType?: string): Promise<AttachmentReference>;
|
|
270
|
+
/**
|
|
271
|
+
* Get an attachment's data by ID.
|
|
272
|
+
* Decrypts the attachment using AES-256-GCM.
|
|
273
|
+
* Requirements: 2.8, 3.2
|
|
274
|
+
*/
|
|
275
|
+
getAttachment(vaultId: string, entryId: string, attachmentId: string): Promise<Buffer>;
|
|
276
|
+
/**
|
|
277
|
+
* Delete an attachment from a vault entry.
|
|
278
|
+
* Removes the attachment block and updates the entry reference.
|
|
279
|
+
* Requirements: 2.8, 3.2
|
|
280
|
+
*/
|
|
281
|
+
deleteAttachment(vaultId: string, entryId: string, attachmentId: string): Promise<void>;
|
|
282
|
+
/**
|
|
283
|
+
* Import entries from a password manager export file.
|
|
284
|
+
* Parses the file, maps to VaultEntry types, and adds each to the vault.
|
|
285
|
+
* Requirements: 12.1–12.10
|
|
286
|
+
*/
|
|
287
|
+
importFromFile(vaultId: string, format: ImportFormat, fileContent: Buffer): Promise<ImportResult>;
|
|
288
|
+
/**
|
|
289
|
+
* Get audit log entries for a vault.
|
|
290
|
+
* Requirements: 9.3
|
|
291
|
+
*/
|
|
292
|
+
getAuditLog(vaultId: string): Promise<AuditLogEntry[]>;
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=brightpass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brightpass.d.ts","sourceRoot":"","sources":["../../../../../brightchain-api-lib/src/lib/services/brightpass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,mBAAmB,EAEnB,aAAa,EACb,eAAe,EAEf,YAAY,EAKZ,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAEhB,WAAW,EACX,YAAY,EAEZ,YAAY,EAIZ,UAAU,EAEV,aAAa,EAGb,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AA+EhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,wBAAyB,SAAQ,KAAK;;CAKlD;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,IAAI,EAAE,MAAM;CAIzB;AAED,qBAAa,kBAAmB,SAAQ,KAAK;gBAC/B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,iBAAiB,CAAC,GAAG,SAAS,UAAU,GAAG,UAAU;IAChE,oDAAoD;IACpD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,mDAAmD;IACnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAmB;IAC/C,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,2CAA2C;IAC3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IAErC,sDAAsD;IACtD,OAAO,CAAC,QAAQ,CAAC,MA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