@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 +63 -63
- package/lib/commands/data/mtls/certificates/create.js +8 -5
- package/lib/commands/data/mtls/certificates/delete.js +9 -5
- package/lib/commands/data/mtls/certificates/download.js +11 -8
- package/lib/commands/data/mtls/certificates/get.js +7 -4
- package/lib/commands/data/mtls/certificates/index.js +8 -5
- package/lib/commands/data/mtls/create.js +19 -11
- package/lib/commands/data/mtls/destroy.js +8 -5
- package/lib/commands/data/mtls/index.js +40 -25
- package/lib/commands/data/mtls/ip-rules/create.js +5 -5
- package/lib/commands/data/mtls/ip-rules/delete.js +7 -6
- package/lib/commands/data/mtls/ip-rules/get.js +4 -4
- package/lib/commands/data/mtls/ip-rules/index.js +4 -4
- package/lib/lib/fetcher.js +50 -7
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
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.
|
|
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 [
|
|
33
|
-
* [`heroku data:mtls:certificates [
|
|
34
|
-
* [`heroku data:mtls:certificates:create [
|
|
35
|
-
* [`heroku data:mtls:certificates:delete [
|
|
36
|
-
* [`heroku data:mtls:certificates:download [
|
|
37
|
-
* [`heroku data:mtls:certificates:get [
|
|
38
|
-
* [`heroku data:mtls:create [
|
|
39
|
-
* [`heroku data:mtls:destroy [
|
|
40
|
-
* [`heroku data:mtls:ip-rules [
|
|
41
|
-
* [`heroku data:mtls:ip-rules:create [
|
|
42
|
-
* [`heroku data:mtls:ip-rules:delete [
|
|
43
|
-
* [`heroku data:mtls:ip-rules:get [
|
|
44
|
-
|
|
45
|
-
## `heroku data:mtls [
|
|
46
|
-
|
|
47
|
-
get the status of MTLS for your
|
|
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 [
|
|
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.
|
|
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 [
|
|
62
|
+
## `heroku data:mtls:certificates [ADDON]`
|
|
63
63
|
|
|
64
|
-
get the certificates for your MTLS enabled
|
|
64
|
+
get the certificates for your MTLS enabled addon
|
|
65
65
|
|
|
66
66
|
```
|
|
67
67
|
USAGE
|
|
68
|
-
$ heroku data:mtls:certificates [
|
|
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.
|
|
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 [
|
|
79
|
+
## `heroku data:mtls:certificates:create [ADDON]`
|
|
80
80
|
|
|
81
|
-
create a new certificate for your MTLS enabled
|
|
81
|
+
create a new certificate for your MTLS enabled addon
|
|
82
82
|
|
|
83
83
|
```
|
|
84
84
|
USAGE
|
|
85
|
-
$ heroku data:mtls:certificates:create [
|
|
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.
|
|
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 [
|
|
96
|
+
## `heroku data:mtls:certificates:delete [ADDON]`
|
|
97
97
|
|
|
98
|
-
delete a specific certificate for your MTLS enabled
|
|
98
|
+
delete a specific certificate for your MTLS enabled addon
|
|
99
99
|
|
|
100
100
|
```
|
|
101
101
|
USAGE
|
|
102
|
-
$ heroku data:mtls:certificates:delete [
|
|
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.
|
|
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 [
|
|
114
|
+
## `heroku data:mtls:certificates:download [ADDON]`
|
|
115
115
|
|
|
116
|
-
download your certificate bundle for your mTLS
|
|
116
|
+
download your certificate bundle for your mTLS addon
|
|
117
117
|
|
|
118
118
|
```
|
|
119
119
|
USAGE
|
|
120
|
-
$ heroku data:mtls:certificates:download [
|
|
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.
|
|
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 [
|
|
138
|
+
## `heroku data:mtls:certificates:get [ADDON]`
|
|
139
139
|
|
|
140
|
-
get a specific certificate for your MTLS enabled
|
|
140
|
+
get a specific certificate for your MTLS enabled addon
|
|
141
141
|
|
|
142
142
|
```
|
|
143
143
|
USAGE
|
|
144
|
-
$ heroku data:mtls:certificates:get [
|
|
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.
|
|
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 [
|
|
156
|
+
## `heroku data:mtls:create [ADDON]`
|
|
157
157
|
|
|
158
|
-
enable MTLS for your
|
|
158
|
+
enable MTLS for your addon
|
|
159
159
|
|
|
160
160
|
```
|
|
161
161
|
USAGE
|
|
162
|
-
$ heroku data:mtls:create [
|
|
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.
|
|
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 [
|
|
173
|
+
## `heroku data:mtls:destroy [ADDON]`
|
|
174
174
|
|
|
175
|
-
destroy MTLS configuration on your
|
|
175
|
+
destroy MTLS configuration on your addon
|
|
176
176
|
|
|
177
177
|
```
|
|
178
178
|
USAGE
|
|
179
|
-
$ heroku data:mtls:destroy [
|
|
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.
|
|
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 [
|
|
193
|
+
## `heroku data:mtls:ip-rules [ADDON]`
|
|
194
194
|
|
|
195
|
-
get the IP Rules for your MTLS enabled
|
|
195
|
+
get the IP Rules for your MTLS enabled addon
|
|
196
196
|
|
|
197
197
|
```
|
|
198
198
|
USAGE
|
|
199
|
-
$ heroku data:mtls:ip-rules [
|
|
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.
|
|
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 [
|
|
210
|
+
## `heroku data:mtls:ip-rules:create [ADDON]`
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
create an IP Rule for your MTLS enabled addon
|
|
213
213
|
|
|
214
214
|
```
|
|
215
215
|
USAGE
|
|
216
|
-
$ heroku data:mtls:ip-rules:create [
|
|
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.
|
|
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 [
|
|
229
|
+
## `heroku data:mtls:ip-rules:delete [ADDON]`
|
|
230
230
|
|
|
231
|
-
delete a specific IP Rule for your MTLS enabled
|
|
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 [
|
|
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.
|
|
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 [
|
|
248
|
+
## `heroku data:mtls:ip-rules:get [ADDON]`
|
|
249
249
|
|
|
250
|
-
get
|
|
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 [
|
|
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.
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
21
|
+
MTLSCertificateCreate.description = 'create a new certificate for your MTLS enabled addon';
|
|
19
22
|
MTLSCertificateCreate.args = [
|
|
20
|
-
{ name: '
|
|
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
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
20
|
+
MTLSCertificateDelete.description = 'delete a specific certificate for your MTLS enabled addon';
|
|
17
21
|
MTLSCertificateDelete.args = [
|
|
18
|
-
{ name: '
|
|
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
|
|
23
|
-
|
|
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(
|
|
26
|
-
this.shogun.get(
|
|
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(
|
|
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
|
|
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
|
|
101
|
+
MTLSCertificateDownload.description = 'download your certificate bundle for your mTLS addon';
|
|
99
102
|
MTLSCertificateDownload.args = [
|
|
100
|
-
{ name: '
|
|
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
|
|
11
|
-
|
|
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
|
|
20
|
+
MTLSCertificateGet.description = 'get a specific certificate for your MTLS enabled addon';
|
|
18
21
|
MTLSCertificateGet.args = [
|
|
19
|
-
{ name: '
|
|
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
|
|
13
|
-
|
|
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
|
|
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
|
|
39
|
+
MTLSCertificatesIndex.description = 'get the certificates for your MTLS enabled addon';
|
|
37
40
|
MTLSCertificatesIndex.args = [
|
|
38
|
-
{ name: '
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
19
|
-
cli_ux_1.cli.action.
|
|
20
|
-
|
|
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
|
|
32
|
+
MTLSCreate.description = 'enable MTLS for your addon';
|
|
25
33
|
MTLSCreate.args = [
|
|
26
|
-
{ name: '
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
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
|
|
20
|
+
MTLSDestroy.description = 'destroy MTLS configuration on your addon';
|
|
18
21
|
MTLSDestroy.aliases = ['data:mtls:delete'];
|
|
19
22
|
MTLSDestroy.args = [
|
|
20
|
-
{ name: '
|
|
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
|
|
14
|
-
|
|
15
|
-
this.shogun.get(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
|
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
|
|
68
|
+
MTLSIndex.description = 'get the status of MTLS for your addon';
|
|
54
69
|
MTLSIndex.args = [
|
|
55
|
-
{ name: '
|
|
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
|
|
12
|
-
cli_ux_1.cli.action.start(`Creating IP Rule for
|
|
13
|
-
const { body: res } = await this.shogun.post(
|
|
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 = '
|
|
21
|
+
MTLSIPCreate.description = 'create an IP Rule for your MTLS enabled addon';
|
|
22
22
|
MTLSIPCreate.args = [
|
|
23
|
-
{ name: '
|
|
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
|
|
15
|
-
cli_ux_1.cli.action.start(`Deleting IP Rule for
|
|
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(
|
|
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(
|
|
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
|
|
36
|
+
MTLSIPDelete.description = 'delete a specific IP Rule for your MTLS enabled addon';
|
|
36
37
|
MTLSIPDelete.args = [
|
|
37
|
-
{ name: '
|
|
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
|
|
11
|
-
const { body: res } = await this.shogun.get(
|
|
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
|
|
15
|
+
MTLSIPGet.description = 'get a specific IP Rule for your MTLS enabled addon';
|
|
16
16
|
MTLSIPGet.args = [
|
|
17
|
-
{ name: '
|
|
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
|
|
12
|
-
const { body: res } = await this.shogun.get(
|
|
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
|
|
21
|
+
MTLSIPIndex.description = 'get the IP Rules for your MTLS enabled addon';
|
|
22
22
|
MTLSIPIndex.args = [
|
|
23
|
-
{ name: '
|
|
23
|
+
{ name: 'addon' }
|
|
24
24
|
];
|
|
25
25
|
MTLSIPIndex.flags = {
|
|
26
26
|
app: command_1.flags.app({ required: true })
|
package/lib/lib/fetcher.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
57
|
+
let addon = res.find((addon) => {
|
|
16
58
|
if (addon.addon_service) {
|
|
17
|
-
return addon.addon_service.name &&
|
|
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 (
|
|
21
|
-
|
|
64
|
+
if (!addon) {
|
|
65
|
+
cli_ux_1.cli.error('No addons found');
|
|
22
66
|
}
|
|
23
67
|
else {
|
|
24
|
-
|
|
68
|
+
return addon;
|
|
25
69
|
}
|
|
26
70
|
}
|
|
27
|
-
exports.default = default_1;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
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