opal-security 3.0.0 → 3.0.1-beta.4f1a7ce
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 +59 -44
- package/bin/run +1 -1
- package/lib/commands/aws/identity.d.ts +1 -1
- package/lib/commands/aws/identity.js +2 -2
- package/lib/commands/clear-auth-provider.d.ts +1 -1
- package/lib/commands/clear-auth-provider.js +3 -3
- package/lib/commands/curl-example.d.ts +1 -1
- package/lib/commands/curl-example.js +2 -2
- package/lib/commands/iam-roles/start.d.ts +1 -1
- package/lib/commands/iam-roles/start.js +14 -14
- package/lib/commands/kube-roles/start.d.ts +1 -1
- package/lib/commands/kube-roles/start.js +10 -10
- package/lib/commands/login.d.ts +1 -1
- package/lib/commands/login.js +71 -63
- package/lib/commands/logout.d.ts +1 -1
- package/lib/commands/logout.js +3 -3
- package/lib/commands/postgres-instances/start.d.ts +1 -1
- package/lib/commands/postgres-instances/start.js +35 -34
- package/lib/commands/request/create.d.ts +6 -0
- package/lib/commands/request/create.js +37 -0
- package/lib/commands/request/get.d.ts +6 -0
- package/lib/commands/request/get.js +13 -0
- package/lib/commands/request/list.d.ts +7 -0
- package/lib/commands/request/list.js +14 -0
- package/lib/commands/resources/get.d.ts +1 -1
- package/lib/commands/resources/get.js +11 -4
- package/lib/commands/set-auth-provider.d.ts +1 -1
- package/lib/commands/set-auth-provider.js +6 -4
- package/lib/commands/set-custom-header.d.ts +1 -1
- package/lib/commands/set-custom-header.js +5 -3
- package/lib/commands/set-token.d.ts +1 -1
- package/lib/commands/set-token.js +26 -19
- package/lib/commands/set-url.d.ts +1 -1
- package/lib/commands/set-url.js +13 -12
- package/lib/commands/ssh/copyFrom.d.ts +1 -1
- package/lib/commands/ssh/copyFrom.js +13 -13
- package/lib/commands/ssh/copyTo.d.ts +1 -1
- package/lib/commands/ssh/copyTo.js +13 -13
- package/lib/commands/ssh/start.d.ts +1 -1
- package/lib/commands/ssh/start.js +14 -15
- package/lib/graphql/fragment-masking.d.ts +19 -0
- package/lib/graphql/fragment-masking.js +21 -0
- package/lib/graphql/gql.d.ts +46 -0
- package/lib/graphql/gql.js +14 -0
- package/lib/graphql/graphql.d.ts +11476 -0
- package/lib/graphql/graphql.js +1819 -0
- package/lib/graphql/index.d.ts +2 -0
- package/lib/graphql/index.js +5 -0
- package/lib/handler.d.ts +5 -5
- package/lib/handler.js +7 -7
- package/lib/index.d.ts +1 -1
- package/lib/lib/apollo.d.ts +3 -2
- package/lib/lib/apollo.js +59 -46
- package/lib/lib/aws.js +15 -12
- package/lib/lib/cmd.d.ts +4 -6
- package/lib/lib/cmd.js +11 -11
- package/lib/lib/config.js +14 -14
- package/lib/lib/credentials/index.d.ts +1 -1
- package/lib/lib/credentials/index.js +6 -6
- package/lib/lib/credentials/keychain.js +5 -5
- package/lib/lib/credentials/localEncryption.d.ts +2 -2
- package/lib/lib/credentials/localEncryption.js +33 -24
- package/lib/lib/flags.js +9 -9
- package/lib/lib/requests.d.ts +22 -0
- package/lib/lib/requests.js +274 -0
- package/lib/lib/resources.d.ts +2 -2
- package/lib/lib/resources.js +29 -23
- package/lib/lib/sessions.d.ts +2 -2
- package/lib/lib/sessions.js +18 -17
- package/lib/lib/ssh.d.ts +1 -1
- package/lib/lib/ssh.js +8 -8
- package/lib/lib/util.d.ts +0 -1
- package/lib/lib/util.js +13 -13
- package/lib/types.d.ts +1787 -1787
- package/lib/utils/displays.d.ts +5 -0
- package/lib/utils/displays.js +65 -0
- package/lib/utils/utils.d.ts +1 -0
- package/lib/utils/utils.js +18 -0
- package/oclif.manifest.json +70 -3
- package/package.json +25 -29
package/lib/lib/ssh.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Command } from
|
|
1
|
+
import type { Command } from "@oclif/core";
|
|
2
2
|
export declare const selectComputeInstance: (command: Command, action: string) => Promise<void | import("./resources").ResourceInfo>;
|
|
3
3
|
export declare const assertSessionManagerPluginExists: () => Promise<boolean>;
|
package/lib/lib/ssh.js
CHANGED
|
@@ -4,18 +4,18 @@ exports.assertSessionManagerPluginExists = exports.selectComputeInstance = void
|
|
|
4
4
|
const cmd_1 = require("../lib/cmd");
|
|
5
5
|
const resources_1 = require("./resources");
|
|
6
6
|
const selectComputeInstance = async (command, action) => {
|
|
7
|
-
return (0, resources_1.promptUserForResource)(command,
|
|
7
|
+
return (0, resources_1.promptUserForResource)(command, "AWS_EC2_INSTANCE", `Select an EC2 instance to ${action}`);
|
|
8
8
|
};
|
|
9
9
|
exports.selectComputeInstance = selectComputeInstance;
|
|
10
10
|
const assertSessionManagerPluginExists = async () => {
|
|
11
|
-
const errorMessage =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let checkPluginCommand =
|
|
15
|
-
if (process.platform ===
|
|
16
|
-
checkPluginCommand =
|
|
11
|
+
const errorMessage = "❗ AWS session manager plugin is required to use SSH functionality. " +
|
|
12
|
+
"Please install it then retry your command. Installation instructions can be found at " +
|
|
13
|
+
"https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html.";
|
|
14
|
+
let checkPluginCommand = "command -v session-manager-plugin";
|
|
15
|
+
if (process.platform === "win32")
|
|
16
|
+
checkPluginCommand = "where session-manager-plugin";
|
|
17
17
|
try {
|
|
18
|
-
const stdOut = await (0, cmd_1.runCommandExecWithCallback)(checkPluginCommand,
|
|
18
|
+
const stdOut = await (0, cmd_1.runCommandExecWithCallback)(checkPluginCommand, (error, stdOut, stdErr) => {
|
|
19
19
|
// Error if there's no output, meaning the plugin is not installed
|
|
20
20
|
if (!stdOut) {
|
|
21
21
|
console.log(errorMessage);
|
package/lib/lib/util.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
3
2
|
export declare const copyToClipboard: (content: string) => import("child_process").ChildProcess;
|
|
4
3
|
export declare const displayContent: (content: string) => import("child_process").ChildProcess;
|
package/lib/lib/util.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.displayContent = exports.copyToClipboard = exports.sleep = void 0;
|
|
4
|
-
const
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
5
|
const sleep = (ms) => {
|
|
6
|
-
return new Promise(resolve => {
|
|
6
|
+
return new Promise((resolve) => {
|
|
7
7
|
setTimeout(resolve, ms);
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
exports.sleep = sleep;
|
|
11
11
|
const getCopyCommand = () => {
|
|
12
12
|
switch (process.platform) {
|
|
13
|
-
case
|
|
14
|
-
return
|
|
15
|
-
case
|
|
16
|
-
return
|
|
13
|
+
case "darwin":
|
|
14
|
+
return "pbcopy";
|
|
15
|
+
case "win32":
|
|
16
|
+
return "clip";
|
|
17
17
|
default:
|
|
18
|
-
return
|
|
18
|
+
return "xclip -selection clipboard";
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
const copyToClipboard = (content) => {
|
|
22
22
|
const copyCommand = getCopyCommand();
|
|
23
|
-
return (0,
|
|
23
|
+
return (0, node_child_process_1.exec)(`echo "${content}" | ${copyCommand}`);
|
|
24
24
|
};
|
|
25
25
|
exports.copyToClipboard = copyToClipboard;
|
|
26
26
|
const getDisplayCommand = () => {
|
|
27
27
|
switch (process.platform) {
|
|
28
|
-
case
|
|
29
|
-
return
|
|
28
|
+
case "win32":
|
|
29
|
+
return "more";
|
|
30
30
|
default:
|
|
31
|
-
return
|
|
31
|
+
return "less";
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const displayContent = (content) => {
|
|
35
35
|
const displayCommand = getDisplayCommand();
|
|
36
|
-
return (0,
|
|
37
|
-
stdio:
|
|
36
|
+
return (0, node_child_process_1.spawn)(`cat <<< "${content}" | ${displayCommand}`, {
|
|
37
|
+
stdio: "inherit",
|
|
38
38
|
shell: true,
|
|
39
39
|
});
|
|
40
40
|
};
|