opal-security 2.0.5 → 2.0.9

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 CHANGED
@@ -22,7 +22,7 @@ $ npm install -g opal-security
22
22
  $ opal COMMAND
23
23
  running command...
24
24
  $ opal (-v|--version|version)
25
- opal-security/2.0.5 darwin-x64 node-v14.16.1
25
+ opal-security/2.0.9 darwin-x64 node-v14.16.1
26
26
  $ opal --help [COMMAND]
27
27
  USAGE
28
28
  $ opal COMMAND
@@ -86,7 +86,7 @@ EXAMPLE
86
86
  opal aws:identity
87
87
  ```
88
88
 
89
- _See code: [src/commands/aws/identity.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/aws/identity.ts)_
89
+ _See code: [src/commands/aws/identity.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/aws/identity.ts)_
90
90
 
91
91
  ## `opal curl-example`
92
92
 
@@ -100,7 +100,7 @@ OPTIONS
100
100
  -h, --help show CLI help
101
101
  ```
102
102
 
103
- _See code: [src/commands/curl-example.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/curl-example.ts)_
103
+ _See code: [src/commands/curl-example.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/curl-example.ts)_
104
104
 
105
105
  ## `opal help [COMMAND]`
106
106
 
@@ -136,7 +136,7 @@ EXAMPLES
136
136
  opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398
137
137
  ```
138
138
 
139
- _See code: [src/commands/iam-roles/start.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/iam-roles/start.ts)_
139
+ _See code: [src/commands/iam-roles/start.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/iam-roles/start.ts)_
140
140
 
141
141
  ## `opal kube-roles:start`
142
142
 
@@ -158,7 +158,7 @@ EXAMPLES
158
158
  "arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role"
159
159
  ```
160
160
 
161
- _See code: [src/commands/kube-roles/start.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/kube-roles/start.ts)_
161
+ _See code: [src/commands/kube-roles/start.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/kube-roles/start.ts)_
162
162
 
163
163
  ## `opal login`
164
164
 
@@ -175,7 +175,7 @@ EXAMPLE
175
175
  $ opal login
176
176
  ```
177
177
 
178
- _See code: [src/commands/login.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/login.ts)_
178
+ _See code: [src/commands/login.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/login.ts)_
179
179
 
180
180
  ## `opal logout`
181
181
 
@@ -192,7 +192,7 @@ EXAMPLE
192
192
  $ opal logout
193
193
  ```
194
194
 
195
- _See code: [src/commands/logout.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/logout.ts)_
195
+ _See code: [src/commands/logout.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/logout.ts)_
196
196
 
197
197
  ## `opal postgres-instances:start`
198
198
 
@@ -213,7 +213,7 @@ EXAMPLES
213
213
  opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId "fullaccess"
214
214
  ```
215
215
 
216
- _See code: [src/commands/postgres-instances/start.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/postgres-instances/start.ts)_
216
+ _See code: [src/commands/postgres-instances/start.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/postgres-instances/start.ts)_
217
217
 
218
218
  ## `opal resources:get`
219
219
 
@@ -231,7 +231,7 @@ EXAMPLE
231
231
  opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4
232
232
  ```
233
233
 
234
- _See code: [src/commands/resources/get.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/resources/get.ts)_
234
+ _See code: [src/commands/resources/get.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/resources/get.ts)_
235
235
 
236
236
  ## `opal set-url`
237
237
 
@@ -254,7 +254,7 @@ EXAMPLE
254
254
  $ opal set-host
255
255
  ```
256
256
 
257
- _See code: [src/commands/set-url.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/set-url.ts)_
257
+ _See code: [src/commands/set-url.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/set-url.ts)_
258
258
 
259
259
  ## `opal ssh:copyFrom`
260
260
 
@@ -280,7 +280,7 @@ EXAMPLES
280
280
  opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
281
281
  ```
282
282
 
283
- _See code: [src/commands/ssh/copyFrom.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/ssh/copyFrom.ts)_
283
+ _See code: [src/commands/ssh/copyFrom.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/ssh/copyFrom.ts)_
284
284
 
285
285
  ## `opal ssh:copyTo`
286
286
 
@@ -306,7 +306,7 @@ EXAMPLES
306
306
  opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398
307
307
  ```
308
308
 
309
- _See code: [src/commands/ssh/copyTo.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/ssh/copyTo.ts)_
309
+ _See code: [src/commands/ssh/copyTo.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/ssh/copyTo.ts)_
310
310
 
311
311
  ## `opal ssh:start`
312
312
 
@@ -325,5 +325,5 @@ EXAMPLES
325
325
  opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398
326
326
  ```
327
327
 
328
- _See code: [src/commands/ssh/start.ts](https://github.com/cli/opal/blob/v2.0.5/src/commands/ssh/start.ts)_
328
+ _See code: [src/commands/ssh/start.ts](https://github.com/cli/opal/blob/v2.0.9/src/commands/ssh/start.ts)_
329
329
  <!-- commandsstop -->
@@ -75,11 +75,12 @@ class StartIAMRoleSession extends command_1.Command {
75
75
  resourceInfos.forEach(resourceInfo => {
76
76
  resourceInfoByName[resourceInfo.name] = resourceInfo;
77
77
  });
78
+ inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
78
79
  const selectedIamRoleInfo = await inquirer.prompt([{
79
80
  name: 'role',
80
81
  message: 'Select an IAM role to assume',
81
- type: 'list',
82
- choices: resourceInfos,
82
+ type: 'autocomplete',
83
+ source: (answers, input) => cmd_1.filterChoices(input, resourceInfos),
83
84
  }]);
84
85
  const selectedIamRole = resourceInfoByName[selectedIamRoleInfo.role];
85
86
  if (!selectedIamRole) {
@@ -5,6 +5,7 @@ const handler_1 = require("../../handler");
5
5
  const cmd_1 = require("../../lib/cmd");
6
6
  const apollo_1 = require("../../lib/apollo");
7
7
  const inquirer = require("inquirer");
8
+ const types_1 = require("../../types");
8
9
  const aws_1 = require("../../lib/aws");
9
10
  const resources_1 = require("../../lib/resources");
10
11
  const StartKubeIAMRoleSessionDocument = `
@@ -39,6 +40,9 @@ query ListKubeIAMRoles {
39
40
  resources {
40
41
  name
41
42
  id
43
+ connection {
44
+ connectionType
45
+ }
42
46
  }
43
47
  cursor
44
48
  }
@@ -60,7 +64,7 @@ class StartKubeIAMRoleSession extends command_1.Command {
60
64
  apollo_1.printRequestOutput(this, kubeIamRolesResp, error);
61
65
  return;
62
66
  }
63
- const resourceInfos = kubeIamRolesResp === null || kubeIamRolesResp === void 0 ? void 0 : kubeIamRolesResp.data.resources.resources.map((resource) => {
67
+ const resourceInfos = kubeIamRolesResp === null || kubeIamRolesResp === void 0 ? void 0 : kubeIamRolesResp.data.resources.resources.filter((resource) => { var _a; return ((_a = resource.connection) === null || _a === void 0 ? void 0 : _a.connectionType) === types_1.ConnectionType.Aws; }).map((resource) => {
64
68
  return {
65
69
  id: resource.id,
66
70
  name: resource.name,
@@ -74,11 +78,12 @@ class StartKubeIAMRoleSession extends command_1.Command {
74
78
  resourceInfos.forEach(resourceInfo => {
75
79
  resourceInfoByName[resourceInfo.name] = resourceInfo;
76
80
  });
81
+ inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
77
82
  const selectedKubeClusterInfo = await inquirer.prompt([{
78
83
  name: 'role',
79
84
  message: 'Select a Kubernetes cluster to connect to',
80
- type: 'list',
81
- choices: resourceInfos,
85
+ type: 'autocomplete',
86
+ source: (answers, input) => cmd_1.filterChoices(input, resourceInfos),
82
87
  }]);
83
88
  const selectedKubeCluster = resourceInfoByName[selectedKubeClusterInfo.role];
84
89
  if (!selectedKubeCluster) {
@@ -74,11 +74,12 @@ class StartPostgresInstanceSession extends command_1.Command {
74
74
  resourceInfos.forEach(resourceInfo => {
75
75
  resourceInfoByName[resourceInfo.name] = resourceInfo;
76
76
  });
77
+ inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
77
78
  const selectedInstanceInfo = await inquirer.prompt([{
78
79
  name: 'instance',
79
80
  message: 'Select a Postgres RDS instance to login to',
80
- type: 'list',
81
- choices: resourceInfos,
81
+ type: 'autocomplete',
82
+ source: (answers, input) => cmd_1.filterChoices(input, resourceInfos),
82
83
  }]);
83
84
  const selectedInstance = resourceInfoByName[selectedInstanceInfo.instance];
84
85
  if (!selectedInstance) {
@@ -1,5 +1,5 @@
1
1
  import { Command, flags } from '@oclif/command';
2
- export declare const GetResourceDocument = "\nquery GetResource($id: ResourceId!) {\n resource(input: {id: $id}) {\n __typename\n ... on ResourceResult {\n resource {\n name\n id\n description\n ownerTeam {\n name\n id\n }\n connection {\n name\n id\n }\n resourceUsers {\n user {\n email\n }\n }\n access {\n status\n expiration\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n}";
2
+ export declare const GetResourceDocument = "\nquery GetResource($id: ResourceId!) {\n resource(input: {id: $id}) {\n __typename\n ... on ResourceResult {\n resource {\n name\n id\n description\n ownerTeam {\n name\n id\n }\n connection {\n name\n id\n }\n resourceUsers {\n user {\n email\n }\n }\n }\n }\n ... on ResourceNotFoundError {\n message\n }\n }\n}";
3
3
  export default class GetResource extends Command {
4
4
  static description: string;
5
5
  static examples: string[];
@@ -26,10 +26,6 @@ query GetResource($id: ResourceId!) {
26
26
  email
27
27
  }
28
28
  }
29
- access {
30
- status
31
- expiration
32
- }
33
29
  }
34
30
  }
35
31
  ... on ResourceNotFoundError {
package/lib/lib/apollo.js CHANGED
@@ -44,15 +44,15 @@ exports.initClient = async (command) => {
44
44
  const headers = (_a = operation.getContext().response) === null || _a === void 0 ? void 0 : _a.headers;
45
45
  if (headers) {
46
46
  const expectedCLIMajorVersion = headers.get('Opal-CLI-Expected-Major-Version');
47
- // defaults to version 1 since old Opal version won't have an advertised expected client version
48
- const semvarExpectedMinCLIVersion = `${expectedCLIMajorVersion || '1'}.0.0`;
49
- if (semver_1.major(currentCLIVersion) < semver_1.major(semvarExpectedMinCLIVersion)) {
50
- command.warn(chalk_1.default.yellow(`❗️ Update your CLI to match the compatible version. Expected major version ${chalk_1.default.blueBright(semvarExpectedMinCLIVersion)}, but version ${chalk_1.default.blueBright(currentCLIVersion)} is installed.
51
-
52
- Upgrade using the following command: ${chalk_1.default.blueBright('brew upgrade opalsecurity/brew/opal-security')}`));
53
- }
54
- else if (semver_1.major(currentCLIVersion) > semver_1.major(semvarExpectedMinCLIVersion)) {
55
- command.warn(chalk_1.default.yellow('❗️ Uh oh! The currently installed Opal server is outdated. Please contact your Opal admins to let them know they need to upgrade their deployment.'));
47
+ if (expectedCLIMajorVersion) {
48
+ const semvarExpectedMinCLIVersion = `${expectedCLIMajorVersion}.0.0`;
49
+ if (semver_1.major(currentCLIVersion) < semver_1.major(semvarExpectedMinCLIVersion)) {
50
+ command.warn(chalk_1.default.yellow(`❗️ Update your CLI to match the compatible version. Expected major version ${chalk_1.default.blueBright(semvarExpectedMinCLIVersion)}, but version ${chalk_1.default.blueBright(currentCLIVersion)} is installed.
51
+ Upgrade using the following command: ${chalk_1.default.blueBright('brew upgrade opalsecurity/brew/opal-security')}`));
52
+ }
53
+ else if (semver_1.major(currentCLIVersion) > semver_1.major(semvarExpectedMinCLIVersion)) {
54
+ command.warn(chalk_1.default.yellow('❗️ Uh oh! The currently installed Opal server is outdated. Please contact your Opal admins to let them know they need to upgrade their deployment.'));
55
+ }
56
56
  }
57
57
  }
58
58
  };
@@ -63,8 +63,16 @@ exports.initClient = async (command) => {
63
63
  });
64
64
  });
65
65
  const errorLink = error_1.onError(({ networkError, operation }) => {
66
+ var _a, _b;
66
67
  checkCLIVersion(operation);
67
68
  if (networkError && 'statusCode' in networkError) {
69
+ let errorMessage = null;
70
+ if ('result' in networkError) {
71
+ const errors = (_a = networkError === null || networkError === void 0 ? void 0 : networkError.result) === null || _a === void 0 ? void 0 : _a.errors;
72
+ if (errors && errors.length > 0) {
73
+ errorMessage = (_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message;
74
+ }
75
+ }
68
76
  switch (networkError.statusCode) {
69
77
  case 401: {
70
78
  command.log('Your session is invalid or expired. Authenticating now...\n');
@@ -80,7 +88,7 @@ exports.initClient = async (command) => {
80
88
  break;
81
89
  }
82
90
  default:
83
- command.log(`❗ Error: received status code ${networkError.statusCode} from server`);
91
+ command.log(`❗ Error: received status code ${networkError.statusCode} from server${errorMessage ? ` with message "${errorMessage}"` : ''}`);
84
92
  }
85
93
  }
86
94
  });
package/lib/lib/cmd.d.ts CHANGED
@@ -19,3 +19,4 @@ export declare const startInteractiveShell: (runCmd: string, shellName?: string
19
19
  export declare const runCommandExec: (runCmd: string, successMessage: string, errorMessage: string, envVars?: Record<string, any> | undefined) => void;
20
20
  export declare const runCommandExecWithCallback: (cmd: string, callback?: ((error: ExecException | null, stdout: Buffer, stderr: Buffer) => void) | undefined) => Promise<unknown>;
21
21
  export declare const runCommandSpawn: (runCmd: string, successMessage: string, errorMessage: string, envVars?: Record<string, any> | undefined) => void;
22
+ export declare const filterChoices: (input: string, choices: ResourceInfo[] | AccessLevelInfo[]) => ResourceInfo[];
package/lib/lib/cmd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommandSpawn = exports.runCommandExecWithCallback = exports.runCommandExec = exports.startInteractiveShell = exports.setMostRecentCommand = exports.mostRecentCommandTime = exports.mostRecentCommand = exports.DEFAULT_ACCESS_LEVEL = void 0;
3
+ exports.filterChoices = exports.runCommandSpawn = exports.runCommandExecWithCallback = exports.runCommandExec = exports.startInteractiveShell = exports.setMostRecentCommand = exports.mostRecentCommandTime = exports.mostRecentCommand = exports.DEFAULT_ACCESS_LEVEL = void 0;
4
4
  const _ = require("lodash");
5
5
  const moment = require("moment");
6
6
  const { exec, spawn } = require('child_process');
@@ -83,3 +83,11 @@ exports.runCommandSpawn = (runCmd, successMessage, errorMessage, envVars) => {
83
83
  }
84
84
  });
85
85
  };
86
+ // Returns a filtered array of items that match the input
87
+ exports.filterChoices = (input, choices) => {
88
+ input = input || '';
89
+ if (input === '') {
90
+ return choices;
91
+ }
92
+ return choices.filter(choice => choice.name.toLowerCase().includes(input.toLowerCase()));
93
+ };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.promptUserForAccessLevels = exports.unexpectedAmountOfAccessLevelsFound = exports.resourcesAreEmpty = void 0;
4
+ const cmd_1 = require("./cmd");
4
5
  const handler_1 = require("../handler");
5
6
  const apollo_1 = require("./apollo");
6
7
  const inquirer = require("inquirer");
@@ -54,11 +55,12 @@ exports.promptUserForAccessLevels = async (context, resourceId, instanceType, ac
54
55
  selectedAccessLevel = accessLevelInfoByRemoteId[accessLevelRemoteId];
55
56
  }
56
57
  if (!selectedAccessLevel) {
58
+ inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
57
59
  const selectedAccessLevelInfo = await inquirer.prompt([{
58
60
  name: 'accessLevel',
59
61
  message: `Select an access level to the ${instanceType}`,
60
- type: 'list',
61
- choices: accessLevelInfos,
62
+ type: 'autocomplete',
63
+ source: (answers, input) => cmd_1.filterChoices(input, accessLevelInfos),
62
64
  }]);
63
65
  selectedAccessLevel = accessLevelInfoByName[selectedAccessLevelInfo.accessLevel];
64
66
  }
package/lib/lib/ssh.js CHANGED
@@ -43,11 +43,12 @@ exports.selectComputeInstance = async (command, description) => {
43
43
  resourceInfos.forEach(resourceInfo => {
44
44
  resourceInfoByName[resourceInfo.name] = resourceInfo;
45
45
  });
46
+ inquirer.registerPrompt('autocomplete', require('inquirer-autocomplete-prompt'));
46
47
  const selectedInstanceInfo = await inquirer.prompt([{
47
48
  name: 'instance',
48
49
  message: `Select a compute instance to ${description}`,
49
- type: 'list',
50
- choices: resourceInfos,
50
+ type: 'autocomplete',
51
+ source: (answers, input) => cmd_1.filterChoices(input, resourceInfos),
51
52
  }]);
52
53
  return resourceInfoByName[selectedInstanceInfo.instance];
53
54
  };
@@ -1 +1 @@
1
- {"version":"2.0.5","commands":{"curl-example":{"id":"curl-example","description":"Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.","pluginName":"opal-security","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Authenticates you with the Opal server.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal login"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"logout":{"id":"logout","description":"Clears locally stored Opal server authentication credentials.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal logout"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"set-url":{"id":"set-url","description":"Sets the url of the Opal server. Defaults to https://app.opal.dev.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal set-host"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"custom":{"name":"custom","type":"option"},"allowSelfSignedCerts":{"name":"allowSelfSignedCerts","type":"boolean","allowNo":false},"prod":{"name":"prod","type":"boolean","allowNo":false},"demo":{"name":"demo","type":"boolean","allowNo":false},"dev":{"name":"dev","type":"boolean","allowNo":false},"devLocal":{"name":"devLocal","type":"boolean","allowNo":false}},"args":[]},"aws:identity":{"id":"aws:identity","description":"Gets the current caller identity for the \"opal\" AWS profile.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal aws:identity"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"iam-roles:start":{"id":"iam-roles:start","description":"Starts a session to assume an IAM role.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal iam-roles:start","opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal role resource."}},"args":[]},"kube-roles:start":{"id":"kube-roles:start","description":"Starts a session to assume a Kubernetes cluster IAM role.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal kube-roles:start","opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398","opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId \"arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role\""],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal role resource."},"accessLevelRemoteId":{"name":"accessLevelRemoteId","type":"option","description":"The remote ID of the access level with which to access the cluster."}},"args":[]},"postgres-instances:start":{"id":"postgres-instances:start","description":"Starts a session to query a Postgres database.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal postgres-instances:start","opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398","opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId \"fullaccess\""],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."},"accessLevelRemoteId":{"name":"accessLevelRemoteId","type":"option","description":"The remote ID of the access level with which to access the database."}},"args":[]},"resources:get":{"id":"resources:get","description":"Get resource info for a particular resource.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","required":true}},"args":[]},"ssh:copyFrom":{"id":"ssh:copyFrom","description":"Use SCP to copy files from a compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:copyFrom --src instance/dir --dest my/dir","opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"src":{"name":"src","type":"option","description":"The path of the directory or file you would like to copy over SCP. Note we only support one file or directory at a time.","required":true},"dest":{"name":"dest","type":"option","description":"Pick which directory you want your files to be copied to.","required":false,"default":"."},"user":{"name":"user","type":"option","description":"Pick which user you want to run SCP over. Keep in mind not all users will have access to each other's home directory.","required":false,"default":"ssm-user"},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]},"ssh:copyTo":{"id":"ssh:copyTo","description":"Use SCP to copy files to a compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:copyTo --src my/dir --dest instance/dir","opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"src":{"name":"src","type":"option","description":"The path of the directory or file you would like to copy over SCP. Note we only support one file or directory at a time.","required":true},"dest":{"name":"dest","type":"option","description":"Pick which directory you want your files to be copied to.","required":false,"default":"."},"user":{"name":"user","type":"option","description":"Pick which user you want to run SCP over. Keep in mind not all users will have access to each other's home directory.","required":false,"default":"ssm-user"},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]},"ssh:start":{"id":"ssh:start","description":"Start an SSH session to access a particular compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:start","opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]}}}
1
+ {"version":"2.0.9","commands":{"curl-example":{"id":"curl-example","description":"Prints out an example cURL command containing the parameters the CLI uses to query the Opal server.","pluginName":"opal-security","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Authenticates you with the Opal server.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal login"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"logout":{"id":"logout","description":"Clears locally stored Opal server authentication credentials.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal logout"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"set-url":{"id":"set-url","description":"Sets the url of the Opal server. Defaults to https://app.opal.dev.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["$ opal set-host"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"custom":{"name":"custom","type":"option"},"allowSelfSignedCerts":{"name":"allowSelfSignedCerts","type":"boolean","allowNo":false},"prod":{"name":"prod","type":"boolean","allowNo":false},"demo":{"name":"demo","type":"boolean","allowNo":false},"dev":{"name":"dev","type":"boolean","allowNo":false},"devLocal":{"name":"devLocal","type":"boolean","allowNo":false}},"args":[]},"aws:identity":{"id":"aws:identity","description":"Gets the current caller identity for the \"opal\" AWS profile.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal aws:identity"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"iam-roles:start":{"id":"iam-roles:start","description":"Starts a session to assume an IAM role.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal iam-roles:start","opal iam-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal role resource."}},"args":[]},"kube-roles:start":{"id":"kube-roles:start","description":"Starts a session to assume a Kubernetes cluster IAM role.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal kube-roles:start","opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398","opal kube-roles:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId \"arn:aws:iam::712234975475:role/acme-eks-cluster-admin-role\""],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal role resource."},"accessLevelRemoteId":{"name":"accessLevelRemoteId","type":"option","description":"The remote ID of the access level with which to access the cluster."}},"args":[]},"postgres-instances:start":{"id":"postgres-instances:start","description":"Starts a session to query a Postgres database.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal postgres-instances:start","opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398","opal postgres-instances:start --id 51f7176b-0464-4a6f-8369-e951e187b398 --accessLevelRemoteId \"fullaccess\""],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."},"accessLevelRemoteId":{"name":"accessLevelRemoteId","type":"option","description":"The remote ID of the access level with which to access the database."}},"args":[]},"resources:get":{"id":"resources:get","description":"Get resource info for a particular resource.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal resources:get --id 54052a3e-5375-4392-aeaf-0c6c44c131d4"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","required":true}},"args":[]},"ssh:copyFrom":{"id":"ssh:copyFrom","description":"Use SCP to copy files from a compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:copyFrom --src instance/dir --dest my/dir","opal ssh:copyFrom --src instance/dir --dest my/dir --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"src":{"name":"src","type":"option","description":"The path of the directory or file you would like to copy over SCP. Note we only support one file or directory at a time.","required":true},"dest":{"name":"dest","type":"option","description":"Pick which directory you want your files to be copied to.","required":false,"default":"."},"user":{"name":"user","type":"option","description":"Pick which user you want to run SCP over. Keep in mind not all users will have access to each other's home directory.","required":false,"default":"ssm-user"},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]},"ssh:copyTo":{"id":"ssh:copyTo","description":"Use SCP to copy files to a compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:copyTo --src my/dir --dest instance/dir","opal ssh:copyTo --src my/dir --dest instance/dir --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"src":{"name":"src","type":"option","description":"The path of the directory or file you would like to copy over SCP. Note we only support one file or directory at a time.","required":true},"dest":{"name":"dest","type":"option","description":"Pick which directory you want your files to be copied to.","required":false,"default":"."},"user":{"name":"user","type":"option","description":"Pick which user you want to run SCP over. Keep in mind not all users will have access to each other's home directory.","required":false,"default":"ssm-user"},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]},"ssh:start":{"id":"ssh:start","description":"Start an SSH session to access a particular compute instance.","pluginName":"opal-security","pluginType":"core","aliases":[],"examples":["opal ssh:start","opal ssh:start --id 51f7176b-0464-4a6f-8369-e951e187b398"],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"id":{"name":"id","type":"option","description":"The ID of the Opal instance resource."}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "opal-security",
3
3
  "description": "Opal allows you to centrally manage access to all of your sensitive systems.",
4
- "version": "2.0.5",
4
+ "version": "2.0.9",
5
5
  "author": "Stephen Cobbe",
6
6
  "bin": {
7
7
  "opal": "./bin/run"
@@ -21,6 +21,7 @@
21
21
  "@types/prettyjson": "0.0.29",
22
22
  "chalk": "^2.4.2",
23
23
  "graphql": "^15.5.0",
24
+ "inquirer-autocomplete-prompt": "^1.4.0",
24
25
  "keytar": "^7.7.0",
25
26
  "lodash": "^4.17.21",
26
27
  "node-fetch": "^2.6.1",