@bitwarden/sdk-internal 0.2.0-main.420 → 0.2.0-main.422
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/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +465 -438
- package/bitwarden_wasm_internal_bg.js +110 -110
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +5 -5
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +465 -438
- package/node/bitwarden_wasm_internal.js +110 -110
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +5 -5
- package/package.json +1 -1
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Generate a new SSH key pair
|
|
5
|
+
*
|
|
6
|
+
* # Arguments
|
|
7
|
+
* - `key_algorithm` - The algorithm to use for the key pair
|
|
8
|
+
*
|
|
9
|
+
* # Returns
|
|
10
|
+
* - `Ok(SshKey)` if the key was successfully generated
|
|
11
|
+
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
12
|
+
*/
|
|
13
|
+
export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
|
|
3
14
|
/**
|
|
4
15
|
* Convert a PCKS8 or OpenSSH encrypted or unencrypted private key
|
|
5
16
|
* to an OpenSSH private key with public key and fingerprint
|
|
@@ -16,17 +27,6 @@
|
|
|
16
27
|
* - `Err(UnsupportedKeyType)` if the key type is not supported
|
|
17
28
|
*/
|
|
18
29
|
export function import_ssh_key(imported_key: string, password?: string | null): SshKeyView;
|
|
19
|
-
/**
|
|
20
|
-
* Generate a new SSH key pair
|
|
21
|
-
*
|
|
22
|
-
* # Arguments
|
|
23
|
-
* - `key_algorithm` - The algorithm to use for the key pair
|
|
24
|
-
*
|
|
25
|
-
* # Returns
|
|
26
|
-
* - `Ok(SshKey)` if the key was successfully generated
|
|
27
|
-
* - `Err(KeyGenerationError)` if the key could not be generated
|
|
28
|
-
*/
|
|
29
|
-
export function generate_ssh_key(key_algorithm: KeyAlgorithm): SshKeyView;
|
|
30
30
|
export function init_sdk(log_level?: LogLevel | null): void;
|
|
31
31
|
/**
|
|
32
32
|
* Sends a DiscoverRequest to the specified destination and returns the response.
|
|
@@ -180,55 +180,43 @@ export interface TokenProvider {
|
|
|
180
180
|
get_access_token(): Promise<string | undefined>;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
export interface Repositories {
|
|
184
|
-
cipher: Repository<Cipher> | null;
|
|
185
|
-
folder: Repository<Folder> | null;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
183
|
/**
|
|
189
184
|
* Active feature flags for the SDK.
|
|
190
185
|
*/
|
|
191
186
|
export interface FeatureFlags extends Map<string, boolean> {}
|
|
192
187
|
|
|
188
|
+
export interface Repositories {
|
|
189
|
+
cipher: Repository<Cipher> | null;
|
|
190
|
+
folder: Repository<Folder> | null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
193
|
export interface IndexedDbConfiguration {
|
|
194
194
|
db_name: string;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
/**
|
|
198
|
-
* Credentials for
|
|
199
|
-
* This is used when the send requires email verification with an OTP.
|
|
198
|
+
* Credentials for getting a send access token using an email and OTP.
|
|
200
199
|
*/
|
|
201
|
-
export interface
|
|
200
|
+
export interface SendEmailOtpCredentials {
|
|
202
201
|
/**
|
|
203
202
|
* The email address to which the OTP will be sent.
|
|
204
203
|
*/
|
|
205
204
|
email: string;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Credentials for sending password secured access requests.
|
|
210
|
-
* Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
|
|
211
|
-
* struct.
|
|
212
|
-
*/
|
|
213
|
-
export interface SendPasswordCredentials {
|
|
214
205
|
/**
|
|
215
|
-
*
|
|
206
|
+
* The one-time password (OTP) that the user has received via email.
|
|
216
207
|
*/
|
|
217
|
-
|
|
208
|
+
otp: string;
|
|
218
209
|
}
|
|
219
210
|
|
|
220
211
|
/**
|
|
221
|
-
* Credentials for
|
|
212
|
+
* Credentials for sending an OTP to the user\'s email address.
|
|
213
|
+
* This is used when the send requires email verification with an OTP.
|
|
222
214
|
*/
|
|
223
|
-
export interface
|
|
215
|
+
export interface SendEmailCredentials {
|
|
224
216
|
/**
|
|
225
217
|
* The email address to which the OTP will be sent.
|
|
226
218
|
*/
|
|
227
219
|
email: string;
|
|
228
|
-
/**
|
|
229
|
-
* The one-time password (OTP) that the user has received via email.
|
|
230
|
-
*/
|
|
231
|
-
otp: string;
|
|
232
220
|
}
|
|
233
221
|
|
|
234
222
|
/**
|
|
@@ -245,6 +233,18 @@ export interface SendAccessTokenRequest {
|
|
|
245
233
|
sendAccessCredentials?: SendAccessCredentials;
|
|
246
234
|
}
|
|
247
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Credentials for sending password secured access requests.
|
|
238
|
+
* Clone auto implements the standard lib\'s Clone trait, allowing us to create copies of this
|
|
239
|
+
* struct.
|
|
240
|
+
*/
|
|
241
|
+
export interface SendPasswordCredentials {
|
|
242
|
+
/**
|
|
243
|
+
* A Base64-encoded hash of the password protecting the send.
|
|
244
|
+
*/
|
|
245
|
+
passwordHashB64: string;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
248
|
/**
|
|
249
249
|
* The credentials used for send access requests.
|
|
250
250
|
*/
|
|
@@ -296,6 +296,16 @@ export type SendAccessTokenInvalidGrantError =
|
|
|
296
296
|
| "otp_generation_failed"
|
|
297
297
|
| "unknown";
|
|
298
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Invalid request errors - typically due to missing parameters.
|
|
301
|
+
*/
|
|
302
|
+
export type SendAccessTokenInvalidRequestError =
|
|
303
|
+
| "send_id_required"
|
|
304
|
+
| "password_hash_b64_required"
|
|
305
|
+
| "email_required"
|
|
306
|
+
| "email_and_otp_required_otp_sent"
|
|
307
|
+
| "unknown";
|
|
308
|
+
|
|
299
309
|
/**
|
|
300
310
|
* Represents the possible, expected errors that can occur when requesting a send access token.
|
|
301
311
|
*/
|
|
@@ -317,48 +327,38 @@ export type SendAccessTokenApiErrorResponse =
|
|
|
317
327
|
| { error: "invalid_target"; error_description?: string };
|
|
318
328
|
|
|
319
329
|
/**
|
|
320
|
-
*
|
|
330
|
+
* Type of collection
|
|
321
331
|
*/
|
|
322
|
-
export type
|
|
323
|
-
| "send_id_required"
|
|
324
|
-
| "password_hash_b64_required"
|
|
325
|
-
| "email_required"
|
|
326
|
-
| "email_and_otp_required_otp_sent"
|
|
327
|
-
| "unknown";
|
|
332
|
+
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
328
333
|
|
|
329
|
-
export interface
|
|
334
|
+
export interface CollectionView {
|
|
330
335
|
id: CollectionId | undefined;
|
|
331
336
|
organizationId: OrganizationId;
|
|
332
|
-
name:
|
|
337
|
+
name: string;
|
|
333
338
|
externalId: string | undefined;
|
|
334
339
|
hidePasswords: boolean;
|
|
335
340
|
readOnly: boolean;
|
|
336
341
|
manage: boolean;
|
|
337
|
-
defaultUserCollectionEmail: string | undefined;
|
|
338
342
|
type: CollectionType;
|
|
339
343
|
}
|
|
340
344
|
|
|
341
|
-
|
|
342
|
-
* Type of collection
|
|
343
|
-
*/
|
|
344
|
-
export type CollectionType = "SharedCollection" | "DefaultUserCollection";
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* NewType wrapper for `CollectionId`
|
|
348
|
-
*/
|
|
349
|
-
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
350
|
-
|
|
351
|
-
export interface CollectionView {
|
|
345
|
+
export interface Collection {
|
|
352
346
|
id: CollectionId | undefined;
|
|
353
347
|
organizationId: OrganizationId;
|
|
354
|
-
name:
|
|
348
|
+
name: EncString;
|
|
355
349
|
externalId: string | undefined;
|
|
356
350
|
hidePasswords: boolean;
|
|
357
351
|
readOnly: boolean;
|
|
358
352
|
manage: boolean;
|
|
353
|
+
defaultUserCollectionEmail: string | undefined;
|
|
359
354
|
type: CollectionType;
|
|
360
355
|
}
|
|
361
356
|
|
|
357
|
+
/**
|
|
358
|
+
* NewType wrapper for `CollectionId`
|
|
359
|
+
*/
|
|
360
|
+
export type CollectionId = Tagged<Uuid, "CollectionId">;
|
|
361
|
+
|
|
362
362
|
export interface CollectionDecryptError extends Error {
|
|
363
363
|
name: "CollectionDecryptError";
|
|
364
364
|
variant: "Crypto";
|
|
@@ -368,15 +368,18 @@ export function isCollectionDecryptError(error: any): error is CollectionDecrypt
|
|
|
368
368
|
|
|
369
369
|
export type SignedSecurityState = string;
|
|
370
370
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
371
|
+
export interface MasterPasswordError extends Error {
|
|
372
|
+
name: "MasterPasswordError";
|
|
373
|
+
variant:
|
|
374
|
+
| "EncryptionKeyMalformed"
|
|
375
|
+
| "KdfMalformed"
|
|
376
|
+
| "InvalidKdfConfiguration"
|
|
377
|
+
| "MissingField"
|
|
378
|
+
| "Crypto";
|
|
378
379
|
}
|
|
379
380
|
|
|
381
|
+
export function isMasterPasswordError(error: any): error is MasterPasswordError;
|
|
382
|
+
|
|
380
383
|
/**
|
|
381
384
|
* Represents the data required to unlock with the master password.
|
|
382
385
|
*/
|
|
@@ -395,17 +398,29 @@ export interface MasterPasswordUnlockData {
|
|
|
395
398
|
salt: string;
|
|
396
399
|
}
|
|
397
400
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
| "Crypto";
|
|
401
|
+
/**
|
|
402
|
+
* Represents the data required to authenticate with the master password.
|
|
403
|
+
*/
|
|
404
|
+
export interface MasterPasswordAuthenticationData {
|
|
405
|
+
kdf: Kdf;
|
|
406
|
+
salt: string;
|
|
407
|
+
masterPasswordAuthenticationHash: B64;
|
|
406
408
|
}
|
|
407
409
|
|
|
408
|
-
|
|
410
|
+
/**
|
|
411
|
+
* Any keys / cryptographic protection \"downstream\" from the account symmetric key (user key).
|
|
412
|
+
* Private keys are protected by the user key.
|
|
413
|
+
*/
|
|
414
|
+
export type WrappedAccountCryptographicState =
|
|
415
|
+
| { V1: { private_key: EncString } }
|
|
416
|
+
| {
|
|
417
|
+
V2: {
|
|
418
|
+
private_key: EncString;
|
|
419
|
+
signed_public_key: SignedPublicKey | undefined;
|
|
420
|
+
signing_key: EncString;
|
|
421
|
+
security_state: SignedSecurityState;
|
|
422
|
+
};
|
|
423
|
+
};
|
|
409
424
|
|
|
410
425
|
export interface AccountCryptographyInitializationError extends Error {
|
|
411
426
|
name: "AccountCryptographyInitializationError";
|
|
@@ -422,20 +437,12 @@ export function isAccountCryptographyInitializationError(
|
|
|
422
437
|
error: any,
|
|
423
438
|
): error is AccountCryptographyInitializationError;
|
|
424
439
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
| {
|
|
432
|
-
V2: {
|
|
433
|
-
private_key: EncString;
|
|
434
|
-
signed_public_key: SignedPublicKey | undefined;
|
|
435
|
-
signing_key: EncString;
|
|
436
|
-
security_state: SignedSecurityState;
|
|
437
|
-
};
|
|
438
|
-
};
|
|
440
|
+
export interface CryptoClientError extends Error {
|
|
441
|
+
name: "CryptoClientError";
|
|
442
|
+
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
439
446
|
|
|
440
447
|
/**
|
|
441
448
|
* Response for `verify_asymmetric_keys`.
|
|
@@ -465,45 +472,46 @@ export interface EnrollPinResponse {
|
|
|
465
472
|
userKeyEncryptedPin: EncString;
|
|
466
473
|
}
|
|
467
474
|
|
|
468
|
-
export interface DeriveKeyConnectorError extends Error {
|
|
469
|
-
name: "DeriveKeyConnectorError";
|
|
470
|
-
variant: "WrongPassword" | "Crypto";
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
474
|
-
|
|
475
|
-
export interface EnrollAdminPasswordResetError extends Error {
|
|
476
|
-
name: "EnrollAdminPasswordResetError";
|
|
477
|
-
variant: "Crypto";
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
481
|
-
|
|
482
475
|
/**
|
|
483
|
-
*
|
|
476
|
+
* Request for `verify_asymmetric_keys`.
|
|
484
477
|
*/
|
|
485
|
-
export interface
|
|
478
|
+
export interface VerifyAsymmetricKeysRequest {
|
|
486
479
|
/**
|
|
487
|
-
* The user\'s
|
|
480
|
+
* The user\'s user key
|
|
488
481
|
*/
|
|
489
|
-
|
|
482
|
+
userKey: B64;
|
|
490
483
|
/**
|
|
491
|
-
* The user\'s
|
|
484
|
+
* The user\'s public key
|
|
492
485
|
*/
|
|
493
|
-
|
|
486
|
+
userPublicKey: B64;
|
|
494
487
|
/**
|
|
495
|
-
*
|
|
488
|
+
* User\'s private key, encrypted with the user key
|
|
496
489
|
*/
|
|
497
|
-
|
|
490
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Represents the request to initialize the user\'s organizational cryptographic state.
|
|
495
|
+
*/
|
|
496
|
+
export interface InitOrgCryptoRequest {
|
|
498
497
|
/**
|
|
499
|
-
* The
|
|
500
|
-
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
498
|
+
* The encryption keys for all the organizations the user is a part of
|
|
501
499
|
*/
|
|
502
|
-
|
|
500
|
+
organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Response from the `make_update_password` function
|
|
505
|
+
*/
|
|
506
|
+
export interface UpdatePasswordResponse {
|
|
503
507
|
/**
|
|
504
|
-
*
|
|
508
|
+
* Hash of the new password
|
|
505
509
|
*/
|
|
506
|
-
|
|
510
|
+
passwordHash: B64;
|
|
511
|
+
/**
|
|
512
|
+
* User key, encrypted with the new password
|
|
513
|
+
*/
|
|
514
|
+
newKey: EncString;
|
|
507
515
|
}
|
|
508
516
|
|
|
509
517
|
/**
|
|
@@ -525,41 +533,90 @@ export type InitUserCryptoMethod =
|
|
|
525
533
|
}
|
|
526
534
|
| { keyConnector: { master_key: B64; user_key: EncString } };
|
|
527
535
|
|
|
528
|
-
export interface CryptoClientError extends Error {
|
|
529
|
-
name: "CryptoClientError";
|
|
530
|
-
variant: "NotAuthenticated" | "Crypto" | "InvalidKdfSettings" | "PasswordProtectedKeyEnvelope";
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
export function isCryptoClientError(error: any): error is CryptoClientError;
|
|
534
|
-
|
|
535
536
|
/**
|
|
536
|
-
*
|
|
537
|
+
* Request for migrating an account from password to key connector.
|
|
537
538
|
*/
|
|
538
|
-
export interface
|
|
539
|
+
export interface DeriveKeyConnectorRequest {
|
|
539
540
|
/**
|
|
540
|
-
*
|
|
541
|
+
* Encrypted user key, used to validate the master key
|
|
541
542
|
*/
|
|
542
|
-
|
|
543
|
+
userKeyEncrypted: EncString;
|
|
543
544
|
/**
|
|
544
|
-
*
|
|
545
|
+
* The user\'s master password
|
|
545
546
|
*/
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
password: string;
|
|
548
|
+
/**
|
|
549
|
+
* The KDF parameters used to derive the master key
|
|
550
|
+
*/
|
|
551
|
+
kdf: Kdf;
|
|
552
|
+
/**
|
|
553
|
+
* The user\'s email address
|
|
554
|
+
*/
|
|
555
|
+
email: string;
|
|
556
|
+
}
|
|
557
|
+
|
|
549
558
|
/**
|
|
550
|
-
*
|
|
559
|
+
* State used for initializing the user cryptographic state.
|
|
551
560
|
*/
|
|
552
|
-
export interface
|
|
561
|
+
export interface InitUserCryptoRequest {
|
|
553
562
|
/**
|
|
554
|
-
*
|
|
563
|
+
* The user\'s ID.
|
|
555
564
|
*/
|
|
556
|
-
|
|
565
|
+
userId: UserId | undefined;
|
|
557
566
|
/**
|
|
558
|
-
*
|
|
567
|
+
* The user\'s KDF parameters, as received from the prelogin request
|
|
559
568
|
*/
|
|
560
|
-
|
|
569
|
+
kdfParams: Kdf;
|
|
570
|
+
/**
|
|
571
|
+
* The user\'s email address
|
|
572
|
+
*/
|
|
573
|
+
email: string;
|
|
574
|
+
/**
|
|
575
|
+
* The user\'s account cryptographic state, containing their signature and
|
|
576
|
+
* public-key-encryption keys, along with the signed security state, protected by the user key
|
|
577
|
+
*/
|
|
578
|
+
accountCryptographicState: WrappedAccountCryptographicState;
|
|
579
|
+
/**
|
|
580
|
+
* The method to decrypt the user\'s account symmetric key (user key)
|
|
581
|
+
*/
|
|
582
|
+
method: InitUserCryptoMethod;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Response from the `make_key_pair` function
|
|
587
|
+
*/
|
|
588
|
+
export interface MakeKeyPairResponse {
|
|
589
|
+
/**
|
|
590
|
+
* The user\'s public key
|
|
591
|
+
*/
|
|
592
|
+
userPublicKey: B64;
|
|
593
|
+
/**
|
|
594
|
+
* User\'s private key, encrypted with the user key
|
|
595
|
+
*/
|
|
596
|
+
userKeyEncryptedPrivateKey: EncString;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Auth requests supports multiple initialization methods.
|
|
601
|
+
*/
|
|
602
|
+
export type AuthRequestMethod =
|
|
603
|
+
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
604
|
+
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
605
|
+
|
|
606
|
+
export interface DeriveKeyConnectorError extends Error {
|
|
607
|
+
name: "DeriveKeyConnectorError";
|
|
608
|
+
variant: "WrongPassword" | "Crypto";
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export function isDeriveKeyConnectorError(error: any): error is DeriveKeyConnectorError;
|
|
612
|
+
|
|
613
|
+
export interface EnrollAdminPasswordResetError extends Error {
|
|
614
|
+
name: "EnrollAdminPasswordResetError";
|
|
615
|
+
variant: "Crypto";
|
|
561
616
|
}
|
|
562
617
|
|
|
618
|
+
export function isEnrollAdminPasswordResetError(error: any): error is EnrollAdminPasswordResetError;
|
|
619
|
+
|
|
563
620
|
/**
|
|
564
621
|
* Response from the `update_kdf` function
|
|
565
622
|
*/
|
|
@@ -616,13 +673,6 @@ export interface UserCryptoV2KeysResponse {
|
|
|
616
673
|
securityVersion: number;
|
|
617
674
|
}
|
|
618
675
|
|
|
619
|
-
/**
|
|
620
|
-
* Auth requests supports multiple initialization methods.
|
|
621
|
-
*/
|
|
622
|
-
export type AuthRequestMethod =
|
|
623
|
-
| { userKey: { protected_user_key: UnsignedSharedKey } }
|
|
624
|
-
| { masterKey: { protected_master_key: UnsignedSharedKey; auth_request_key: EncString } };
|
|
625
|
-
|
|
626
676
|
/**
|
|
627
677
|
* Request for deriving a pin protected user key
|
|
628
678
|
*/
|
|
@@ -637,56 +687,6 @@ export interface DerivePinKeyResponse {
|
|
|
637
687
|
encryptedPin: EncString;
|
|
638
688
|
}
|
|
639
689
|
|
|
640
|
-
/**
|
|
641
|
-
* Represents the request to initialize the user\'s organizational cryptographic state.
|
|
642
|
-
*/
|
|
643
|
-
export interface InitOrgCryptoRequest {
|
|
644
|
-
/**
|
|
645
|
-
* The encryption keys for all the organizations the user is a part of
|
|
646
|
-
*/
|
|
647
|
-
organizationKeys: Map<OrganizationId, UnsignedSharedKey>;
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* Request for migrating an account from password to key connector.
|
|
652
|
-
*/
|
|
653
|
-
export interface DeriveKeyConnectorRequest {
|
|
654
|
-
/**
|
|
655
|
-
* Encrypted user key, used to validate the master key
|
|
656
|
-
*/
|
|
657
|
-
userKeyEncrypted: EncString;
|
|
658
|
-
/**
|
|
659
|
-
* The user\'s master password
|
|
660
|
-
*/
|
|
661
|
-
password: string;
|
|
662
|
-
/**
|
|
663
|
-
* The KDF parameters used to derive the master key
|
|
664
|
-
*/
|
|
665
|
-
kdf: Kdf;
|
|
666
|
-
/**
|
|
667
|
-
* The user\'s email address
|
|
668
|
-
*/
|
|
669
|
-
email: string;
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Request for `verify_asymmetric_keys`.
|
|
674
|
-
*/
|
|
675
|
-
export interface VerifyAsymmetricKeysRequest {
|
|
676
|
-
/**
|
|
677
|
-
* The user\'s user key
|
|
678
|
-
*/
|
|
679
|
-
userKey: B64;
|
|
680
|
-
/**
|
|
681
|
-
* The user\'s public key
|
|
682
|
-
*/
|
|
683
|
-
userPublicKey: B64;
|
|
684
|
-
/**
|
|
685
|
-
* User\'s private key, encrypted with the user key
|
|
686
|
-
*/
|
|
687
|
-
userKeyEncryptedPrivateKey: EncString;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
690
|
/**
|
|
691
691
|
* NewType wrapper for `OrganizationId`
|
|
692
692
|
*/
|
|
@@ -792,6 +792,33 @@ export type EncString = Tagged<string, "EncString">;
|
|
|
792
792
|
|
|
793
793
|
export type SignedPublicKey = Tagged<string, "SignedPublicKey">;
|
|
794
794
|
|
|
795
|
+
/**
|
|
796
|
+
* A set of keys where a given `DownstreamKey` is protected by an encrypted public/private
|
|
797
|
+
* key-pair. The `DownstreamKey` is used to encrypt/decrypt data, while the public/private key-pair
|
|
798
|
+
* is used to rotate the `DownstreamKey`.
|
|
799
|
+
*
|
|
800
|
+
* The `PrivateKey` is protected by an `UpstreamKey`, such as a `DeviceKey`, or `PrfKey`,
|
|
801
|
+
* and the `PublicKey` is protected by the `DownstreamKey`. This setup allows:
|
|
802
|
+
*
|
|
803
|
+
* - Access to `DownstreamKey` by knowing the `UpstreamKey`
|
|
804
|
+
* - Rotation to a `NewDownstreamKey` by knowing the current `DownstreamKey`, without needing
|
|
805
|
+
* access to the `UpstreamKey`
|
|
806
|
+
*/
|
|
807
|
+
export interface RotateableKeySet {
|
|
808
|
+
/**
|
|
809
|
+
* `DownstreamKey` protected by encapsulation key
|
|
810
|
+
*/
|
|
811
|
+
encapsulatedDownstreamKey: UnsignedSharedKey;
|
|
812
|
+
/**
|
|
813
|
+
* Encapsulation key protected by `DownstreamKey`
|
|
814
|
+
*/
|
|
815
|
+
encryptedEncapsulationKey: EncString;
|
|
816
|
+
/**
|
|
817
|
+
* Decapsulation key protected by `UpstreamKey`
|
|
818
|
+
*/
|
|
819
|
+
encryptedDecapsulationKey: EncString;
|
|
820
|
+
}
|
|
821
|
+
|
|
795
822
|
/**
|
|
796
823
|
* Key Derivation Function for Bitwarden Account
|
|
797
824
|
*
|
|
@@ -963,20 +990,13 @@ export interface PasswordGeneratorRequest {
|
|
|
963
990
|
minSpecial: number | undefined;
|
|
964
991
|
}
|
|
965
992
|
|
|
966
|
-
export type AppendType = "random" | { websiteName: { website: string } };
|
|
967
|
-
|
|
968
993
|
export type UsernameGeneratorRequest =
|
|
969
994
|
| { word: { capitalize: boolean; include_number: boolean } }
|
|
970
995
|
| { subaddress: { type: AppendType; email: string } }
|
|
971
996
|
| { catchall: { type: AppendType; domain: string } }
|
|
972
997
|
| { forwarded: { service: ForwarderServiceType; website: string | undefined } };
|
|
973
998
|
|
|
974
|
-
export
|
|
975
|
-
name: "UsernameError";
|
|
976
|
-
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
export function isUsernameError(error: any): error is UsernameError;
|
|
999
|
+
export type AppendType = "random" | { websiteName: { website: string } };
|
|
980
1000
|
|
|
981
1001
|
/**
|
|
982
1002
|
* Configures the email forwarding service to use.
|
|
@@ -991,6 +1011,13 @@ export type ForwarderServiceType =
|
|
|
991
1011
|
| { forwardEmail: { api_token: string; domain: string } }
|
|
992
1012
|
| { simpleLogin: { api_key: string; base_url: string } };
|
|
993
1013
|
|
|
1014
|
+
export interface UsernameError extends Error {
|
|
1015
|
+
name: "UsernameError";
|
|
1016
|
+
variant: "InvalidApiKey" | "Unknown" | "ResponseContent" | "Reqwest";
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
export function isUsernameError(error: any): error is UsernameError;
|
|
1020
|
+
|
|
994
1021
|
export interface RequestError extends Error {
|
|
995
1022
|
name: "RequestError";
|
|
996
1023
|
variant: "Subscribe" | "Receive" | "Timeout" | "Send" | "Rpc";
|
|
@@ -1052,6 +1079,13 @@ export type Endpoint =
|
|
|
1052
1079
|
| "DesktopRenderer"
|
|
1053
1080
|
| "DesktopMain";
|
|
1054
1081
|
|
|
1082
|
+
export interface SshKeyExportError extends Error {
|
|
1083
|
+
name: "SshKeyExportError";
|
|
1084
|
+
variant: "KeyConversion";
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
export function isSshKeyExportError(error: any): error is SshKeyExportError;
|
|
1088
|
+
|
|
1055
1089
|
export interface KeyGenerationError extends Error {
|
|
1056
1090
|
name: "KeyGenerationError";
|
|
1057
1091
|
variant: "KeyGeneration" | "KeyConversion";
|
|
@@ -1066,13 +1100,6 @@ export interface SshKeyImportError extends Error {
|
|
|
1066
1100
|
|
|
1067
1101
|
export function isSshKeyImportError(error: any): error is SshKeyImportError;
|
|
1068
1102
|
|
|
1069
|
-
export interface SshKeyExportError extends Error {
|
|
1070
|
-
name: "SshKeyExportError";
|
|
1071
|
-
variant: "KeyConversion";
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
export function isSshKeyExportError(error: any): error is SshKeyExportError;
|
|
1075
|
-
|
|
1076
1103
|
export type KeyAlgorithm = "Ed25519" | "Rsa3072" | "Rsa4096";
|
|
1077
1104
|
|
|
1078
1105
|
export interface DatabaseError extends Error {
|
|
@@ -1103,12 +1130,22 @@ export interface CipherRiskError extends Error {
|
|
|
1103
1130
|
export function isCipherRiskError(error: any): error is CipherRiskError;
|
|
1104
1131
|
|
|
1105
1132
|
/**
|
|
1106
|
-
*
|
|
1133
|
+
* Login cipher data needed for risk evaluation.
|
|
1107
1134
|
*/
|
|
1108
|
-
export
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1135
|
+
export interface CipherLoginDetails {
|
|
1136
|
+
/**
|
|
1137
|
+
* Cipher ID to identify which cipher in results.
|
|
1138
|
+
*/
|
|
1139
|
+
id: CipherId;
|
|
1140
|
+
/**
|
|
1141
|
+
* The decrypted password to evaluate.
|
|
1142
|
+
*/
|
|
1143
|
+
password: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Username or email (login ciphers only have one field).
|
|
1146
|
+
*/
|
|
1147
|
+
username: string | undefined;
|
|
1148
|
+
}
|
|
1112
1149
|
|
|
1113
1150
|
/**
|
|
1114
1151
|
* Password reuse map wrapper for WASM compatibility.
|
|
@@ -1137,22 +1174,12 @@ export interface CipherRiskOptions {
|
|
|
1137
1174
|
}
|
|
1138
1175
|
|
|
1139
1176
|
/**
|
|
1140
|
-
*
|
|
1177
|
+
* Result of checking password exposure via HIBP API.
|
|
1141
1178
|
*/
|
|
1142
|
-
export
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
id: CipherId;
|
|
1147
|
-
/**
|
|
1148
|
-
* The decrypted password to evaluate.
|
|
1149
|
-
*/
|
|
1150
|
-
password: string;
|
|
1151
|
-
/**
|
|
1152
|
-
* Username or email (login ciphers only have one field).
|
|
1153
|
-
*/
|
|
1154
|
-
username: string | undefined;
|
|
1155
|
-
}
|
|
1179
|
+
export type ExposedPasswordResult =
|
|
1180
|
+
| { type: "NotChecked" }
|
|
1181
|
+
| { type: "Found"; value: number }
|
|
1182
|
+
| { type: "Error"; value: string };
|
|
1156
1183
|
|
|
1157
1184
|
/**
|
|
1158
1185
|
* Risk evaluation result for a single cipher.
|
|
@@ -1195,13 +1222,6 @@ export interface AncestorMap {
|
|
|
1195
1222
|
ancestors: Map<CollectionId, string>;
|
|
1196
1223
|
}
|
|
1197
1224
|
|
|
1198
|
-
export interface TotpError extends Error {
|
|
1199
|
-
name: "TotpError";
|
|
1200
|
-
variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
export function isTotpError(error: any): error is TotpError;
|
|
1204
|
-
|
|
1205
1225
|
export interface TotpResponse {
|
|
1206
1226
|
/**
|
|
1207
1227
|
* Generated TOTP code
|
|
@@ -1213,12 +1233,12 @@ export interface TotpResponse {
|
|
|
1213
1233
|
period: number;
|
|
1214
1234
|
}
|
|
1215
1235
|
|
|
1216
|
-
export interface
|
|
1217
|
-
name: "
|
|
1218
|
-
variant: "Crypto";
|
|
1236
|
+
export interface TotpError extends Error {
|
|
1237
|
+
name: "TotpError";
|
|
1238
|
+
variant: "InvalidOtpauth" | "MissingSecret" | "Crypto";
|
|
1219
1239
|
}
|
|
1220
1240
|
|
|
1221
|
-
export function
|
|
1241
|
+
export function isTotpError(error: any): error is TotpError;
|
|
1222
1242
|
|
|
1223
1243
|
export interface EncryptError extends Error {
|
|
1224
1244
|
name: "EncryptError";
|
|
@@ -1227,18 +1247,13 @@ export interface EncryptError extends Error {
|
|
|
1227
1247
|
|
|
1228
1248
|
export function isEncryptError(error: any): error is EncryptError;
|
|
1229
1249
|
|
|
1230
|
-
export interface
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
size: string | undefined;
|
|
1234
|
-
/**
|
|
1235
|
-
* Readable size, ex: \"4.2 KB\" or \"1.43 GB\
|
|
1236
|
-
*/
|
|
1237
|
-
sizeName: string | undefined;
|
|
1238
|
-
fileName: EncString | undefined;
|
|
1239
|
-
key: EncString | undefined;
|
|
1250
|
+
export interface DecryptError extends Error {
|
|
1251
|
+
name: "DecryptError";
|
|
1252
|
+
variant: "Crypto";
|
|
1240
1253
|
}
|
|
1241
1254
|
|
|
1255
|
+
export function isDecryptError(error: any): error is DecryptError;
|
|
1256
|
+
|
|
1242
1257
|
export interface AttachmentView {
|
|
1243
1258
|
id: string | undefined;
|
|
1244
1259
|
url: string | undefined;
|
|
@@ -1261,12 +1276,24 @@ export interface AttachmentView {
|
|
|
1261
1276
|
decryptedKey: string | undefined;
|
|
1262
1277
|
}
|
|
1263
1278
|
|
|
1264
|
-
export interface
|
|
1279
|
+
export interface Attachment {
|
|
1280
|
+
id: string | undefined;
|
|
1281
|
+
url: string | undefined;
|
|
1282
|
+
size: string | undefined;
|
|
1283
|
+
/**
|
|
1284
|
+
* Readable size, ex: \"4.2 KB\" or \"1.43 GB\
|
|
1285
|
+
*/
|
|
1286
|
+
sizeName: string | undefined;
|
|
1287
|
+
fileName: EncString | undefined;
|
|
1288
|
+
key: EncString | undefined;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
export interface LocalDataView {
|
|
1265
1292
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1266
1293
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1267
1294
|
}
|
|
1268
1295
|
|
|
1269
|
-
export interface
|
|
1296
|
+
export interface LocalData {
|
|
1270
1297
|
lastUsedDate: DateTime<Utc> | undefined;
|
|
1271
1298
|
lastLaunched: DateTime<Utc> | undefined;
|
|
1272
1299
|
}
|
|
@@ -1281,7 +1308,7 @@ export interface SecureNoteView {
|
|
|
1281
1308
|
|
|
1282
1309
|
export interface GetCipherError extends Error {
|
|
1283
1310
|
name: "GetCipherError";
|
|
1284
|
-
variant: "ItemNotFound" | "Crypto" | "
|
|
1311
|
+
variant: "ItemNotFound" | "Crypto" | "Repository";
|
|
1285
1312
|
}
|
|
1286
1313
|
|
|
1287
1314
|
export function isGetCipherError(error: any): error is GetCipherError;
|
|
@@ -1320,6 +1347,13 @@ export interface CipherEditRequest {
|
|
|
1320
1347
|
key: EncString | undefined;
|
|
1321
1348
|
}
|
|
1322
1349
|
|
|
1350
|
+
export interface CreateCipherError extends Error {
|
|
1351
|
+
name: "CreateCipherError";
|
|
1352
|
+
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1356
|
+
|
|
1323
1357
|
/**
|
|
1324
1358
|
* Request to add a cipher.
|
|
1325
1359
|
*/
|
|
@@ -1334,13 +1368,6 @@ export interface CipherCreateRequest {
|
|
|
1334
1368
|
fields: FieldView[];
|
|
1335
1369
|
}
|
|
1336
1370
|
|
|
1337
|
-
export interface CreateCipherError extends Error {
|
|
1338
|
-
name: "CreateCipherError";
|
|
1339
|
-
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "NotAuthenticated" | "Repository";
|
|
1340
|
-
}
|
|
1341
|
-
|
|
1342
|
-
export function isCreateCipherError(error: any): error is CreateCipherError;
|
|
1343
|
-
|
|
1344
1371
|
/**
|
|
1345
1372
|
* Represents the inner data of a cipher view.
|
|
1346
1373
|
*/
|
|
@@ -1351,13 +1378,6 @@ export type CipherViewType =
|
|
|
1351
1378
|
| { secureNote: SecureNoteView }
|
|
1352
1379
|
| { sshKey: SshKeyView };
|
|
1353
1380
|
|
|
1354
|
-
export interface DecryptFileError extends Error {
|
|
1355
|
-
name: "DecryptFileError";
|
|
1356
|
-
variant: "Decrypt" | "Io";
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
export function isDecryptFileError(error: any): error is DecryptFileError;
|
|
1360
|
-
|
|
1361
1381
|
export interface EncryptFileError extends Error {
|
|
1362
1382
|
name: "EncryptFileError";
|
|
1363
1383
|
variant: "Encrypt" | "Io";
|
|
@@ -1365,20 +1385,18 @@ export interface EncryptFileError extends Error {
|
|
|
1365
1385
|
|
|
1366
1386
|
export function isEncryptFileError(error: any): error is EncryptFileError;
|
|
1367
1387
|
|
|
1388
|
+
export interface DecryptFileError extends Error {
|
|
1389
|
+
name: "DecryptFileError";
|
|
1390
|
+
variant: "Decrypt" | "Io";
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
export function isDecryptFileError(error: any): error is DecryptFileError;
|
|
1394
|
+
|
|
1368
1395
|
export interface CipherPermissions {
|
|
1369
1396
|
delete: boolean;
|
|
1370
1397
|
restore: boolean;
|
|
1371
1398
|
}
|
|
1372
1399
|
|
|
1373
|
-
export interface Card {
|
|
1374
|
-
cardholderName: EncString | undefined;
|
|
1375
|
-
expMonth: EncString | undefined;
|
|
1376
|
-
expYear: EncString | undefined;
|
|
1377
|
-
code: EncString | undefined;
|
|
1378
|
-
brand: EncString | undefined;
|
|
1379
|
-
number: EncString | undefined;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
1400
|
/**
|
|
1383
1401
|
* Minimal CardView only including the needed details for list views
|
|
1384
1402
|
*/
|
|
@@ -1389,6 +1407,15 @@ export interface CardListView {
|
|
|
1389
1407
|
brand: string | undefined;
|
|
1390
1408
|
}
|
|
1391
1409
|
|
|
1410
|
+
export interface Card {
|
|
1411
|
+
cardholderName: EncString | undefined;
|
|
1412
|
+
expMonth: EncString | undefined;
|
|
1413
|
+
expYear: EncString | undefined;
|
|
1414
|
+
code: EncString | undefined;
|
|
1415
|
+
brand: EncString | undefined;
|
|
1416
|
+
number: EncString | undefined;
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1392
1419
|
export interface CardView {
|
|
1393
1420
|
cardholderName: string | undefined;
|
|
1394
1421
|
expMonth: string | undefined;
|
|
@@ -1398,35 +1425,34 @@ export interface CardView {
|
|
|
1398
1425
|
number: string | undefined;
|
|
1399
1426
|
}
|
|
1400
1427
|
|
|
1401
|
-
export interface
|
|
1402
|
-
name:
|
|
1403
|
-
value:
|
|
1428
|
+
export interface Field {
|
|
1429
|
+
name: EncString | undefined;
|
|
1430
|
+
value: EncString | undefined;
|
|
1404
1431
|
type: FieldType;
|
|
1405
1432
|
linkedId: LinkedIdType | undefined;
|
|
1406
1433
|
}
|
|
1407
1434
|
|
|
1408
|
-
export interface
|
|
1409
|
-
name:
|
|
1410
|
-
value:
|
|
1435
|
+
export interface FieldView {
|
|
1436
|
+
name: string | undefined;
|
|
1437
|
+
value: string | undefined;
|
|
1411
1438
|
type: FieldType;
|
|
1412
1439
|
linkedId: LinkedIdType | undefined;
|
|
1413
1440
|
}
|
|
1414
1441
|
|
|
1415
|
-
export interface
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
* The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
|
|
1421
|
-
*/
|
|
1442
|
+
export interface Login {
|
|
1443
|
+
username: EncString | undefined;
|
|
1444
|
+
password: EncString | undefined;
|
|
1445
|
+
passwordRevisionDate: DateTime<Utc> | undefined;
|
|
1446
|
+
uris: LoginUri[] | undefined;
|
|
1422
1447
|
totp: EncString | undefined;
|
|
1423
|
-
|
|
1448
|
+
autofillOnPageLoad: boolean | undefined;
|
|
1449
|
+
fido2Credentials: Fido2Credential[] | undefined;
|
|
1424
1450
|
}
|
|
1425
1451
|
|
|
1426
|
-
export interface
|
|
1427
|
-
uri:
|
|
1452
|
+
export interface LoginUri {
|
|
1453
|
+
uri: EncString | undefined;
|
|
1428
1454
|
match: UriMatchType | undefined;
|
|
1429
|
-
uriChecksum:
|
|
1455
|
+
uriChecksum: EncString | undefined;
|
|
1430
1456
|
}
|
|
1431
1457
|
|
|
1432
1458
|
export interface Fido2CredentialFullView {
|
|
@@ -1445,39 +1471,29 @@ export interface Fido2CredentialFullView {
|
|
|
1445
1471
|
creationDate: DateTime<Utc>;
|
|
1446
1472
|
}
|
|
1447
1473
|
|
|
1448
|
-
export interface
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1474
|
+
export interface LoginListView {
|
|
1475
|
+
fido2Credentials: Fido2CredentialListView[] | undefined;
|
|
1476
|
+
hasFido2: boolean;
|
|
1477
|
+
username: string | undefined;
|
|
1478
|
+
/**
|
|
1479
|
+
* The TOTP key is not decrypted. Useable as is with [`crate::generate_totp_cipher_view`].
|
|
1480
|
+
*/
|
|
1453
1481
|
totp: EncString | undefined;
|
|
1454
|
-
|
|
1455
|
-
fido2Credentials: Fido2Credential[] | undefined;
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
export interface Fido2Credential {
|
|
1459
|
-
credentialId: EncString;
|
|
1460
|
-
keyType: EncString;
|
|
1461
|
-
keyAlgorithm: EncString;
|
|
1462
|
-
keyCurve: EncString;
|
|
1463
|
-
keyValue: EncString;
|
|
1464
|
-
rpId: EncString;
|
|
1465
|
-
userHandle: EncString | undefined;
|
|
1466
|
-
userName: EncString | undefined;
|
|
1467
|
-
counter: EncString;
|
|
1468
|
-
rpName: EncString | undefined;
|
|
1469
|
-
userDisplayName: EncString | undefined;
|
|
1470
|
-
discoverable: EncString;
|
|
1471
|
-
creationDate: DateTime<Utc>;
|
|
1482
|
+
uris: LoginUriView[] | undefined;
|
|
1472
1483
|
}
|
|
1473
1484
|
|
|
1474
|
-
export interface
|
|
1485
|
+
export interface Fido2CredentialNewView {
|
|
1475
1486
|
credentialId: string;
|
|
1487
|
+
keyType: string;
|
|
1488
|
+
keyAlgorithm: string;
|
|
1489
|
+
keyCurve: string;
|
|
1476
1490
|
rpId: string;
|
|
1477
1491
|
userHandle: string | undefined;
|
|
1478
1492
|
userName: string | undefined;
|
|
1479
|
-
userDisplayName: string | undefined;
|
|
1480
1493
|
counter: string;
|
|
1494
|
+
rpName: string | undefined;
|
|
1495
|
+
userDisplayName: string | undefined;
|
|
1496
|
+
creationDate: DateTime<Utc>;
|
|
1481
1497
|
}
|
|
1482
1498
|
|
|
1483
1499
|
export interface LoginView {
|
|
@@ -1490,17 +1506,34 @@ export interface LoginView {
|
|
|
1490
1506
|
fido2Credentials: Fido2Credential[] | undefined;
|
|
1491
1507
|
}
|
|
1492
1508
|
|
|
1493
|
-
export interface
|
|
1509
|
+
export interface Fido2CredentialListView {
|
|
1494
1510
|
credentialId: string;
|
|
1495
|
-
keyType: string;
|
|
1496
|
-
keyAlgorithm: string;
|
|
1497
|
-
keyCurve: string;
|
|
1498
1511
|
rpId: string;
|
|
1499
1512
|
userHandle: string | undefined;
|
|
1500
1513
|
userName: string | undefined;
|
|
1501
|
-
counter: string;
|
|
1502
|
-
rpName: string | undefined;
|
|
1503
1514
|
userDisplayName: string | undefined;
|
|
1515
|
+
counter: string;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
export interface LoginUriView {
|
|
1519
|
+
uri: string | undefined;
|
|
1520
|
+
match: UriMatchType | undefined;
|
|
1521
|
+
uriChecksum: string | undefined;
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
export interface Fido2Credential {
|
|
1525
|
+
credentialId: EncString;
|
|
1526
|
+
keyType: EncString;
|
|
1527
|
+
keyAlgorithm: EncString;
|
|
1528
|
+
keyCurve: EncString;
|
|
1529
|
+
keyValue: EncString;
|
|
1530
|
+
rpId: EncString;
|
|
1531
|
+
userHandle: EncString | undefined;
|
|
1532
|
+
userName: EncString | undefined;
|
|
1533
|
+
counter: EncString;
|
|
1534
|
+
rpName: EncString | undefined;
|
|
1535
|
+
userDisplayName: EncString | undefined;
|
|
1536
|
+
discoverable: EncString;
|
|
1504
1537
|
creationDate: DateTime<Utc>;
|
|
1505
1538
|
}
|
|
1506
1539
|
|
|
@@ -1520,61 +1553,27 @@ export interface Fido2CredentialView {
|
|
|
1520
1553
|
creationDate: DateTime<Utc>;
|
|
1521
1554
|
}
|
|
1522
1555
|
|
|
1523
|
-
export interface LoginUri {
|
|
1524
|
-
uri: EncString | undefined;
|
|
1525
|
-
match: UriMatchType | undefined;
|
|
1526
|
-
uriChecksum: EncString | undefined;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
1556
|
/**
|
|
1530
|
-
*
|
|
1557
|
+
* NewType wrapper for `CipherId`
|
|
1531
1558
|
*/
|
|
1532
|
-
export type
|
|
1533
|
-
| "LoginUsername"
|
|
1534
|
-
| "LoginPassword"
|
|
1535
|
-
| "LoginTotp"
|
|
1536
|
-
| "CardNumber"
|
|
1537
|
-
| "CardSecurityCode"
|
|
1538
|
-
| "IdentityUsername"
|
|
1539
|
-
| "IdentityEmail"
|
|
1540
|
-
| "IdentityPhone"
|
|
1541
|
-
| "IdentityAddress"
|
|
1542
|
-
| "SshKey"
|
|
1543
|
-
| "SecureNotes";
|
|
1559
|
+
export type CipherId = Tagged<Uuid, "CipherId">;
|
|
1544
1560
|
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1561
|
+
/**
|
|
1562
|
+
* Represents the result of decrypting a list of ciphers.
|
|
1563
|
+
*
|
|
1564
|
+
* This struct contains two vectors: `successes` and `failures`.
|
|
1565
|
+
* `successes` contains the decrypted `CipherListView` objects,
|
|
1566
|
+
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1567
|
+
*/
|
|
1568
|
+
export interface DecryptCipherListResult {
|
|
1550
1569
|
/**
|
|
1551
|
-
*
|
|
1552
|
-
* Cipher.
|
|
1570
|
+
* The decrypted `CipherListView` objects.
|
|
1553
1571
|
*/
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
identity: Identity | undefined;
|
|
1560
|
-
card: Card | undefined;
|
|
1561
|
-
secureNote: SecureNote | undefined;
|
|
1562
|
-
sshKey: SshKey | undefined;
|
|
1563
|
-
favorite: boolean;
|
|
1564
|
-
reprompt: CipherRepromptType;
|
|
1565
|
-
organizationUseTotp: boolean;
|
|
1566
|
-
edit: boolean;
|
|
1567
|
-
permissions: CipherPermissions | undefined;
|
|
1568
|
-
viewPassword: boolean;
|
|
1569
|
-
localData: LocalData | undefined;
|
|
1570
|
-
attachments: Attachment[] | undefined;
|
|
1571
|
-
fields: Field[] | undefined;
|
|
1572
|
-
passwordHistory: PasswordHistory[] | undefined;
|
|
1573
|
-
creationDate: DateTime<Utc>;
|
|
1574
|
-
deletedDate: DateTime<Utc> | undefined;
|
|
1575
|
-
revisionDate: DateTime<Utc>;
|
|
1576
|
-
archivedDate: DateTime<Utc> | undefined;
|
|
1577
|
-
data: string | undefined;
|
|
1572
|
+
successes: CipherListView[];
|
|
1573
|
+
/**
|
|
1574
|
+
* The original `Cipher` objects that failed to decrypt.
|
|
1575
|
+
*/
|
|
1576
|
+
failures: Cipher[];
|
|
1578
1577
|
}
|
|
1579
1578
|
|
|
1580
1579
|
export type CipherListViewType =
|
|
@@ -1584,33 +1583,6 @@ export type CipherListViewType =
|
|
|
1584
1583
|
| "identity"
|
|
1585
1584
|
| "sshKey";
|
|
1586
1585
|
|
|
1587
|
-
export interface CipherError extends Error {
|
|
1588
|
-
name: "CipherError";
|
|
1589
|
-
variant:
|
|
1590
|
-
| "MissingField"
|
|
1591
|
-
| "Crypto"
|
|
1592
|
-
| "Decrypt"
|
|
1593
|
-
| "Encrypt"
|
|
1594
|
-
| "AttachmentsWithoutKeys"
|
|
1595
|
-
| "OrganizationAlreadySet"
|
|
1596
|
-
| "PutShare"
|
|
1597
|
-
| "PutShareMany"
|
|
1598
|
-
| "Repository"
|
|
1599
|
-
| "Chrono"
|
|
1600
|
-
| "SerdeJson";
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
export function isCipherError(error: any): error is CipherError;
|
|
1604
|
-
|
|
1605
|
-
export interface EncryptionContext {
|
|
1606
|
-
/**
|
|
1607
|
-
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1608
|
-
* Organization-owned ciphers
|
|
1609
|
-
*/
|
|
1610
|
-
encryptedFor: UserId;
|
|
1611
|
-
cipher: Cipher;
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
1586
|
export interface CipherListView {
|
|
1615
1587
|
id: CipherId | undefined;
|
|
1616
1588
|
organizationId: OrganizationId | undefined;
|
|
@@ -1649,27 +1621,20 @@ export interface CipherListView {
|
|
|
1649
1621
|
}
|
|
1650
1622
|
|
|
1651
1623
|
/**
|
|
1652
|
-
*
|
|
1653
|
-
*
|
|
1654
|
-
* This struct contains two vectors: `successes` and `failures`.
|
|
1655
|
-
* `successes` contains the decrypted `CipherListView` objects,
|
|
1656
|
-
* while `failures` contains the original `Cipher` objects that failed to decrypt.
|
|
1657
|
-
*/
|
|
1658
|
-
export interface DecryptCipherListResult {
|
|
1659
|
-
/**
|
|
1660
|
-
* The decrypted `CipherListView` objects.
|
|
1661
|
-
*/
|
|
1662
|
-
successes: CipherListView[];
|
|
1663
|
-
/**
|
|
1664
|
-
* The original `Cipher` objects that failed to decrypt.
|
|
1665
|
-
*/
|
|
1666
|
-
failures: Cipher[];
|
|
1667
|
-
}
|
|
1668
|
-
|
|
1669
|
-
/**
|
|
1670
|
-
* NewType wrapper for `CipherId`
|
|
1624
|
+
* Available fields on a cipher and can be copied from a the list view in the UI.
|
|
1671
1625
|
*/
|
|
1672
|
-
export type
|
|
1626
|
+
export type CopyableCipherFields =
|
|
1627
|
+
| "LoginUsername"
|
|
1628
|
+
| "LoginPassword"
|
|
1629
|
+
| "LoginTotp"
|
|
1630
|
+
| "CardNumber"
|
|
1631
|
+
| "CardSecurityCode"
|
|
1632
|
+
| "IdentityUsername"
|
|
1633
|
+
| "IdentityEmail"
|
|
1634
|
+
| "IdentityPhone"
|
|
1635
|
+
| "IdentityAddress"
|
|
1636
|
+
| "SshKey"
|
|
1637
|
+
| "SecureNotes";
|
|
1673
1638
|
|
|
1674
1639
|
export interface CipherView {
|
|
1675
1640
|
id: CipherId | undefined;
|
|
@@ -1704,34 +1669,96 @@ export interface CipherView {
|
|
|
1704
1669
|
archivedDate: DateTime<Utc> | undefined;
|
|
1705
1670
|
}
|
|
1706
1671
|
|
|
1707
|
-
export interface
|
|
1672
|
+
export interface EncryptionContext {
|
|
1673
|
+
/**
|
|
1674
|
+
* The Id of the user that encrypted the cipher. It should always represent a UserId, even for
|
|
1675
|
+
* Organization-owned ciphers
|
|
1676
|
+
*/
|
|
1677
|
+
encryptedFor: UserId;
|
|
1678
|
+
cipher: Cipher;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
export interface CipherError extends Error {
|
|
1682
|
+
name: "CipherError";
|
|
1683
|
+
variant:
|
|
1684
|
+
| "MissingField"
|
|
1685
|
+
| "Crypto"
|
|
1686
|
+
| "Decrypt"
|
|
1687
|
+
| "Encrypt"
|
|
1688
|
+
| "AttachmentsWithoutKeys"
|
|
1689
|
+
| "OrganizationAlreadySet"
|
|
1690
|
+
| "PutShare"
|
|
1691
|
+
| "PutShareMany"
|
|
1692
|
+
| "Repository"
|
|
1693
|
+
| "Chrono"
|
|
1694
|
+
| "SerdeJson";
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
export function isCipherError(error: any): error is CipherError;
|
|
1698
|
+
|
|
1699
|
+
export interface Cipher {
|
|
1700
|
+
id: CipherId | undefined;
|
|
1701
|
+
organizationId: OrganizationId | undefined;
|
|
1702
|
+
folderId: FolderId | undefined;
|
|
1703
|
+
collectionIds: CollectionId[];
|
|
1704
|
+
/**
|
|
1705
|
+
* More recent ciphers uses individual encryption keys to encrypt the other fields of the
|
|
1706
|
+
* Cipher.
|
|
1707
|
+
*/
|
|
1708
|
+
key: EncString | undefined;
|
|
1709
|
+
name: EncString;
|
|
1710
|
+
notes: EncString | undefined;
|
|
1711
|
+
type: CipherType;
|
|
1712
|
+
login: Login | undefined;
|
|
1713
|
+
identity: Identity | undefined;
|
|
1714
|
+
card: Card | undefined;
|
|
1715
|
+
secureNote: SecureNote | undefined;
|
|
1716
|
+
sshKey: SshKey | undefined;
|
|
1717
|
+
favorite: boolean;
|
|
1718
|
+
reprompt: CipherRepromptType;
|
|
1719
|
+
organizationUseTotp: boolean;
|
|
1720
|
+
edit: boolean;
|
|
1721
|
+
permissions: CipherPermissions | undefined;
|
|
1722
|
+
viewPassword: boolean;
|
|
1723
|
+
localData: LocalData | undefined;
|
|
1724
|
+
attachments: Attachment[] | undefined;
|
|
1725
|
+
fields: Field[] | undefined;
|
|
1726
|
+
passwordHistory: PasswordHistory[] | undefined;
|
|
1727
|
+
creationDate: DateTime<Utc>;
|
|
1728
|
+
deletedDate: DateTime<Utc> | undefined;
|
|
1729
|
+
revisionDate: DateTime<Utc>;
|
|
1730
|
+
archivedDate: DateTime<Utc> | undefined;
|
|
1731
|
+
data: string | undefined;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export interface SshKeyView {
|
|
1708
1735
|
/**
|
|
1709
1736
|
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
1710
1737
|
*/
|
|
1711
|
-
privateKey:
|
|
1738
|
+
privateKey: string;
|
|
1712
1739
|
/**
|
|
1713
1740
|
* SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6)
|
|
1714
1741
|
*/
|
|
1715
|
-
publicKey:
|
|
1742
|
+
publicKey: string;
|
|
1716
1743
|
/**
|
|
1717
1744
|
* SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT`
|
|
1718
1745
|
*/
|
|
1719
|
-
fingerprint:
|
|
1746
|
+
fingerprint: string;
|
|
1720
1747
|
}
|
|
1721
1748
|
|
|
1722
|
-
export interface
|
|
1749
|
+
export interface SshKey {
|
|
1723
1750
|
/**
|
|
1724
1751
|
* SSH private key (ed25519/rsa) in unencrypted openssh private key format [OpenSSH private key](https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key)
|
|
1725
1752
|
*/
|
|
1726
|
-
privateKey:
|
|
1753
|
+
privateKey: EncString;
|
|
1727
1754
|
/**
|
|
1728
1755
|
* SSH public key (ed25519/rsa) according to [RFC4253](https://datatracker.ietf.org/doc/html/rfc4253#section-6.6)
|
|
1729
1756
|
*/
|
|
1730
|
-
publicKey:
|
|
1757
|
+
publicKey: EncString;
|
|
1731
1758
|
/**
|
|
1732
1759
|
* SSH fingerprint using SHA256 in the format: `SHA256:BASE64_ENCODED_FINGERPRINT`
|
|
1733
1760
|
*/
|
|
1734
|
-
fingerprint:
|
|
1761
|
+
fingerprint: EncString;
|
|
1735
1762
|
}
|
|
1736
1763
|
|
|
1737
1764
|
export interface Identity {
|
|
@@ -1778,9 +1805,9 @@ export interface IdentityView {
|
|
|
1778
1805
|
|
|
1779
1806
|
export type LinkedIdType = LoginLinkedIdType | CardLinkedIdType | IdentityLinkedIdType;
|
|
1780
1807
|
|
|
1781
|
-
export interface
|
|
1808
|
+
export interface Folder {
|
|
1782
1809
|
id: FolderId | undefined;
|
|
1783
|
-
name:
|
|
1810
|
+
name: EncString;
|
|
1784
1811
|
revisionDate: DateTime<Utc>;
|
|
1785
1812
|
}
|
|
1786
1813
|
|
|
@@ -1789,9 +1816,9 @@ export interface FolderView {
|
|
|
1789
1816
|
*/
|
|
1790
1817
|
export type FolderId = Tagged<Uuid, "FolderId">;
|
|
1791
1818
|
|
|
1792
|
-
export interface
|
|
1819
|
+
export interface FolderView {
|
|
1793
1820
|
id: FolderId | undefined;
|
|
1794
|
-
name:
|
|
1821
|
+
name: string;
|
|
1795
1822
|
revisionDate: DateTime<Utc>;
|
|
1796
1823
|
}
|
|
1797
1824
|
|
|
@@ -1809,13 +1836,6 @@ export interface EditFolderError extends Error {
|
|
|
1809
1836
|
|
|
1810
1837
|
export function isEditFolderError(error: any): error is EditFolderError;
|
|
1811
1838
|
|
|
1812
|
-
export interface CreateFolderError extends Error {
|
|
1813
|
-
name: "CreateFolderError";
|
|
1814
|
-
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "Repository";
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
export function isCreateFolderError(error: any): error is CreateFolderError;
|
|
1818
|
-
|
|
1819
1839
|
/**
|
|
1820
1840
|
* Request to add or edit a folder.
|
|
1821
1841
|
*/
|
|
@@ -1826,6 +1846,13 @@ export interface FolderAddEditRequest {
|
|
|
1826
1846
|
name: string;
|
|
1827
1847
|
}
|
|
1828
1848
|
|
|
1849
|
+
export interface CreateFolderError extends Error {
|
|
1850
|
+
name: "CreateFolderError";
|
|
1851
|
+
variant: "Crypto" | "Api" | "VaultParse" | "MissingField" | "Repository";
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
export function isCreateFolderError(error: any): error is CreateFolderError;
|
|
1855
|
+
|
|
1829
1856
|
export interface GetFolderError extends Error {
|
|
1830
1857
|
name: "GetFolderError";
|
|
1831
1858
|
variant: "ItemNotFound" | "Crypto" | "Repository";
|