@binsky/passman-client-ts 0.1.0-7
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/README.md +9 -0
- package/lib/BrowserStorage.d.ts +39 -0
- package/lib/BrowserStorage.js +137 -0
- package/lib/Exception/ConfigurationError.d.ts +6 -0
- package/lib/Exception/ConfigurationError.js +11 -0
- package/lib/Exception/FormFieldError.d.ts +4 -0
- package/lib/Exception/FormFieldError.js +2 -0
- package/lib/Interfaces/Credential/CredentialInterface.d.ts +33 -0
- package/lib/Interfaces/Credential/CredentialInterface.js +2 -0
- package/lib/Interfaces/Credential/CustomFieldInterface.d.ts +6 -0
- package/lib/Interfaces/Credential/CustomFieldInterface.js +2 -0
- package/lib/Interfaces/Credential/EncryptedCredentialInterface.d.ts +31 -0
- package/lib/Interfaces/Credential/EncryptedCredentialInterface.js +2 -0
- package/lib/Interfaces/Credential/IconInterface.d.ts +4 -0
- package/lib/Interfaces/Credential/IconInterface.js +2 -0
- package/lib/Interfaces/Credential/OTPConfigInterface.d.ts +14 -0
- package/lib/Interfaces/Credential/OTPConfigInterface.js +2 -0
- package/lib/Interfaces/Credential/TagInterface.d.ts +3 -0
- package/lib/Interfaces/Credential/TagInterface.js +2 -0
- package/lib/Interfaces/CredentialFilterService/FilterStatsInterface.d.ts +10 -0
- package/lib/Interfaces/CredentialFilterService/FilterStatsInterface.js +2 -0
- package/lib/Interfaces/File/DeleteFilesRequestBodyInterface.d.ts +3 -0
- package/lib/Interfaces/File/DeleteFilesRequestBodyInterface.js +2 -0
- package/lib/Interfaces/File/DeleteFilesResponseInterface.d.ts +4 -0
- package/lib/Interfaces/File/DeleteFilesResponseInterface.js +2 -0
- package/lib/Interfaces/File/FileInterface.d.ts +9 -0
- package/lib/Interfaces/File/FileInterface.js +2 -0
- package/lib/Interfaces/File/FileUploadResponseInterface.d.ts +9 -0
- package/lib/Interfaces/File/FileUploadResponseInterface.js +2 -0
- package/lib/Interfaces/LoggingHandlerInterface.d.ts +9 -0
- package/lib/Interfaces/LoggingHandlerInterface.js +2 -0
- package/lib/Interfaces/NextcloudServer/NextcloudServerInterface.d.ts +6 -0
- package/lib/Interfaces/NextcloudServer/NextcloudServerInterface.js +2 -0
- package/lib/Interfaces/PassmanCrypto/GenerateKeypairResponseInterface.d.ts +5 -0
- package/lib/Interfaces/PassmanCrypto/GenerateKeypairResponseInterface.js +2 -0
- package/lib/Interfaces/PassmanCrypto/PEMRSAKeypairInterface.d.ts +4 -0
- package/lib/Interfaces/PassmanCrypto/PEMRSAKeypairInterface.js +2 -0
- package/lib/Interfaces/PassmanCrypto/RSAKeypairInterface.d.ts +5 -0
- package/lib/Interfaces/PassmanCrypto/RSAKeypairInterface.js +2 -0
- package/lib/Interfaces/PasswordGeneratorService/PasswordGeneratorConfigurationInterface.d.ts +9 -0
- package/lib/Interfaces/PasswordGeneratorService/PasswordGeneratorConfigurationInterface.js +2 -0
- package/lib/Interfaces/ReEncryptionService/ReEncryptionProgressInterface.d.ts +7 -0
- package/lib/Interfaces/ReEncryptionService/ReEncryptionProgressInterface.js +2 -0
- package/lib/Interfaces/ReEncryptionService/ReEncryptionStageProgressInterface.d.ts +5 -0
- package/lib/Interfaces/ReEncryptionService/ReEncryptionStageProgressInterface.js +2 -0
- package/lib/Interfaces/Revision/RevisionInterface.d.ts +8 -0
- package/lib/Interfaces/Revision/RevisionInterface.js +2 -0
- package/lib/Interfaces/ShareService/ACLInterface.d.ts +15 -0
- package/lib/Interfaces/ShareService/ACLInterface.js +2 -0
- package/lib/Interfaces/ShareService/CredentialShareRequestInterface.d.ts +16 -0
- package/lib/Interfaces/ShareService/CredentialShareRequestInterface.js +2 -0
- package/lib/Interfaces/Vault/VaultInterface.d.ts +15 -0
- package/lib/Interfaces/Vault/VaultInterface.js +2 -0
- package/lib/Interfaces/Vault/VaultResponseInterface.d.ts +15 -0
- package/lib/Interfaces/Vault/VaultResponseInterface.js +2 -0
- package/lib/LocalPassmanStore.d.ts +4 -0
- package/lib/LocalPassmanStore.js +14 -0
- package/lib/Model/Credential.d.ts +173 -0
- package/lib/Model/Credential.js +594 -0
- package/lib/Model/File.d.ts +15 -0
- package/lib/Model/File.js +55 -0
- package/lib/Model/NextcloudServer.d.ts +27 -0
- package/lib/Model/NextcloudServer.js +108 -0
- package/lib/Model/Revision.d.ts +21 -0
- package/lib/Model/Revision.js +33 -0
- package/lib/Model/SharingACL.d.ts +28 -0
- package/lib/Model/SharingACL.js +48 -0
- package/lib/Model/Vault.d.ts +38 -0
- package/lib/Model/Vault.js +265 -0
- package/lib/PassmanClient.d.ts +20 -0
- package/lib/PassmanClient.js +80 -0
- package/lib/Service/CredentialFilterService.d.ts +24 -0
- package/lib/Service/CredentialFilterService.js +209 -0
- package/lib/Service/CustomMathsService.d.ts +7 -0
- package/lib/Service/CustomMathsService.js +52 -0
- package/lib/Service/DefaultLoggingService.d.ts +10 -0
- package/lib/Service/DefaultLoggingService.js +27 -0
- package/lib/Service/DownloadService.d.ts +12 -0
- package/lib/Service/DownloadService.js +121 -0
- package/lib/Service/OTPService.d.ts +22 -0
- package/lib/Service/OTPService.js +134 -0
- package/lib/Service/PassmanCrypto.d.ts +10 -0
- package/lib/Service/PassmanCrypto.js +57 -0
- package/lib/Service/PasswordGeneratorService.d.ts +6 -0
- package/lib/Service/PasswordGeneratorService.js +73 -0
- package/lib/Service/ReEncryptionService.d.ts +23 -0
- package/lib/Service/ReEncryptionService.js +318 -0
- package/lib/Service/ShareService.d.ts +15 -0
- package/lib/Service/ShareService.js +56 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare enum BrowserStorageType {
|
|
2
|
+
MEMORY = "memory",
|
|
3
|
+
SESSION = "sessionStorage",
|
|
4
|
+
PERSISTENT = "localStorage"
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Custom encrypted browser storage handler that uses sessionStorage by default.
|
|
8
|
+
* The get, set, del methods automatically use the storage type stored in the localStorage, or SESSION by default.
|
|
9
|
+
*/
|
|
10
|
+
export declare class BrowserStorage {
|
|
11
|
+
private secretKey;
|
|
12
|
+
private identifier;
|
|
13
|
+
private storageType;
|
|
14
|
+
private static defaultStorageType;
|
|
15
|
+
private static instances;
|
|
16
|
+
private encryptStorage;
|
|
17
|
+
private fakeMemoryStorage;
|
|
18
|
+
private constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Returns an existing BrowserStorage instance or creates a new one based on a unique identifier with the given storage type.
|
|
21
|
+
*/
|
|
22
|
+
static getInstance(secretKey: string, identifier?: string, storageType?: BrowserStorageType): BrowserStorage;
|
|
23
|
+
/**
|
|
24
|
+
* Check if there is at least one instance with the specified identifier, ignoring the BrowserStorageType.
|
|
25
|
+
* @param identifier
|
|
26
|
+
*/
|
|
27
|
+
static hasInstance(identifier: string): boolean;
|
|
28
|
+
static getDefaultStorageType(): string;
|
|
29
|
+
static setDefaultStorageType(storageType: BrowserStorageType): void;
|
|
30
|
+
static clearAllStorageTypesForVaultGUID(vaultGUID: string): void;
|
|
31
|
+
static ensureDeleteKeyForAllStorageTypes(storageIdentifier: string, keyToDelete: string): void;
|
|
32
|
+
updateStorageType(storageType: BrowserStorageType): void;
|
|
33
|
+
getStorageType(): BrowserStorageType;
|
|
34
|
+
getIdentifier(): string;
|
|
35
|
+
get: (key: string) => any | undefined;
|
|
36
|
+
set: (key: string, value: any) => void;
|
|
37
|
+
del: (key: string) => void;
|
|
38
|
+
clearDeleteStorage(): void;
|
|
39
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowserStorage = exports.BrowserStorageType = void 0;
|
|
4
|
+
const encrypt_storage_1 = require("encrypt-storage");
|
|
5
|
+
var BrowserStorageType;
|
|
6
|
+
(function (BrowserStorageType) {
|
|
7
|
+
BrowserStorageType["MEMORY"] = "memory";
|
|
8
|
+
BrowserStorageType["SESSION"] = "sessionStorage";
|
|
9
|
+
BrowserStorageType["PERSISTENT"] = "localStorage";
|
|
10
|
+
})(BrowserStorageType || (exports.BrowserStorageType = BrowserStorageType = {}));
|
|
11
|
+
/**
|
|
12
|
+
* Custom encrypted browser storage handler that uses sessionStorage by default.
|
|
13
|
+
* The get, set, del methods automatically use the storage type stored in the localStorage, or SESSION by default.
|
|
14
|
+
*/
|
|
15
|
+
class BrowserStorage {
|
|
16
|
+
secretKey;
|
|
17
|
+
identifier;
|
|
18
|
+
storageType;
|
|
19
|
+
static defaultStorageType = localStorage.getItem("storage");
|
|
20
|
+
static instances = [];
|
|
21
|
+
encryptStorage;
|
|
22
|
+
fakeMemoryStorage = {};
|
|
23
|
+
constructor(secretKey, identifier, storageType) {
|
|
24
|
+
this.secretKey = secretKey;
|
|
25
|
+
this.identifier = identifier;
|
|
26
|
+
this.storageType = storageType;
|
|
27
|
+
this.encryptStorage = new encrypt_storage_1.EncryptStorage(this.secretKey, {
|
|
28
|
+
prefix: '@' + identifier,
|
|
29
|
+
storageType: storageType === BrowserStorageType.PERSISTENT ? BrowserStorageType.PERSISTENT : BrowserStorageType.SESSION
|
|
30
|
+
});
|
|
31
|
+
BrowserStorage.instances.push(this);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns an existing BrowserStorage instance or creates a new one based on a unique identifier with the given storage type.
|
|
35
|
+
*/
|
|
36
|
+
static getInstance(secretKey, identifier = "default", storageType = undefined) {
|
|
37
|
+
for (let i = 0; i < BrowserStorage.instances.length; i++) {
|
|
38
|
+
if (BrowserStorage.instances[i].identifier === identifier) {
|
|
39
|
+
return BrowserStorage.instances[i];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return new BrowserStorage(secretKey, identifier, storageType ?? BrowserStorage.defaultStorageType);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if there is at least one instance with the specified identifier, ignoring the BrowserStorageType.
|
|
46
|
+
* @param identifier
|
|
47
|
+
*/
|
|
48
|
+
static hasInstance(identifier) {
|
|
49
|
+
for (let i = 0; i < BrowserStorage.instances.length; i++) {
|
|
50
|
+
if (BrowserStorage.instances[i].identifier === identifier) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
static getDefaultStorageType() {
|
|
57
|
+
return BrowserStorage.defaultStorageType;
|
|
58
|
+
}
|
|
59
|
+
static setDefaultStorageType(storageType) {
|
|
60
|
+
BrowserStorage.defaultStorageType = storageType;
|
|
61
|
+
localStorage.setItem("storage", storageType);
|
|
62
|
+
}
|
|
63
|
+
static clearAllStorageTypesForVaultGUID(vaultGUID) {
|
|
64
|
+
// delete all vault browser storage instances, if exists
|
|
65
|
+
BrowserStorage.getInstance('vault-' + vaultGUID, BrowserStorageType.MEMORY).clearDeleteStorage();
|
|
66
|
+
BrowserStorage.getInstance('vault-' + vaultGUID, BrowserStorageType.SESSION).clearDeleteStorage();
|
|
67
|
+
BrowserStorage.getInstance('vault-' + vaultGUID, BrowserStorageType.PERSISTENT).clearDeleteStorage();
|
|
68
|
+
}
|
|
69
|
+
static ensureDeleteKeyForAllStorageTypes(storageIdentifier, keyToDelete) {
|
|
70
|
+
BrowserStorage.getInstance(storageIdentifier, BrowserStorageType.MEMORY).del(keyToDelete);
|
|
71
|
+
BrowserStorage.getInstance(storageIdentifier, BrowserStorageType.SESSION).del(keyToDelete);
|
|
72
|
+
BrowserStorage.getInstance(storageIdentifier, BrowserStorageType.PERSISTENT).del(keyToDelete);
|
|
73
|
+
}
|
|
74
|
+
updateStorageType(storageType) {
|
|
75
|
+
if (this.storageType !== storageType) {
|
|
76
|
+
this.storageType = storageType;
|
|
77
|
+
if (storageType !== BrowserStorageType.MEMORY) {
|
|
78
|
+
this.encryptStorage = new encrypt_storage_1.EncryptStorage(this.secretKey, {
|
|
79
|
+
prefix: '@' + this.identifier,
|
|
80
|
+
storageType: storageType === BrowserStorageType.PERSISTENT ? BrowserStorageType.PERSISTENT : BrowserStorageType.SESSION,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
getStorageType() {
|
|
86
|
+
return this.storageType;
|
|
87
|
+
}
|
|
88
|
+
getIdentifier() {
|
|
89
|
+
return this.identifier;
|
|
90
|
+
}
|
|
91
|
+
get = (key) => {
|
|
92
|
+
if (BrowserStorage.defaultStorageType === BrowserStorageType.MEMORY) {
|
|
93
|
+
if (key in Object.keys(this.fakeMemoryStorage)) {
|
|
94
|
+
return this.fakeMemoryStorage[key];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return this.encryptStorage.getItem(key);
|
|
99
|
+
}
|
|
100
|
+
return undefined;
|
|
101
|
+
};
|
|
102
|
+
set = (key, value) => {
|
|
103
|
+
if (BrowserStorage.defaultStorageType === BrowserStorageType.MEMORY) {
|
|
104
|
+
this.fakeMemoryStorage[key] = value;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
this.encryptStorage.setItem(key, value);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
del = (key) => {
|
|
111
|
+
if (BrowserStorage.defaultStorageType === BrowserStorageType.MEMORY) {
|
|
112
|
+
delete this.fakeMemoryStorage[key];
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
this.encryptStorage.removeItem(key);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
clearDeleteStorage() {
|
|
119
|
+
/*
|
|
120
|
+
this.encryptStorage.clear(); clears the complete storage of the selected type and does not difference by identifier.
|
|
121
|
+
So we use this custom implementation to clear by identifier prefix.
|
|
122
|
+
*/
|
|
123
|
+
if (this.storageType !== BrowserStorageType.MEMORY) {
|
|
124
|
+
const selectedStorage = this.storageType === BrowserStorageType.SESSION ? sessionStorage : localStorage;
|
|
125
|
+
Object.keys(selectedStorage)
|
|
126
|
+
.filter(x => x.startsWith('@' + this.identifier))
|
|
127
|
+
.forEach(x => selectedStorage.removeItem(x));
|
|
128
|
+
}
|
|
129
|
+
for (let i = 0; i < BrowserStorage.instances.length; i++) {
|
|
130
|
+
if (BrowserStorage.instances[i].identifier === this.identifier) {
|
|
131
|
+
BrowserStorage.instances.splice(i, 1);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.BrowserStorage = BrowserStorage;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CustomFieldInterface } from "./CustomFieldInterface";
|
|
2
|
+
import { TagInterface } from "./TagInterface";
|
|
3
|
+
import { IconInterface } from "./IconInterface";
|
|
4
|
+
import { FileInterface } from "../File/FileInterface";
|
|
5
|
+
import { OTPConfigInterface } from "./OTPConfigInterface";
|
|
6
|
+
export interface CredentialInterface {
|
|
7
|
+
credential_id?: number;
|
|
8
|
+
guid?: string;
|
|
9
|
+
user_id: string;
|
|
10
|
+
vault_id: number;
|
|
11
|
+
label: string;
|
|
12
|
+
description: string;
|
|
13
|
+
tags: TagInterface[];
|
|
14
|
+
email: string;
|
|
15
|
+
username: string;
|
|
16
|
+
password: string;
|
|
17
|
+
url: string;
|
|
18
|
+
files: FileInterface[];
|
|
19
|
+
custom_fields: CustomFieldInterface[];
|
|
20
|
+
otp: OTPConfigInterface;
|
|
21
|
+
compromised: boolean;
|
|
22
|
+
shared_key: string | null;
|
|
23
|
+
favicon: string;
|
|
24
|
+
icon: IconInterface | null;
|
|
25
|
+
renew_interval: number | null;
|
|
26
|
+
expire_time: number;
|
|
27
|
+
delete_time: number;
|
|
28
|
+
hidden: boolean;
|
|
29
|
+
created: number;
|
|
30
|
+
changed: number;
|
|
31
|
+
set_share_key: boolean | null;
|
|
32
|
+
skip_revision: boolean | null;
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IconInterface } from "./IconInterface";
|
|
2
|
+
import { ACLInterface } from "../ShareService/ACLInterface";
|
|
3
|
+
export interface EncryptedCredentialInterface {
|
|
4
|
+
credential_id?: number;
|
|
5
|
+
guid?: string;
|
|
6
|
+
user_id: string;
|
|
7
|
+
vault_id: number;
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
tags: string;
|
|
11
|
+
email: string;
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
url: string;
|
|
15
|
+
files: string;
|
|
16
|
+
custom_fields: string;
|
|
17
|
+
otp: string;
|
|
18
|
+
compromised: string;
|
|
19
|
+
shared_key: string | null;
|
|
20
|
+
favicon: string;
|
|
21
|
+
icon: IconInterface | null;
|
|
22
|
+
renew_interval: number | null;
|
|
23
|
+
expire_time: number;
|
|
24
|
+
delete_time: number;
|
|
25
|
+
hidden: boolean;
|
|
26
|
+
created: number;
|
|
27
|
+
changed: number;
|
|
28
|
+
set_share_key: boolean | null;
|
|
29
|
+
skip_revision: boolean | null;
|
|
30
|
+
acl?: ACLInterface;
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Secret } from "otpauth";
|
|
2
|
+
export interface OTPConfigInterface {
|
|
3
|
+
issuer?: string | undefined;
|
|
4
|
+
label?: string | undefined;
|
|
5
|
+
secret?: string | Secret | undefined;
|
|
6
|
+
algorithm?: string | undefined;
|
|
7
|
+
digits?: number | undefined;
|
|
8
|
+
period?: number | undefined;
|
|
9
|
+
qr_uri?: undefined | {
|
|
10
|
+
qrData: string;
|
|
11
|
+
image: any;
|
|
12
|
+
};
|
|
13
|
+
type?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface LoggingHandlerInterface {
|
|
2
|
+
onDebug(message: string): void;
|
|
3
|
+
onInfo(message: string): void;
|
|
4
|
+
onSuccess(message: string): void;
|
|
5
|
+
onWarning(message: string): void;
|
|
6
|
+
onError(message: string): void;
|
|
7
|
+
anyError(error: any): void;
|
|
8
|
+
onThrow(error: Error): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReEncryptionStageProgressInterface } from "./ReEncryptionStageProgressInterface";
|
|
2
|
+
export interface ReEncryptionProgressInterface {
|
|
3
|
+
credentialsStage: ReEncryptionStageProgressInterface;
|
|
4
|
+
revisionsStage: ReEncryptionStageProgressInterface;
|
|
5
|
+
filesStage: ReEncryptionStageProgressInterface;
|
|
6
|
+
uploadStage: ReEncryptionStageProgressInterface;
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SharingACL } from "../../Model/SharingACL";
|
|
2
|
+
export interface ACLInterface {
|
|
3
|
+
acl_id: number;
|
|
4
|
+
item_id: number;
|
|
5
|
+
item_guid: string;
|
|
6
|
+
user_id: string;
|
|
7
|
+
created: number;
|
|
8
|
+
expire: number;
|
|
9
|
+
expire_views: number;
|
|
10
|
+
permissions: SharingACL;
|
|
11
|
+
vault_id: number;
|
|
12
|
+
vault_guid: string;
|
|
13
|
+
shared_key: string;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EncryptedCredentialInterface } from "../Credential/EncryptedCredentialInterface";
|
|
2
|
+
export interface CredentialShareRequestInterface {
|
|
3
|
+
acl_id: number;
|
|
4
|
+
item_id: number;
|
|
5
|
+
item_guid: string;
|
|
6
|
+
user_id: string;
|
|
7
|
+
created: number;
|
|
8
|
+
expire: number;
|
|
9
|
+
expire_views: number;
|
|
10
|
+
permissions: number;
|
|
11
|
+
vault_id: number;
|
|
12
|
+
vault_guid: string;
|
|
13
|
+
shared_key: string;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
credential_data?: EncryptedCredentialInterface;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Credential from "../../Model/Credential";
|
|
2
|
+
export interface VaultInterface {
|
|
3
|
+
vault_id?: number;
|
|
4
|
+
guid?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
created: number;
|
|
7
|
+
public_sharing_key: string;
|
|
8
|
+
private_sharing_key: string;
|
|
9
|
+
sharing_keys_generated: number;
|
|
10
|
+
last_access: number;
|
|
11
|
+
challenge_password: string;
|
|
12
|
+
delete_request_pending: boolean;
|
|
13
|
+
vault_settings: null;
|
|
14
|
+
credentials: Credential[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EncryptedCredentialInterface } from "../Credential/EncryptedCredentialInterface";
|
|
2
|
+
export interface VaultResponseInterface {
|
|
3
|
+
vault_id?: number;
|
|
4
|
+
guid?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
created: number;
|
|
7
|
+
public_sharing_key: string;
|
|
8
|
+
private_sharing_key: string;
|
|
9
|
+
sharing_keys_generated: number;
|
|
10
|
+
last_access: number;
|
|
11
|
+
challenge_password: string;
|
|
12
|
+
delete_request_pending: boolean;
|
|
13
|
+
vault_settings: null;
|
|
14
|
+
credentials: EncryptedCredentialInterface[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalPassmanStore = void 0;
|
|
4
|
+
const datastore_core_1 = require("datastore-core");
|
|
5
|
+
const interface_datastore_1 = require("interface-datastore");
|
|
6
|
+
class LocalPassmanStore {
|
|
7
|
+
store;
|
|
8
|
+
constructor() {
|
|
9
|
+
this.store = new datastore_core_1.MountDatastore([
|
|
10
|
+
{ prefix: new interface_datastore_1.Key('memory'), datastore: new datastore_core_1.MemoryDatastore() }
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.LocalPassmanStore = LocalPassmanStore;
|