@opscompass/opscompass-cli 1.0.36 → 1.0.37
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/environment/current.js +5 -5
- package/environment/demo.js +5 -4
- package/environment/dev.js +4 -3
- package/environment/local.js +5 -4
- package/environment/production.js +5 -5
- package/index.js +1 -0
- package/lib/consts.js +25 -0
- package/lib/maskValues.js +545 -0
- package/lib/utils.js +604 -0
- package/modules/data-gathering-scripts.js +0 -3
- package/modules/defaults.js +66 -20
- package/modules/license-manager.js +347 -238
- package/package.json +8 -5
package/environment/current.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// production: OpsCompassClient is referenced from npm package
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
const {
|
|
5
4
|
OpsCompassClient,
|
|
6
5
|
ScriptType,
|
|
7
|
-
OAuthHandler
|
|
6
|
+
OAuthHandler,
|
|
8
7
|
} = require("@opscompass/opscompass-api");
|
|
9
8
|
|
|
10
9
|
const path = require("path");
|
|
11
10
|
const { homedir } = require("os");
|
|
12
|
-
const opscompassHome = path.join(homedir(),
|
|
11
|
+
const opscompassHome = path.join(homedir(), ".opscompass");
|
|
13
12
|
const cliCommand = "opscompass";
|
|
14
13
|
|
|
15
14
|
const clientId = "vOakDaOv4L26f3uuI4sp3KC1Sov3nsW2";
|
|
16
15
|
// default authDomain
|
|
17
16
|
// default audience
|
|
18
17
|
const oAuthClient = new OAuthHandler(clientId);
|
|
19
|
-
const isLocal = false
|
|
18
|
+
const isLocal = false;
|
|
20
19
|
|
|
21
20
|
module.exports = {
|
|
22
21
|
OpsCompassClient,
|
|
@@ -24,5 +23,6 @@ module.exports = {
|
|
|
24
23
|
oAuthClient,
|
|
25
24
|
opscompassHome,
|
|
26
25
|
isLocal,
|
|
27
|
-
cliCommand
|
|
26
|
+
cliCommand,
|
|
27
|
+
decoder: "TjFXOWhWdnppb2Zoa2ZFcmd1TWI",
|
|
28
28
|
};
|
package/environment/demo.js
CHANGED
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
const {
|
|
4
4
|
OpsCompassClient,
|
|
5
5
|
ScriptType,
|
|
6
|
-
OAuthHandler
|
|
6
|
+
OAuthHandler,
|
|
7
7
|
} = require("@opscompass/opscompass-api-demo");
|
|
8
8
|
|
|
9
9
|
const path = require("path");
|
|
10
10
|
const { homedir } = require("os");
|
|
11
|
-
const opscompassHome = path.join(homedir(),
|
|
11
|
+
const opscompassHome = path.join(homedir(), ".opscompassdemo");
|
|
12
12
|
const cliCommand = "opscompassdemo";
|
|
13
13
|
|
|
14
14
|
const clientId = "XOPT3HDcwhskfVjc9IMjLXV1pov79blV";
|
|
15
15
|
const authDomain = "auth-dev.opscompass.com";
|
|
16
16
|
const audience = "https://opscompass-api-demo.azure-api.net";
|
|
17
17
|
const oAuthClient = new OAuthHandler(clientId, authDomain, audience);
|
|
18
|
-
const isLocal = false
|
|
18
|
+
const isLocal = false;
|
|
19
19
|
|
|
20
20
|
module.exports = {
|
|
21
21
|
OpsCompassClient,
|
|
@@ -23,5 +23,6 @@ module.exports = {
|
|
|
23
23
|
oAuthClient,
|
|
24
24
|
opscompassHome,
|
|
25
25
|
isLocal,
|
|
26
|
-
cliCommand
|
|
26
|
+
cliCommand,
|
|
27
|
+
decoder: "TjFXOWhWdnppb2Zoa2ZFcmd1TWI",
|
|
27
28
|
};
|
package/environment/dev.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
const {
|
|
4
4
|
OpsCompassClient,
|
|
5
5
|
ScriptType,
|
|
6
|
-
OAuthHandler
|
|
6
|
+
OAuthHandler,
|
|
7
7
|
} = require("@opscompass/opscompass-api-dev");
|
|
8
8
|
|
|
9
9
|
const path = require("path");
|
|
10
10
|
const { homedir } = require("os");
|
|
11
|
-
const opscompassHome = path.join(homedir(),
|
|
11
|
+
const opscompassHome = path.join(homedir(), ".opscompassdev");
|
|
12
12
|
const cliCommand = "opscompassdev";
|
|
13
13
|
|
|
14
14
|
const clientId = "XOPT3HDcwhskfVjc9IMjLXV1pov79blV";
|
|
@@ -23,5 +23,6 @@ module.exports = {
|
|
|
23
23
|
oAuthClient,
|
|
24
24
|
opscompassHome,
|
|
25
25
|
isLocal,
|
|
26
|
-
cliCommand
|
|
26
|
+
cliCommand,
|
|
27
|
+
decoder: "TjFXOWhWdnppb2Zoa2ZFcmd1TWI",
|
|
27
28
|
};
|
package/environment/local.js
CHANGED
|
@@ -4,19 +4,19 @@
|
|
|
4
4
|
const {
|
|
5
5
|
OpsCompassClient,
|
|
6
6
|
ScriptType,
|
|
7
|
-
OAuthHandler
|
|
7
|
+
OAuthHandler,
|
|
8
8
|
} = require("@opscompass/opscompass-api");
|
|
9
9
|
|
|
10
10
|
const path = require("path");
|
|
11
11
|
const { homedir } = require("os");
|
|
12
|
-
const opscompassHome = path.join(homedir(),
|
|
12
|
+
const opscompassHome = path.join(homedir(), ".opscompassdev");
|
|
13
13
|
const cliCommand = "opscompassdev";
|
|
14
14
|
|
|
15
15
|
const clientId = "XOPT3HDcwhskfVjc9IMjLXV1pov79blV";
|
|
16
16
|
const authDomain = "auth-dev.opscompass.com";
|
|
17
17
|
const audience = "https://fa-sampleapi-cus-dev.azurewebsites.net";
|
|
18
18
|
const oAuthClient = new OAuthHandler(clientId, authDomain, audience);
|
|
19
|
-
const isLocal = true
|
|
19
|
+
const isLocal = true;
|
|
20
20
|
|
|
21
21
|
module.exports = {
|
|
22
22
|
OpsCompassClient,
|
|
@@ -24,5 +24,6 @@ module.exports = {
|
|
|
24
24
|
oAuthClient,
|
|
25
25
|
opscompassHome,
|
|
26
26
|
isLocal,
|
|
27
|
-
cliCommand
|
|
27
|
+
cliCommand,
|
|
28
|
+
decoder: "TjFXOWhWdnppb2Zoa2ZFcmd1TWI",
|
|
28
29
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// production: OpsCompassClient is referenced from npm package
|
|
2
2
|
|
|
3
|
-
|
|
4
3
|
const {
|
|
5
4
|
OpsCompassClient,
|
|
6
5
|
ScriptType,
|
|
7
|
-
OAuthHandler
|
|
6
|
+
OAuthHandler,
|
|
8
7
|
} = require("@opscompass/opscompass-api");
|
|
9
8
|
|
|
10
9
|
const path = require("path");
|
|
11
10
|
const { homedir } = require("os");
|
|
12
|
-
const opscompassHome = path.join(homedir(),
|
|
11
|
+
const opscompassHome = path.join(homedir(), ".opscompass");
|
|
13
12
|
const cliCommand = "opscompass";
|
|
14
13
|
|
|
15
14
|
const clientId = "vOakDaOv4L26f3uuI4sp3KC1Sov3nsW2";
|
|
16
15
|
// default authDomain
|
|
17
16
|
// default audience
|
|
18
17
|
const oAuthClient = new OAuthHandler(clientId);
|
|
19
|
-
const isLocal = false
|
|
18
|
+
const isLocal = false;
|
|
20
19
|
|
|
21
20
|
module.exports = {
|
|
22
21
|
OpsCompassClient,
|
|
@@ -24,5 +23,6 @@ module.exports = {
|
|
|
24
23
|
oAuthClient,
|
|
25
24
|
opscompassHome,
|
|
26
25
|
isLocal,
|
|
27
|
-
cliCommand
|
|
26
|
+
cliCommand,
|
|
27
|
+
decoder: "TjFXOWhWdnppb2Zoa2ZFcmd1TWI",
|
|
28
28
|
};
|
package/index.js
CHANGED
|
@@ -27,6 +27,7 @@ function checkDefaults() {
|
|
|
27
27
|
company = defaultParams.company;
|
|
28
28
|
account = defaultParams.account;
|
|
29
29
|
monitoringConfig = defaultParams.monitoringConfiguration;
|
|
30
|
+
valuesMask = defaultParams.maskValues || [];
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* When a callParams object is passed to the API rather than one of the above strings, default values will be used unless explicitly replaced.
|
package/lib/consts.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true,
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
// Resources to check for sensitive attributes
|
|
8
|
+
const resourceTypes = {
|
|
9
|
+
oracle_dbs: "oracle_dbs",
|
|
10
|
+
microsoft_dbs: "microsoft_dbs",
|
|
11
|
+
vcenters: "vcenters",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// Sensitive attributes to be encrypted by default
|
|
15
|
+
const encryptAttrs = {
|
|
16
|
+
username: "username",
|
|
17
|
+
user: "user",
|
|
18
|
+
password: "password",
|
|
19
|
+
connect: "connect",
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
module.exports = {
|
|
23
|
+
encryptAttrs,
|
|
24
|
+
resourceTypes,
|
|
25
|
+
};
|