@heroku-cli/plugin-mtls 0.6.0 → 0.8.1

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
@@ -20,7 +20,7 @@ $ npm install -g @heroku-cli/plugin-mtls
20
20
  $ heroku COMMAND
21
21
  running command...
22
22
  $ heroku (-v|--version|version)
23
- @heroku-cli/plugin-mtls/0.6.0 darwin-x64 node-v10.16.0
23
+ @heroku-cli/plugin-mtls/0.8.1 darwin-x64 node-v14.18.0
24
24
  $ heroku --help [COMMAND]
25
25
  USAGE
26
26
  $ heroku COMMAND
@@ -29,26 +29,26 @@ USAGE
29
29
  <!-- usagestop -->
30
30
  # Commands
31
31
  <!-- commands -->
32
- * [`heroku data:mtls [DATABASE]`](#heroku-datamtls-database)
33
- * [`heroku data:mtls:certificates [DATABASE]`](#heroku-datamtlscertificates-database)
34
- * [`heroku data:mtls:certificates:create [DATABASE]`](#heroku-datamtlscertificatescreate-database)
35
- * [`heroku data:mtls:certificates:delete [DATABASE]`](#heroku-datamtlscertificatesdelete-database)
36
- * [`heroku data:mtls:certificates:download [DATABASE]`](#heroku-datamtlscertificatesdownload-database)
37
- * [`heroku data:mtls:certificates:get [DATABASE]`](#heroku-datamtlscertificatesget-database)
38
- * [`heroku data:mtls:create [DATABASE]`](#heroku-datamtlscreate-database)
39
- * [`heroku data:mtls:destroy [DATABASE]`](#heroku-datamtlsdestroy-database)
40
- * [`heroku data:mtls:ip-rules [DATABASE]`](#heroku-datamtlsip-rules-database)
41
- * [`heroku data:mtls:ip-rules:create [DATABASE]`](#heroku-datamtlsip-rulescreate-database)
42
- * [`heroku data:mtls:ip-rules:delete [DATABASE]`](#heroku-datamtlsip-rulesdelete-database)
43
- * [`heroku data:mtls:ip-rules:get [DATABASE]`](#heroku-datamtlsip-rulesget-database)
44
-
45
- ## `heroku data:mtls [DATABASE]`
46
-
47
- get the status of MTLS for your database
32
+ * [`heroku data:mtls [ADDON]`](#heroku-datamtls-addon)
33
+ * [`heroku data:mtls:certificates [ADDON]`](#heroku-datamtlscertificates-addon)
34
+ * [`heroku data:mtls:certificates:create [ADDON]`](#heroku-datamtlscertificatescreate-addon)
35
+ * [`heroku data:mtls:certificates:delete [ADDON]`](#heroku-datamtlscertificatesdelete-addon)
36
+ * [`heroku data:mtls:certificates:download [ADDON]`](#heroku-datamtlscertificatesdownload-addon)
37
+ * [`heroku data:mtls:certificates:get [ADDON]`](#heroku-datamtlscertificatesget-addon)
38
+ * [`heroku data:mtls:create [ADDON]`](#heroku-datamtlscreate-addon)
39
+ * [`heroku data:mtls:destroy [ADDON]`](#heroku-datamtlsdestroy-addon)
40
+ * [`heroku data:mtls:ip-rules [ADDON]`](#heroku-datamtlsip-rules-addon)
41
+ * [`heroku data:mtls:ip-rules:create [ADDON]`](#heroku-datamtlsip-rulescreate-addon)
42
+ * [`heroku data:mtls:ip-rules:delete [ADDON]`](#heroku-datamtlsip-rulesdelete-addon)
43
+ * [`heroku data:mtls:ip-rules:get [ADDON]`](#heroku-datamtlsip-rulesget-addon)
44
+
45
+ ## `heroku data:mtls [ADDON]`
46
+
47
+ get the status of MTLS for your addon
48
48
 
49
49
  ```
50
50
  USAGE
51
- $ heroku data:mtls [DATABASE]
51
+ $ heroku data:mtls [ADDON]
52
52
 
53
53
  OPTIONS
54
54
  -a, --app=app (required) app to run command against
@@ -57,15 +57,15 @@ EXAMPLE
57
57
  $ heroku data:mtls postgresql-sushi-12345
58
58
  ```
59
59
 
60
- _See code: [src/commands/data/mtls/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/index.ts)_
60
+ _See code: [src/commands/data/mtls/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/index.ts)_
61
61
 
62
- ## `heroku data:mtls:certificates [DATABASE]`
62
+ ## `heroku data:mtls:certificates [ADDON]`
63
63
 
64
- get the certificates for your MTLS enabled database
64
+ get the certificates for your MTLS enabled addon
65
65
 
66
66
  ```
67
67
  USAGE
68
- $ heroku data:mtls:certificates [DATABASE]
68
+ $ heroku data:mtls:certificates [ADDON]
69
69
 
70
70
  OPTIONS
71
71
  -a, --app=app (required) app to run command against
@@ -74,15 +74,15 @@ EXAMPLE
74
74
  $ heroku data:mtls:ip-rules postgresql-sushi-12345
75
75
  ```
76
76
 
77
- _See code: [src/commands/data/mtls/certificates/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/certificates/index.ts)_
77
+ _See code: [src/commands/data/mtls/certificates/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/certificates/index.ts)_
78
78
 
79
- ## `heroku data:mtls:certificates:create [DATABASE]`
79
+ ## `heroku data:mtls:certificates:create [ADDON]`
80
80
 
81
- create a new certificate for your MTLS enabled database
81
+ create a new certificate for your MTLS enabled addon
82
82
 
83
83
  ```
84
84
  USAGE
85
- $ heroku data:mtls:certificates:create [DATABASE]
85
+ $ heroku data:mtls:certificates:create [ADDON]
86
86
 
87
87
  OPTIONS
88
88
  -a, --app=app (required) app to run command against
@@ -91,15 +91,15 @@ EXAMPLE
91
91
  $ heroku data:mtls:certificates:create postgresql-sushi-12345
92
92
  ```
93
93
 
94
- _See code: [src/commands/data/mtls/certificates/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/certificates/create.ts)_
94
+ _See code: [src/commands/data/mtls/certificates/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/certificates/create.ts)_
95
95
 
96
- ## `heroku data:mtls:certificates:delete [DATABASE]`
96
+ ## `heroku data:mtls:certificates:delete [ADDON]`
97
97
 
98
- delete a specific certificate for your MTLS enabled database
98
+ delete a specific certificate for your MTLS enabled addon
99
99
 
100
100
  ```
101
101
  USAGE
102
- $ heroku data:mtls:certificates:delete [DATABASE]
102
+ $ heroku data:mtls:certificates:delete [ADDON]
103
103
 
104
104
  OPTIONS
105
105
  -a, --app=app (required) app to run command against
@@ -109,15 +109,15 @@ EXAMPLE
109
109
  $ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
110
110
  ```
111
111
 
112
- _See code: [src/commands/data/mtls/certificates/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/certificates/delete.ts)_
112
+ _See code: [src/commands/data/mtls/certificates/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/certificates/delete.ts)_
113
113
 
114
- ## `heroku data:mtls:certificates:download [DATABASE]`
114
+ ## `heroku data:mtls:certificates:download [ADDON]`
115
115
 
116
- download your certificate bundle for your mTLS database
116
+ download your certificate bundle for your mTLS addon
117
117
 
118
118
  ```
119
119
  USAGE
120
- $ heroku data:mtls:certificates:download [DATABASE]
120
+ $ heroku data:mtls:certificates:download [ADDON]
121
121
 
122
122
  OPTIONS
123
123
  -a, --app=app (required) app to run command against
@@ -133,15 +133,15 @@ EXAMPLES
133
133
  "prefix_"
134
134
  ```
135
135
 
136
- _See code: [src/commands/data/mtls/certificates/download.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/certificates/download.ts)_
136
+ _See code: [src/commands/data/mtls/certificates/download.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/certificates/download.ts)_
137
137
 
138
- ## `heroku data:mtls:certificates:get [DATABASE]`
138
+ ## `heroku data:mtls:certificates:get [ADDON]`
139
139
 
140
- get a specific certificate for your MTLS enabled database
140
+ get a specific certificate for your MTLS enabled addon
141
141
 
142
142
  ```
143
143
  USAGE
144
- $ heroku data:mtls:certificates:get [DATABASE]
144
+ $ heroku data:mtls:certificates:get [ADDON]
145
145
 
146
146
  OPTIONS
147
147
  -a, --app=app (required) app to run command against
@@ -151,15 +151,15 @@ EXAMPLE
151
151
  $ heroku data:mtls:certificates:create postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
152
152
  ```
153
153
 
154
- _See code: [src/commands/data/mtls/certificates/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/certificates/get.ts)_
154
+ _See code: [src/commands/data/mtls/certificates/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/certificates/get.ts)_
155
155
 
156
- ## `heroku data:mtls:create [DATABASE]`
156
+ ## `heroku data:mtls:create [ADDON]`
157
157
 
158
- enable MTLS for your database
158
+ enable MTLS for your addon
159
159
 
160
160
  ```
161
161
  USAGE
162
- $ heroku data:mtls:create [DATABASE]
162
+ $ heroku data:mtls:create [ADDON]
163
163
 
164
164
  OPTIONS
165
165
  -a, --app=app (required) app to run command against
@@ -168,15 +168,15 @@ EXAMPLE
168
168
  $ heroku data:mtls:create postgresql-sushi-12345
169
169
  ```
170
170
 
171
- _See code: [src/commands/data/mtls/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/create.ts)_
171
+ _See code: [src/commands/data/mtls/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/create.ts)_
172
172
 
173
- ## `heroku data:mtls:destroy [DATABASE]`
173
+ ## `heroku data:mtls:destroy [ADDON]`
174
174
 
175
- destroy MTLS configuration on your database
175
+ destroy MTLS configuration on your addon
176
176
 
177
177
  ```
178
178
  USAGE
179
- $ heroku data:mtls:destroy [DATABASE]
179
+ $ heroku data:mtls:destroy [ADDON]
180
180
 
181
181
  OPTIONS
182
182
  -a, --app=app (required) app to run command against
@@ -188,15 +188,15 @@ EXAMPLE
188
188
  $ heroku data:mtls:destroy postgresql-sushi-12345
189
189
  ```
190
190
 
191
- _See code: [src/commands/data/mtls/destroy.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/destroy.ts)_
191
+ _See code: [src/commands/data/mtls/destroy.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/destroy.ts)_
192
192
 
193
- ## `heroku data:mtls:ip-rules [DATABASE]`
193
+ ## `heroku data:mtls:ip-rules [ADDON]`
194
194
 
195
- get the IP Rules for your MTLS enabled database
195
+ get the IP Rules for your MTLS enabled addon
196
196
 
197
197
  ```
198
198
  USAGE
199
- $ heroku data:mtls:ip-rules [DATABASE]
199
+ $ heroku data:mtls:ip-rules [ADDON]
200
200
 
201
201
  OPTIONS
202
202
  -a, --app=app (required) app to run command against
@@ -205,15 +205,15 @@ EXAMPLE
205
205
  $ heroku data:mtls:ip-rules postgresql-sushi-12345
206
206
  ```
207
207
 
208
- _See code: [src/commands/data/mtls/ip-rules/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/ip-rules/index.ts)_
208
+ _See code: [src/commands/data/mtls/ip-rules/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/ip-rules/index.ts)_
209
209
 
210
- ## `heroku data:mtls:ip-rules:create [DATABASE]`
210
+ ## `heroku data:mtls:ip-rules:create [ADDON]`
211
211
 
212
- get the IP Rules for your MTLS enabled database
212
+ create an IP Rule for your MTLS enabled addon
213
213
 
214
214
  ```
215
215
  USAGE
216
- $ heroku data:mtls:ip-rules:create [DATABASE]
216
+ $ heroku data:mtls:ip-rules:create [ADDON]
217
217
 
218
218
  OPTIONS
219
219
  -a, --app=app (required) app to run command against
@@ -224,15 +224,15 @@ EXAMPLE
224
224
  $ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr "1.2.3.4/32" --description "home IP address"
225
225
  ```
226
226
 
227
- _See code: [src/commands/data/mtls/ip-rules/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/ip-rules/create.ts)_
227
+ _See code: [src/commands/data/mtls/ip-rules/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/ip-rules/create.ts)_
228
228
 
229
- ## `heroku data:mtls:ip-rules:delete [DATABASE]`
229
+ ## `heroku data:mtls:ip-rules:delete [ADDON]`
230
230
 
231
- delete a specific IP Rule for your MTLS enabled database
231
+ delete a specific IP Rule for your MTLS enabled addon
232
232
 
233
233
  ```
234
234
  USAGE
235
- $ heroku data:mtls:ip-rules:delete [DATABASE]
235
+ $ heroku data:mtls:ip-rules:delete [ADDON]
236
236
 
237
237
  OPTIONS
238
238
  -a, --app=app (required) app to run command against
@@ -243,15 +243,15 @@ EXAMPLE
243
243
  $ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
244
244
  ```
245
245
 
246
- _See code: [src/commands/data/mtls/ip-rules/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/ip-rules/delete.ts)_
246
+ _See code: [src/commands/data/mtls/ip-rules/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/ip-rules/delete.ts)_
247
247
 
248
- ## `heroku data:mtls:ip-rules:get [DATABASE]`
248
+ ## `heroku data:mtls:ip-rules:get [ADDON]`
249
249
 
250
- get the a specific IP Rule for your MTLS enabled database
250
+ get a specific IP Rule for your MTLS enabled addon
251
251
 
252
252
  ```
253
253
  USAGE
254
- $ heroku data:mtls:ip-rules:get [DATABASE]
254
+ $ heroku data:mtls:ip-rules:get [ADDON]
255
255
 
256
256
  OPTIONS
257
257
  -a, --app=app (required) app to run command against
@@ -261,5 +261,5 @@ EXAMPLE
261
261
  $ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
262
262
  ```
263
263
 
264
- _See code: [src/commands/data/mtls/ip-rules/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.6.0/src/commands/data/mtls/ip-rules/get.ts)_
264
+ _See code: [src/commands/data/mtls/ip-rules/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.8.1/src/commands/data/mtls/ip-rules/get.ts)_
265
265
  <!-- commandsstop -->
@@ -8,16 +8,19 @@ const fetcher_1 = require("../../../../lib/fetcher");
8
8
  class MTLSCertificateCreate extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSCertificateCreate);
11
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
12
- cli_ux_1.cli.action.start(`Creating new certificate for database ${color_1.default.cyan(database)}`);
13
- const { body: res } = await this.shogun.post(`/postgres/v0/databases/${database}/tls-endpoint/certificates`, this.shogun.defaults);
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ if (addon.kind === 'kafka') {
13
+ cli_ux_1.cli.error('Kafka certificates are availabe in your app\'s config vars');
14
+ }
15
+ cli_ux_1.cli.action.start(`Creating new certificate for ${color_1.default.cyan(addon.name)}`);
16
+ const { body: res } = await this.shogun.post(`${addon.endpoint}/certificates`, this.shogun.defaults);
14
17
  cli_ux_1.cli.action.stop();
15
18
  cli_ux_1.cli.styledObject(res);
16
19
  }
17
20
  }
18
- MTLSCertificateCreate.description = 'create a new certificate for your MTLS enabled database';
21
+ MTLSCertificateCreate.description = 'create a new certificate for your MTLS enabled addon';
19
22
  MTLSCertificateCreate.args = [
20
- { name: 'database' }
23
+ { name: 'addon' }
21
24
  ];
22
25
  MTLSCertificateCreate.flags = {
23
26
  app: command_1.flags.app({ required: true })
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const color_1 = require("@heroku-cli/color");
3
4
  const command_1 = require("@heroku-cli/command");
4
5
  const cli_ux_1 = require("cli-ux");
5
6
  const base_1 = require("../../../../base");
@@ -7,15 +8,18 @@ const fetcher_1 = require("../../../../lib/fetcher");
7
8
  class MTLSCertificateDelete extends base_1.default {
8
9
  async run() {
9
10
  const { args, flags } = this.parse(MTLSCertificateDelete);
10
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
11
- cli_ux_1.cli.action.start(`Deleting certificate for the ${database} database`);
12
- await this.shogun.delete(`/postgres/v0/databases/${database}/tls-endpoint/certificates/${flags.id}`, this.shogun.defaults);
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ if (addon.kind === 'kafka') {
13
+ cli_ux_1.cli.error('Kafka certificates are availabe in your app\'s config vars');
14
+ }
15
+ cli_ux_1.cli.action.start(`Deleting certificate for ${color_1.default.cyan(addon.name)}`);
16
+ await this.shogun.delete(`${addon.endpoint}/certificates/${flags.id}`, this.shogun.defaults);
13
17
  cli_ux_1.cli.action.stop();
14
18
  }
15
19
  }
16
- MTLSCertificateDelete.description = 'delete a specific certificate for your MTLS enabled database';
20
+ MTLSCertificateDelete.description = 'delete a specific certificate for your MTLS enabled addon';
17
21
  MTLSCertificateDelete.args = [
18
- { name: 'database' }
22
+ { name: 'addon' }
19
23
  ];
20
24
  MTLSCertificateDelete.flags = {
21
25
  app: command_1.flags.app({ required: true }),
@@ -19,11 +19,14 @@ class MTLSCertificateDownload extends base_1.default {
19
19
  async run() {
20
20
  try {
21
21
  const { args, flags } = this.parse(MTLSCertificateDownload);
22
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
23
- cli_ux_1.cli.action.start(`Downloading certificates for database ${color_1.default.cyan(database)}`);
22
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
23
+ if (addon.kind === 'kafka') {
24
+ cli_ux_1.cli.error('Kafka certificates are availabe in your app\'s config vars');
25
+ }
26
+ cli_ux_1.cli.action.start(`Downloading certificates for ${color_1.default.cyan(addon.name)}`);
24
27
  const [{ body: mtls }, { body: certs }] = await Promise.all([
25
- this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint`, this.shogun.defaults),
26
- this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/certificates`, this.shogun.defaults)
28
+ this.shogun.get(addon.endpoint, this.shogun.defaults),
29
+ this.shogun.get(`${addon.endpoint}/certificates`, this.shogun.defaults)
27
30
  ]);
28
31
  let baseCert = certs[0];
29
32
  const readyCerts = certs.filter(cert => cert.status === 'ready');
@@ -61,7 +64,7 @@ class MTLSCertificateDownload extends base_1.default {
61
64
  baseCert = readyCerts.find(cert => cert.id === answers.cert);
62
65
  });
63
66
  }
64
- const { body: cert } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/certificates/${baseCert.id}`, this.shogun.defaults);
67
+ const { body: cert } = await this.shogun.get(`${addon.endpoint}/certificates/${baseCert.id}`, this.shogun.defaults);
65
68
  const path = flags.dir || `${os_1.homedir}/.postgresql`;
66
69
  !fs_1.existsSync(path) && fs_1.mkdirSync(path);
67
70
  const key = `${path}/${flags.prefix}postgresql.key`;
@@ -87,7 +90,7 @@ class MTLSCertificateDownload extends base_1.default {
87
90
  }
88
91
  catch (err) {
89
92
  if (err.http && err.http.statusCode === 404) {
90
- this.warn('mTLS is not setup yet for this database');
93
+ this.warn('mTLS is not setup yet for this addon');
91
94
  }
92
95
  else {
93
96
  this.error(err.message);
@@ -95,9 +98,9 @@ class MTLSCertificateDownload extends base_1.default {
95
98
  }
96
99
  }
97
100
  }
98
- MTLSCertificateDownload.description = 'download your certificate bundle for your mTLS database';
101
+ MTLSCertificateDownload.description = 'download your certificate bundle for your mTLS addon';
99
102
  MTLSCertificateDownload.args = [
100
- { name: 'database' }
103
+ { name: 'addon' }
101
104
  ];
102
105
  MTLSCertificateDownload.flags = {
103
106
  app: command_1.flags.app({ required: true }),
@@ -7,16 +7,19 @@ const fetcher_1 = require("../../../../lib/fetcher");
7
7
  class MTLSCertificateGet extends base_1.default {
8
8
  async run() {
9
9
  const { args, flags } = this.parse(MTLSCertificateGet);
10
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
11
- const { body: res } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/certificates/${flags.id}`, this.shogun.defaults);
10
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
11
+ if (addon.kind === 'kafka') {
12
+ cli_ux_1.cli.error('Kafka certificates are availabe in your app\'s config vars');
13
+ }
14
+ const { body: res } = await this.shogun.get(`${addon.endpoint}/certificates/${flags.id}`, this.shogun.defaults);
12
15
  delete res.private_key;
13
16
  delete res.certificate_with_chain;
14
17
  cli_ux_1.cli.styledObject(res);
15
18
  }
16
19
  }
17
- MTLSCertificateGet.description = 'get a specific certificate for your MTLS enabled database';
20
+ MTLSCertificateGet.description = 'get a specific certificate for your MTLS enabled addon';
18
21
  MTLSCertificateGet.args = [
19
- { name: 'database' }
22
+ { name: 'addon' }
20
23
  ];
21
24
  MTLSCertificateGet.flags = {
22
25
  app: command_1.flags.app({ required: true }),
@@ -9,8 +9,11 @@ class MTLSCertificatesIndex extends base_1.default {
9
9
  async run() {
10
10
  try {
11
11
  const { args, flags } = this.parse(MTLSCertificatesIndex);
12
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
13
- const { body: res } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/certificates`, this.shogun.defaults);
12
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
13
+ if (addon.kind === 'kafka') {
14
+ cli_ux_1.cli.error('Kafka certificates are availabe in your app\'s config vars');
15
+ }
16
+ const { body: res } = await this.shogun.get(`${addon.endpoint}/certificates`, this.shogun.defaults);
14
17
  if (res.length === 0) {
15
18
  cli_ux_1.cli.log('You currently have no certificates setup');
16
19
  }
@@ -24,7 +27,7 @@ class MTLSCertificatesIndex extends base_1.default {
24
27
  this.error(err.message);
25
28
  }
26
29
  else {
27
- this.warn('mTLS is not setup yet for this database');
30
+ this.warn('mTLS is not setup yet for this addon');
28
31
  }
29
32
  }
30
33
  else {
@@ -33,9 +36,9 @@ class MTLSCertificatesIndex extends base_1.default {
33
36
  }
34
37
  }
35
38
  }
36
- MTLSCertificatesIndex.description = 'get the certificates for your MTLS enabled database';
39
+ MTLSCertificatesIndex.description = 'get the certificates for your MTLS enabled addon';
37
40
  MTLSCertificatesIndex.args = [
38
- { name: 'database' }
41
+ { name: 'addon' }
39
42
  ];
40
43
  MTLSCertificatesIndex.flags = {
41
44
  app: command_1.flags.app({ required: true })
@@ -8,22 +8,30 @@ const fetcher_1 = require("../../../lib/fetcher");
8
8
  class MTLSCreate extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSCreate);
11
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
12
- cli_ux_1.cli.action.start(`Enabling MTLS on ${color_1.default.cyan(database)}`);
13
- try {
14
- const { body: res } = await this.shogun.post(`/postgres/v0/databases/${database}/tls-endpoint`, Object.assign({}, this.shogun.defaults, { body: {} }));
15
- cli_ux_1.cli.styledObject(res);
16
- cli_ux_1.cli.action.stop();
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ if (addon.kind === 'kafka') {
13
+ cli_ux_1.cli.error('Kafka has mTLS enabled by default');
17
14
  }
18
- catch (err) {
19
- cli_ux_1.cli.action.stop('failed!');
20
- cli_ux_1.cli.log(err.body.message);
15
+ if (await cli_ux_1.cli.confirm('Enabling Mutual TLS will allow external access to this restricted data service. This action will be logged. Continue?')) {
16
+ cli_ux_1.cli.action.start(`Enabling MTLS on ${color_1.default.cyan(addon.name)}`);
17
+ try {
18
+ const { body: res } = await this.shogun.post(addon.endpoint, Object.assign({}, this.shogun.defaults, { body: {} }));
19
+ cli_ux_1.cli.styledObject(res);
20
+ cli_ux_1.cli.action.stop();
21
+ }
22
+ catch (err) {
23
+ cli_ux_1.cli.action.stop('failed!');
24
+ cli_ux_1.cli.log(err.body.message);
25
+ }
26
+ }
27
+ else {
28
+ cli_ux_1.cli.warn('You did not enable mTLS');
21
29
  }
22
30
  }
23
31
  }
24
- MTLSCreate.description = 'enable MTLS for your database';
32
+ MTLSCreate.description = 'enable MTLS for your addon';
25
33
  MTLSCreate.args = [
26
- { name: 'database' },
34
+ { name: 'addon' },
27
35
  ];
28
36
  MTLSCreate.flags = {
29
37
  app: command_1.flags.app({ required: true })
@@ -8,16 +8,19 @@ const fetcher_1 = require("../../../lib/fetcher");
8
8
  class MTLSDestroy extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSDestroy);
11
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
12
- cli_ux_1.cli.action.start(`Disabling MTLS on ${color_1.default.cyan(database)}`);
13
- await this.shogun.delete(`/postgres/v0/databases/${database}/tls-endpoint`, this.shogun.defaults);
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ if (addon.kind === 'kafka') {
13
+ cli_ux_1.cli.error('Kafka has mTLS enabled by default and you cannot disable it');
14
+ }
15
+ cli_ux_1.cli.action.start(`Disabling MTLS on ${color_1.default.cyan(addon.name)}`);
16
+ await this.shogun.delete(addon.endpoint, this.shogun.defaults);
14
17
  cli_ux_1.cli.action.stop();
15
18
  }
16
19
  }
17
- MTLSDestroy.description = 'destroy MTLS configuration on your database';
20
+ MTLSDestroy.description = 'destroy MTLS configuration on your addon';
18
21
  MTLSDestroy.aliases = ['data:mtls:delete'];
19
22
  MTLSDestroy.args = [
20
- { name: 'database' },
23
+ { name: 'addon' },
21
24
  ];
22
25
  MTLSDestroy.flags = {
23
26
  app: command_1.flags.app({ required: true })
@@ -10,29 +10,44 @@ class MTLSIndex extends base_1.default {
10
10
  async run() {
11
11
  try {
12
12
  const { args, flags } = this.parse(MTLSIndex);
13
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
14
- const [{ body: mtls }, { body: certs }, { body: ipRules }] = await Promise.all([
15
- this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint`, this.shogun.defaults),
16
- this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/certificates`, this.shogun.defaults),
17
- this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules`, this.shogun.defaults)
18
- ]);
19
- delete mtls.certificate_authority_chain;
20
- cli_ux_1.cli.styledObject({
21
- addon: mtls.addon,
22
- app: mtls.app,
23
- 'TLS-status': mtls.status
24
- });
25
- if (certs.length > 0) {
26
- this.log();
27
- this.log(color_1.color.underline('Certificates'));
28
- this.log();
29
- table_1.certificatesTable(certs);
13
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
14
+ if (addon.kind === 'kafka') {
15
+ const { body: ipRules } = await this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults);
16
+ cli_ux_1.cli.styledObject({
17
+ addon: addon.name,
18
+ 'TLS-status': 'Available'
19
+ });
20
+ if (ipRules.length > 0) {
21
+ this.log();
22
+ this.log(color_1.color.underline('IP Rules'));
23
+ this.log();
24
+ table_1.ipRulesTable(ipRules);
25
+ }
30
26
  }
31
- if (ipRules.length > 0) {
32
- this.log();
33
- this.log(color_1.color.underline('IP Rules'));
34
- this.log();
35
- table_1.ipRulesTable(ipRules);
27
+ else {
28
+ const [{ body: mtls }, { body: certs }, { body: ipRules }] = await Promise.all([
29
+ this.shogun.get(addon.endpoint, this.shogun.defaults),
30
+ this.shogun.get(`${addon.endpoint}/certificates`, this.shogun.defaults),
31
+ this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults)
32
+ ]);
33
+ delete mtls.certificate_authority_chain;
34
+ cli_ux_1.cli.styledObject({
35
+ addon: mtls.addon,
36
+ app: mtls.app,
37
+ 'TLS-status': mtls.status
38
+ });
39
+ if (certs.length > 0) {
40
+ this.log();
41
+ this.log(color_1.color.underline('Certificates'));
42
+ this.log();
43
+ table_1.certificatesTable(certs);
44
+ }
45
+ if (ipRules.length > 0) {
46
+ this.log();
47
+ this.log(color_1.color.underline('IP Rules'));
48
+ this.log();
49
+ table_1.ipRulesTable(ipRules);
50
+ }
36
51
  }
37
52
  }
38
53
  catch (err) {
@@ -41,7 +56,7 @@ class MTLSIndex extends base_1.default {
41
56
  this.error(err.message);
42
57
  }
43
58
  else {
44
- this.warn('mTLS is not setup yet for this database');
59
+ this.warn('mTLS is not setup yet for this addon');
45
60
  }
46
61
  }
47
62
  else {
@@ -50,9 +65,9 @@ class MTLSIndex extends base_1.default {
50
65
  }
51
66
  }
52
67
  }
53
- MTLSIndex.description = 'get the status of MTLS for your database';
68
+ MTLSIndex.description = 'get the status of MTLS for your addon';
54
69
  MTLSIndex.args = [
55
- { name: 'database' }
70
+ { name: 'addon' }
56
71
  ];
57
72
  MTLSIndex.flags = {
58
73
  app: command_1.flags.app({ required: true })
@@ -8,9 +8,9 @@ const fetcher_1 = require("../../../../lib/fetcher");
8
8
  class MTLSIPCreate extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSIPCreate);
11
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
12
- cli_ux_1.cli.action.start(`Creating IP Rule for database ${color_1.default.cyan(database)}`);
13
- const { body: res } = await this.shogun.post(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules`, Object.assign({}, this.shogun.defaults, { body: {
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ cli_ux_1.cli.action.start(`Creating IP Rule for ${color_1.default.cyan(addon.name)}`);
13
+ const { body: res } = await this.shogun.post(`${addon.endpoint}/ip-rules`, Object.assign({}, this.shogun.defaults, { body: {
14
14
  cidr: flags.cidr,
15
15
  description: flags.description
16
16
  } }));
@@ -18,9 +18,9 @@ class MTLSIPCreate extends base_1.default {
18
18
  cli_ux_1.cli.styledObject(res);
19
19
  }
20
20
  }
21
- MTLSIPCreate.description = 'get the IP Rules for your MTLS enabled database';
21
+ MTLSIPCreate.description = 'create an IP Rule for your MTLS enabled addon';
22
22
  MTLSIPCreate.args = [
23
- { name: 'database' }
23
+ { name: 'addon' }
24
24
  ];
25
25
  MTLSIPCreate.flags = {
26
26
  app: command_1.flags.app({ required: true }),
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const color_1 = require("@heroku-cli/color");
3
4
  const command_1 = require("@heroku-cli/command");
4
5
  const cli_ux_1 = require("cli-ux");
5
6
  const base_1 = require("../../../../base");
@@ -11,14 +12,14 @@ class MTLSIPDelete extends base_1.default {
11
12
  cli_ux_1.cli.error('You need at least pass in the id or cidr of the IP Rule');
12
13
  }
13
14
  else {
14
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
15
- cli_ux_1.cli.action.start(`Deleting IP Rule for the ${database} database`);
15
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
16
+ cli_ux_1.cli.action.start(`Deleting IP Rule for ${color_1.default.cyan(addon.name)}`);
16
17
  let id = '';
17
18
  if (flags.id) {
18
19
  id = flags.id;
19
20
  }
20
21
  else {
21
- const { body: ipRules } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules`, this.shogun.defaults);
22
+ const { body: ipRules } = await this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults);
22
23
  const ipRule = ipRules.find(ipRule => ipRule.cidr === flags.cidr);
23
24
  if (ipRule) {
24
25
  id = ipRule.id;
@@ -27,14 +28,14 @@ class MTLSIPDelete extends base_1.default {
27
28
  cli_ux_1.cli.error('No IP Rule found with that cidr');
28
29
  }
29
30
  }
30
- await this.shogun.delete(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules/${id}`, this.shogun.defaults);
31
+ await this.shogun.delete(`${addon.endpoint}/ip-rules/${id}`, this.shogun.defaults);
31
32
  cli_ux_1.cli.action.stop();
32
33
  }
33
34
  }
34
35
  }
35
- MTLSIPDelete.description = 'delete a specific IP Rule for your MTLS enabled database';
36
+ MTLSIPDelete.description = 'delete a specific IP Rule for your MTLS enabled addon';
36
37
  MTLSIPDelete.args = [
37
- { name: 'database' }
38
+ { name: 'addon' }
38
39
  ];
39
40
  MTLSIPDelete.flags = {
40
41
  app: command_1.flags.app({ required: true }),
@@ -7,14 +7,14 @@ const fetcher_1 = require("../../../../lib/fetcher");
7
7
  class MTLSIPGet extends base_1.default {
8
8
  async run() {
9
9
  const { args, flags } = this.parse(MTLSIPGet);
10
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
11
- const { body: res } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules/${flags.id}`, this.shogun.defaults);
10
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
11
+ const { body: res } = await this.shogun.get(`${addon.endpoint}/ip-rules/${flags.id}`, this.shogun.defaults);
12
12
  cli_ux_1.cli.styledObject(res);
13
13
  }
14
14
  }
15
- MTLSIPGet.description = 'get the a specific IP Rule for your MTLS enabled database';
15
+ MTLSIPGet.description = 'get a specific IP Rule for your MTLS enabled addon';
16
16
  MTLSIPGet.args = [
17
- { name: 'database' }
17
+ { name: 'addon' }
18
18
  ];
19
19
  MTLSIPGet.flags = {
20
20
  app: command_1.flags.app({ required: true }),
@@ -8,8 +8,8 @@ const table_1 = require("../../../../utils/table");
8
8
  class MTLSIPIndex extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSIPIndex);
11
- const database = await fetcher_1.default(this.heroku, args.database, flags.app);
12
- const { body: res } = await this.shogun.get(`/postgres/v0/databases/${database}/tls-endpoint/ip-rules`, this.shogun.defaults);
11
+ const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
+ const { body: res } = await this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults);
13
13
  if (res.length === 0) {
14
14
  cli_ux_1.cli.log('You currently have no IP Rules setup');
15
15
  }
@@ -18,9 +18,9 @@ class MTLSIPIndex extends base_1.default {
18
18
  }
19
19
  }
20
20
  }
21
- MTLSIPIndex.description = 'get the IP Rules for your MTLS enabled database';
21
+ MTLSIPIndex.description = 'get the IP Rules for your MTLS enabled addon';
22
22
  MTLSIPIndex.args = [
23
- { name: 'database' }
23
+ { name: 'addon' }
24
24
  ];
25
25
  MTLSIPIndex.flags = {
26
26
  app: command_1.flags.app({ required: true })
@@ -2,7 +2,49 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_ux_1 = require("cli-ux");
4
4
  async function default_1(heroku, addon_attachment, app) {
5
- const db = addon_attachment || 'DATABASE_URL';
5
+ const filteredAddon = addon_attachment ?
6
+ await findAddonGivenAttachment(heroku, addon_attachment, app) :
7
+ await findAllAddons(heroku, app);
8
+ if (filteredAddon) {
9
+ if (filteredAddon.addon_service.name.startsWith('heroku-postgresql')) {
10
+ return {
11
+ name: filteredAddon.name,
12
+ endpoint: `/postgres/v0/databases/${filteredAddon.id}/tls-endpoint`,
13
+ kind: 'postgresql'
14
+ };
15
+ }
16
+ else if (filteredAddon.addon_service.name.startsWith('heroku-kafka') &&
17
+ RegExp(/private|shield/).test(filteredAddon.plan.name)) {
18
+ return {
19
+ name: filteredAddon.name,
20
+ endpoint: `/data/kafka/v0/clusters/${filteredAddon.id}`,
21
+ kind: 'kafka'
22
+ };
23
+ }
24
+ }
25
+ }
26
+ exports.default = default_1;
27
+ async function findAllAddons(heroku, app) {
28
+ const { body: addon_list } = await heroku.get(`/apps/${app}/addons`);
29
+ let filtered_list = addon_list.filter((addon) => {
30
+ if (addon.addon_service) {
31
+ return addon.addon_service.name &&
32
+ (addon.addon_service.name.startsWith('heroku-postgresql') ||
33
+ addon.addon_service.name.startsWith('heroku-kafka'));
34
+ }
35
+ });
36
+ if (filtered_list.length === 0) {
37
+ cli_ux_1.cli.error('No addons found');
38
+ }
39
+ else if (filtered_list.length === 1) {
40
+ return filtered_list[0];
41
+ }
42
+ else {
43
+ cli_ux_1.cli.error("No addon specified. Here's the list of addons:" + filtered_list.map((addon) => addon.name));
44
+ }
45
+ }
46
+ async function findAddonGivenAttachment(heroku, addon_attachment, app) {
47
+ const db = addon_attachment;
6
48
  const { body: res } = await heroku.post('/actions/addons/resolve', {
7
49
  body: {
8
50
  app,
@@ -12,16 +54,17 @@ async function default_1(heroku, addon_attachment, app) {
12
54
  if (res.id === 'not_found') {
13
55
  cli_ux_1.cli.error(res.message);
14
56
  }
15
- const filteredDb = res.find((addon) => {
57
+ let addon = res.find((addon) => {
16
58
  if (addon.addon_service) {
17
- return addon.addon_service.name && addon.addon_service.name.startsWith('heroku-postgresql');
59
+ return addon.addon_service.name &&
60
+ (addon.addon_service.name.startsWith('heroku-postgresql') ||
61
+ addon.addon_service.name.startsWith('heroku-kafka'));
18
62
  }
19
63
  });
20
- if (filteredDb) {
21
- return filteredDb.name;
64
+ if (!addon) {
65
+ cli_ux_1.cli.error('No addons found');
22
66
  }
23
67
  else {
24
- cli_ux_1.cli.error('No databases found');
68
+ return addon;
25
69
  }
26
70
  }
27
- exports.default = default_1;
@@ -1 +1 @@
1
- {"version":"0.6.0","commands":{"data:mtls:create":{"id":"data:mtls:create","description":"enable MTLS for your database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]},"data:mtls:destroy":{"id":"data:mtls:destroy","description":"destroy MTLS configuration on your database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":["data:mtls:delete"],"examples":["$ heroku data:mtls:destroy postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]},"data:mtls":{"id":"data:mtls","description":"get the status of MTLS for your database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]},"data:mtls:certificates:create":{"id":"data:mtls:certificates:create","description":"create a new certificate for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]},"data:mtls:certificates:delete":{"id":"data:mtls:certificates:delete","description":"delete a specific certificate for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of certificate","required":true}},"args":[{"name":"database"}]},"data:mtls:certificates:download":{"id":"data:mtls:certificates:download","description":"download your certificate bundle for your mTLS database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\" --dir \"./folder\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f --prefix \"prefix_\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"dir":{"name":"dir","type":"option","description":"directory to download files to. defaults to HOME:/.postgresql","required":false},"id":{"name":"id","type":"option","description":"ID of certificate to download","required":false},"prefix":{"name":"prefix","type":"option","description":"prefix to put in front of downloaded file names","required":true,"default":""}},"args":[{"name":"database"}]},"data:mtls:certificates:get":{"id":"data:mtls:certificates:get","description":"get a specific certificate for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"database"}]},"data:mtls:certificates":{"id":"data:mtls:certificates","description":"get the certificates for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]},"data:mtls:ip-rules:create":{"id":"data:mtls:ip-rules:create","description":"get the IP Rules for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr \"1.2.3.4/32\" --description \"home IP address\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","required":true},"description":{"name":"description","type":"option","required":false}},"args":[{"name":"database"}]},"data:mtls:ip-rules:delete":{"id":"data:mtls:ip-rules:delete","description":"delete a specific IP Rule for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","description":"cidr of IP Rule"},"id":{"name":"id","type":"option","description":"id of IP Rule"}},"args":[{"name":"database"}]},"data:mtls:ip-rules:get":{"id":"data:mtls:ip-rules:get","description":"get the a specific IP Rule for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"database"}]},"data:mtls:ip-rules":{"id":"data:mtls:ip-rules","description":"get the IP Rules for your MTLS enabled database","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"database"}]}}}
1
+ {"version":"0.8.1","commands":{"data:mtls:create":{"id":"data:mtls:create","description":"enable MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:destroy":{"id":"data:mtls:destroy","description":"destroy MTLS configuration on your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":["data:mtls:delete"],"examples":["$ heroku data:mtls:destroy postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls":{"id":"data:mtls","description":"get the status of MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:create":{"id":"data:mtls:certificates:create","description":"create a new certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:delete":{"id":"data:mtls:certificates:delete","description":"delete a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of certificate","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:download":{"id":"data:mtls:certificates:download","description":"download your certificate bundle for your mTLS addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\" --dir \"./folder\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f --prefix \"prefix_\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"dir":{"name":"dir","type":"option","description":"directory to download files to. defaults to HOME:/.postgresql","required":false},"id":{"name":"id","type":"option","description":"ID of certificate to download","required":false},"prefix":{"name":"prefix","type":"option","description":"prefix to put in front of downloaded file names","required":true,"default":""}},"args":[{"name":"addon"}]},"data:mtls:certificates:get":{"id":"data:mtls:certificates:get","description":"get a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates":{"id":"data:mtls:certificates","description":"get the certificates for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:create":{"id":"data:mtls:ip-rules:create","description":"create an IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr \"1.2.3.4/32\" --description \"home IP address\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","required":true},"description":{"name":"description","type":"option","required":false}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:delete":{"id":"data:mtls:ip-rules:delete","description":"delete a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","description":"cidr of IP Rule"},"id":{"name":"id","type":"option","description":"id of IP Rule"}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:get":{"id":"data:mtls:ip-rules:get","description":"get a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules":{"id":"data:mtls:ip-rules","description":"get the IP Rules for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@heroku-cli/plugin-mtls",
3
3
  "description": "heroku mtls cli",
4
- "version": "0.6.0",
4
+ "version": "0.8.1",
5
5
  "author": "rmanrique@heroku.com",
6
6
  "bugs": "https://github.com/heroku/heroku-cli-plugin-mtls/issues",
7
7
  "dependencies": {