@zohocorporation/vault-cli 1.1.2
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 +16 -0
- package/out/commands/add/add.const.js +6 -0
- package/out/commands/add/add.types.js +2 -0
- package/out/commands/add/add.util.js +35 -0
- package/out/commands/download/download.const.js +6 -0
- package/out/commands/download/download.types.js +2 -0
- package/out/commands/download/download.utils.js +35 -0
- package/out/commands/generate-password/generate-password.const.js +12 -0
- package/out/commands/generate-password/generate-password.types.js +2 -0
- package/out/commands/generate-password/generate-password.utils.js +58 -0
- package/out/commands/generate-template/generate-template.const.js +7 -0
- package/out/commands/generate-template/generate-template.types.js +2 -0
- package/out/commands/generate-template/generate-template.util.js +37 -0
- package/out/commands/get/get.const.js +8 -0
- package/out/commands/get/get.types.js +2 -0
- package/out/commands/get/get.utils.js +45 -0
- package/out/commands/get-default/get-default.const.js +5 -0
- package/out/commands/get-default/get-default.types.js +2 -0
- package/out/commands/get-default/get-default.utils.js +33 -0
- package/out/commands/list/list.const.js +7 -0
- package/out/commands/list/list.types.js +2 -0
- package/out/commands/list/list.utils.js +43 -0
- package/out/commands/lock/lock.action.js +13 -0
- package/out/commands/lock/lock.js +10 -0
- package/out/commands/lock/lock.utils.js +52 -0
- package/out/commands/login/login.action.js +22 -0
- package/out/commands/login/login.const.js +10 -0
- package/out/commands/login/login.help.js +12 -0
- package/out/commands/login/login.js +17 -0
- package/out/commands/login/login.types.js +5 -0
- package/out/commands/login/login.utils.js +307 -0
- package/out/commands/reset/reset.action.js +28 -0
- package/out/commands/reset/reset.help.js +8 -0
- package/out/commands/reset/reset.js +14 -0
- package/out/commands/reset/reset.utils.js +2 -0
- package/out/commands/search/search.action.js +30 -0
- package/out/commands/search/search.constants.js +14 -0
- package/out/commands/search/search.help.js +6 -0
- package/out/commands/search/search.js +26 -0
- package/out/commands/search/search.types.js +16 -0
- package/out/commands/search/search.utils.js +61 -0
- package/out/commands/set-default/set-default.const.js +6 -0
- package/out/commands/set-default/set-default.types.js +2 -0
- package/out/commands/set-default/set-default.utils.js +39 -0
- package/out/commands/unlock/unlock.action.js +23 -0
- package/out/commands/unlock/unlock.help.js +2 -0
- package/out/commands/unlock/unlock.js +12 -0
- package/out/commands/unlock/unlock.type.js +2 -0
- package/out/commands/unlock/unlock.utils.js +133 -0
- package/out/js/I18n/index.js +80 -0
- package/out/js/I18n/resources/CLI_I18N_en.js +173 -0
- package/out/js/I18n/resources/CLI_I18N_es.js +3 -0
- package/out/js/I18n/resources/CLI_I18N_fr.js +3 -0
- package/out/js/I18n/resources/CLI_I18N_nl.js +3 -0
- package/out/js/I18n/resources/CLI_I18N_pt.js +3 -0
- package/out/js/I18n/resources/CLI_I18N_zh.js +3 -0
- package/out/js/crypto/aes.js +225 -0
- package/out/js/crypto/index.js +139 -0
- package/out/js/crypto/rsa.js +1945 -0
- package/out/js/crypto/zohovault.js +671 -0
- package/out/js/logger/index.js +10 -0
- package/out/old/Add.js +590 -0
- package/out/old/Default.js +209 -0
- package/out/old/Download.js +69 -0
- package/out/old/Generate.js +171 -0
- package/out/old/Get.js +225 -0
- package/out/old/List.js +197 -0
- package/out/old/Login.js +287 -0
- package/out/old/Logout.js +21 -0
- package/out/old/PasswordGenerator.js +718 -0
- package/out/old/PasswordPolicies.js +21 -0
- package/out/old/PasswordTypes.js +33 -0
- package/out/old/Update.js +682 -0
- package/out/old/cmd/addcmd.js +59 -0
- package/out/old/cmd/downloadcmd.js +76 -0
- package/out/old/cmd/generate-passwordcmd.js +127 -0
- package/out/old/cmd/generate-templatecmd.js +59 -0
- package/out/old/cmd/get-defaultcmd.js +48 -0
- package/out/old/cmd/getcmd.js +57 -0
- package/out/old/cmd/listcmd.js +54 -0
- package/out/old/cmd/logoutcmd.js +31 -0
- package/out/old/cmd/set-default.js +75 -0
- package/out/old/cmd/updatecmd.js +44 -0
- package/out/old/index.js +580 -0
- package/out/util/configuration.util.js +103 -0
- package/out/util/consts.util.js +97 -0
- package/out/util/dbutils/db.types.js +2 -0
- package/out/util/dbutils/db.utils.js +164 -0
- package/out/util/dbutils/dbtable.utils.js +19 -0
- package/out/util/dev.utils.js +14 -0
- package/out/util/encryptionutil/encryption.uitl.js +108 -0
- package/out/util/index.util.js +341 -0
- package/out/util/keyringutil/keyring.util.js +57 -0
- package/out/util/loader/loader.interface.js +2 -0
- package/out/util/loader/transfer.loader.js +28 -0
- package/out/util/login.util.js +352 -0
- package/out/util/passwordtypes.util.js +91 -0
- package/out/util/print.util.js +4 -0
- package/out/util/search.util.js +359 -0
- package/out/util/types.util.js +7 -0
- package/out/zv.js +41 -0
- package/package.json +96 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Login } from "../util/login.util.js";
|
|
2
|
+
import { _pull, Utilities } from "../util/index.util.js";
|
|
3
|
+
import { header } from "../commands/login/login.utils.js";
|
|
4
|
+
import { VAULT_ENDPOINTS } from "../util/consts.util.js";
|
|
5
|
+
export class PasswordPolicies extends Login {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
}
|
|
9
|
+
static async getPolicies(dc, policyId) {
|
|
10
|
+
if (policyId !== undefined) {
|
|
11
|
+
const policiesResp = await _pull(header, `${Utilities.getVaultUrl(dc === undefined ? this.dc : dc)}${VAULT_ENDPOINTS.URL_PASSWORD_POLICIES}/${policyId}`);
|
|
12
|
+
return policiesResp.data.operation.Details;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
const policiesResp = await _pull(header, Utilities.getVaultUrl(dc === undefined ? this.dc : dc) +
|
|
16
|
+
VAULT_ENDPOINTS.URL_PASSWORD_POLICIES);
|
|
17
|
+
return policiesResp.data.operation.Details;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=PasswordPolicies.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { _pull, urlSecretTypes, Utilites } from "./index.js";
|
|
2
|
+
export class PasswordTypes {
|
|
3
|
+
constructor() { }
|
|
4
|
+
static async getPasswordTypes(dc, policyId) {
|
|
5
|
+
let resp;
|
|
6
|
+
let secretTypes;
|
|
7
|
+
if (policyId === undefined) {
|
|
8
|
+
resp = await _pull(Utilites.getVaultUrl(dc === undefined ? this.dc : dc) + urlSecretTypes, { allTypes: false, getDefaults: true });
|
|
9
|
+
if (resp.data.operation.result.status !== "Success") {
|
|
10
|
+
console.log(resp.data.operation.result.message);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
secretTypes = resp.data.operation.Details.secret_types;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
resp = await _pull(`${Utilites.getVaultUrl(dc === undefined ? this.dc : dc)}${urlSecretTypes}/${policyId}`);
|
|
17
|
+
secretTypes = [resp.data.operation.Details];
|
|
18
|
+
}
|
|
19
|
+
let formattedSecretTypes = {};
|
|
20
|
+
for (let i = 0; i < secretTypes.length; i++) {
|
|
21
|
+
if (secretTypes[i].status === true) // changed this line
|
|
22
|
+
{
|
|
23
|
+
formattedSecretTypes[secretTypes[i].secret_type_id] = secretTypes[i];
|
|
24
|
+
}
|
|
25
|
+
else if (secretTypes[i].status === false && policyId != undefined) //(policy = secret type) changed this line
|
|
26
|
+
{
|
|
27
|
+
formattedSecretTypes[secretTypes[i].secret_type_id] = secretTypes[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return formattedSecretTypes;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=PasswordTypes.js.map
|