@heroku-cli/plugin-mtls 0.9.2 → 1.0.0
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/LICENSE +1 -1
- package/README.md +207 -110
- package/dist/README.md +347 -0
- package/{lib → dist}/base.d.ts +2 -2
- package/{lib → dist}/base.js +5 -1
- package/dist/commands/data/mtls/certificates/create.d.ts +12 -0
- package/dist/commands/data/mtls/certificates/create.js +32 -0
- package/dist/commands/data/mtls/certificates/delete.d.ts +13 -0
- package/dist/commands/data/mtls/certificates/delete.js +32 -0
- package/dist/commands/data/mtls/certificates/download.d.ts +15 -0
- package/{lib → dist}/commands/data/mtls/certificates/download.js +41 -40
- package/dist/commands/data/mtls/certificates/get.d.ts +13 -0
- package/dist/commands/data/mtls/certificates/get.js +32 -0
- package/dist/commands/data/mtls/certificates/index.d.ts +12 -0
- package/{lib → dist}/commands/data/mtls/certificates/index.js +17 -16
- package/dist/commands/data/mtls/create.d.ts +12 -0
- package/dist/commands/data/mtls/create.js +43 -0
- package/dist/commands/data/mtls/destroy.d.ts +13 -0
- package/dist/commands/data/mtls/destroy.js +32 -0
- package/dist/commands/data/mtls/index.d.ts +12 -0
- package/{lib → dist}/commands/data/mtls/index.js +17 -16
- package/dist/commands/data/mtls/ip-rules/create.d.ts +14 -0
- package/dist/commands/data/mtls/ip-rules/create.js +37 -0
- package/dist/commands/data/mtls/ip-rules/delete.d.ts +14 -0
- package/dist/commands/data/mtls/ip-rules/delete.js +49 -0
- package/dist/commands/data/mtls/ip-rules/get.d.ts +13 -0
- package/dist/commands/data/mtls/ip-rules/get.js +27 -0
- package/dist/commands/data/mtls/ip-rules/index.d.ts +12 -0
- package/dist/commands/data/mtls/ip-rules/index.js +32 -0
- package/{lib → dist}/lib/fetcher.js +6 -6
- package/dist/oclif.manifest.json +575 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/utils/file-helper.d.ts +4 -0
- package/dist/utils/file-helper.js +11 -0
- package/{lib → dist}/utils/is-error-http.js +1 -2
- package/{lib → dist}/utils/is-error-message.js +1 -2
- package/dist/utils/table.js +42 -0
- package/package.json +20 -19
- package/lib/README.md +0 -250
- package/lib/commands/data/mtls/certificates/create.d.ts +0 -13
- package/lib/commands/data/mtls/certificates/create.js +0 -31
- package/lib/commands/data/mtls/certificates/delete.d.ts +0 -14
- package/lib/commands/data/mtls/certificates/delete.js +0 -31
- package/lib/commands/data/mtls/certificates/download.d.ts +0 -16
- package/lib/commands/data/mtls/certificates/get.d.ts +0 -14
- package/lib/commands/data/mtls/certificates/get.js +0 -31
- package/lib/commands/data/mtls/certificates/index.d.ts +0 -13
- package/lib/commands/data/mtls/create.d.ts +0 -13
- package/lib/commands/data/mtls/create.js +0 -42
- package/lib/commands/data/mtls/destroy.d.ts +0 -14
- package/lib/commands/data/mtls/destroy.js +0 -31
- package/lib/commands/data/mtls/index.d.ts +0 -13
- package/lib/commands/data/mtls/ip-rules/create.d.ts +0 -15
- package/lib/commands/data/mtls/ip-rules/create.js +0 -33
- package/lib/commands/data/mtls/ip-rules/delete.d.ts +0 -15
- package/lib/commands/data/mtls/ip-rules/delete.js +0 -48
- package/lib/commands/data/mtls/ip-rules/get.d.ts +0 -14
- package/lib/commands/data/mtls/ip-rules/get.js +0 -26
- package/lib/commands/data/mtls/ip-rules/index.d.ts +0 -13
- package/lib/commands/data/mtls/ip-rules/index.js +0 -31
- package/lib/oclif.manifest.json +0 -1
- package/lib/package.json +0 -34
- package/lib/utils/table.js +0 -18
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.js +0 -0
- /package/{lib → dist}/lib/fetcher.d.ts +0 -0
- /package/{lib → dist}/utils/is-error-http.d.ts +0 -0
- /package/{lib → dist}/utils/is-error-message.d.ts +0 -0
- /package/{lib → dist}/utils/table.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heroku-cli/plugin-mtls",
|
|
3
3
|
"description": "heroku mtls cli",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"author": "Heroku",
|
|
6
6
|
"bugs": "https://github.com/heroku/heroku-cli-plugin-mtls/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@heroku-cli/color": "^
|
|
9
|
-
"@heroku-cli/command": "^
|
|
10
|
-
"@
|
|
11
|
-
"@oclif/
|
|
8
|
+
"@heroku-cli/color": "^2",
|
|
9
|
+
"@heroku-cli/command": "^11.5.0",
|
|
10
|
+
"@heroku-cli/schema": "^1.0.25",
|
|
11
|
+
"@oclif/core": "^2.16.0",
|
|
12
|
+
"@oclif/plugin-help": "^5",
|
|
12
13
|
"@types/inquirer": "^6.0.3",
|
|
13
14
|
"@types/supports-color": "^5.3.0",
|
|
14
|
-
"cli-ux": "^5.3.0",
|
|
15
15
|
"inquirer": "^6.5.0",
|
|
16
16
|
"tslib": "~2.6.2"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@fancy-test/nock": "^0.1.1",
|
|
20
19
|
"@heroku-cli/schema": "^1.0.25",
|
|
21
|
-
"@oclif/
|
|
22
|
-
"@oclif/plugin-help": "^2",
|
|
23
|
-
"@oclif/test": "^1",
|
|
20
|
+
"@oclif/test": "^3.2.15",
|
|
24
21
|
"@types/chai": "^4",
|
|
25
22
|
"@types/mocha": "^10.0.6",
|
|
26
23
|
"@types/node": "^20.10.4",
|
|
@@ -33,26 +30,28 @@
|
|
|
33
30
|
"eslint-config-oclif-typescript": "^3.0.26",
|
|
34
31
|
"mocha": "10.x",
|
|
35
32
|
"nock": "^13.5.1",
|
|
33
|
+
"np": "^10.2.0",
|
|
36
34
|
"nyc": "^15.1.0",
|
|
37
|
-
"
|
|
35
|
+
"oclif": "^4.14.36",
|
|
36
|
+
"sinon": "^19",
|
|
38
37
|
"ts-node": "10.x",
|
|
39
|
-
"typescript": "
|
|
38
|
+
"typescript": "^5"
|
|
40
39
|
},
|
|
41
40
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
41
|
+
"node": ">= 20.x"
|
|
43
42
|
},
|
|
44
43
|
"files": [
|
|
45
|
-
"/
|
|
46
|
-
"/oclif.manifest.json"
|
|
44
|
+
"/dist"
|
|
47
45
|
],
|
|
48
46
|
"homepage": "https://github.com/heroku/heroku-cli-plugin-mtls",
|
|
49
47
|
"keywords": [
|
|
50
|
-
"
|
|
48
|
+
"heroku-plugin",
|
|
49
|
+
"oclif"
|
|
51
50
|
],
|
|
52
51
|
"license": "MIT",
|
|
53
52
|
"oclif": {
|
|
54
|
-
"commands": "./lib/commands",
|
|
55
53
|
"bin": "heroku",
|
|
54
|
+
"commands": "./dist/commands",
|
|
56
55
|
"devPlugins": [
|
|
57
56
|
"@oclif/plugin-help"
|
|
58
57
|
]
|
|
@@ -62,8 +61,10 @@
|
|
|
62
61
|
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
63
62
|
"lint:fix": "yarn run lint -- --fix",
|
|
64
63
|
"posttest": "yarn run lint",
|
|
65
|
-
"
|
|
64
|
+
"prepack": "yarn run build",
|
|
65
|
+
"build": "rm -rf dist && tsc -b && oclif manifest && oclif readme && mv oclif.manifest.json ./dist/oclif.manifest.json && cp README.md ./dist/README.md",
|
|
66
66
|
"test": "nyc --extension .ts mocha --config test/mocharc.json --forbid-only \"test/**/*.test.ts\"",
|
|
67
|
-
"
|
|
67
|
+
"test:local": "nyc --extension .ts mocha --config test/mocharc.json \"test/**/*.test.ts\"",
|
|
68
|
+
"version": "oclif readme && git add README.md"
|
|
68
69
|
}
|
|
69
70
|
}
|
package/lib/README.md
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
# Heroku CLI MTLS Plugin
|
|
2
|
-
|
|
3
|
-
[](https://oclif.io)
|
|
4
|
-

|
|
5
|
-
|
|
6
|
-
<!-- toc -->
|
|
7
|
-
* [Heroku CLI MTLS Plugin](#heroku-cli-mtls-plugin)
|
|
8
|
-
* [Installation](#installation)
|
|
9
|
-
* [Commands](#commands)
|
|
10
|
-
<!-- tocstop -->
|
|
11
|
-
# Installation
|
|
12
|
-
```sh-session
|
|
13
|
-
$ heroku plugins:install @heroku-cli/plugin-mtls
|
|
14
|
-
```
|
|
15
|
-
# Commands
|
|
16
|
-
<!-- commands -->
|
|
17
|
-
* [`heroku data:mtls [ADDON]`](#heroku-datamtls-addon)
|
|
18
|
-
* [`heroku data:mtls:certificates [ADDON]`](#heroku-datamtlscertificates-addon)
|
|
19
|
-
* [`heroku data:mtls:certificates:create [ADDON]`](#heroku-datamtlscertificatescreate-addon)
|
|
20
|
-
* [`heroku data:mtls:certificates:delete [ADDON]`](#heroku-datamtlscertificatesdelete-addon)
|
|
21
|
-
* [`heroku data:mtls:certificates:download [ADDON]`](#heroku-datamtlscertificatesdownload-addon)
|
|
22
|
-
* [`heroku data:mtls:certificates:get [ADDON]`](#heroku-datamtlscertificatesget-addon)
|
|
23
|
-
* [`heroku data:mtls:create [ADDON]`](#heroku-datamtlscreate-addon)
|
|
24
|
-
* [`heroku data:mtls:destroy [ADDON]`](#heroku-datamtlsdestroy-addon)
|
|
25
|
-
* [`heroku data:mtls:ip-rules [ADDON]`](#heroku-datamtlsip-rules-addon)
|
|
26
|
-
* [`heroku data:mtls:ip-rules:create [ADDON]`](#heroku-datamtlsip-rulescreate-addon)
|
|
27
|
-
* [`heroku data:mtls:ip-rules:delete [ADDON]`](#heroku-datamtlsip-rulesdelete-addon)
|
|
28
|
-
* [`heroku data:mtls:ip-rules:get [ADDON]`](#heroku-datamtlsip-rulesget-addon)
|
|
29
|
-
|
|
30
|
-
## `heroku data:mtls [ADDON]`
|
|
31
|
-
|
|
32
|
-
get the status of MTLS for your addon
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
USAGE
|
|
36
|
-
$ heroku data:mtls [ADDON]
|
|
37
|
-
|
|
38
|
-
OPTIONS
|
|
39
|
-
-a, --app=app (required) app to run command against
|
|
40
|
-
|
|
41
|
-
EXAMPLE
|
|
42
|
-
$ heroku data:mtls postgresql-sushi-12345
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
_See code: [src/commands/data/mtls/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/index.ts)_
|
|
46
|
-
|
|
47
|
-
## `heroku data:mtls:certificates [ADDON]`
|
|
48
|
-
|
|
49
|
-
get the certificates for your MTLS enabled addon
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
USAGE
|
|
53
|
-
$ heroku data:mtls:certificates [ADDON]
|
|
54
|
-
|
|
55
|
-
OPTIONS
|
|
56
|
-
-a, --app=app (required) app to run command against
|
|
57
|
-
|
|
58
|
-
EXAMPLE
|
|
59
|
-
$ heroku data:mtls:ip-rules postgresql-sushi-12345
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
_See code: [src/commands/data/mtls/certificates/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/certificates/index.ts)_
|
|
63
|
-
|
|
64
|
-
## `heroku data:mtls:certificates:create [ADDON]`
|
|
65
|
-
|
|
66
|
-
create a new certificate for your MTLS enabled addon
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
USAGE
|
|
70
|
-
$ heroku data:mtls:certificates:create [ADDON]
|
|
71
|
-
|
|
72
|
-
OPTIONS
|
|
73
|
-
-a, --app=app (required) app to run command against
|
|
74
|
-
|
|
75
|
-
EXAMPLE
|
|
76
|
-
$ heroku data:mtls:certificates:create postgresql-sushi-12345
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
_See code: [src/commands/data/mtls/certificates/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/certificates/create.ts)_
|
|
80
|
-
|
|
81
|
-
## `heroku data:mtls:certificates:delete [ADDON]`
|
|
82
|
-
|
|
83
|
-
delete a specific certificate for your MTLS enabled addon
|
|
84
|
-
|
|
85
|
-
```
|
|
86
|
-
USAGE
|
|
87
|
-
$ heroku data:mtls:certificates:delete [ADDON]
|
|
88
|
-
|
|
89
|
-
OPTIONS
|
|
90
|
-
-a, --app=app (required) app to run command against
|
|
91
|
-
--id=id (required) id of certificate
|
|
92
|
-
|
|
93
|
-
EXAMPLE
|
|
94
|
-
$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
_See code: [src/commands/data/mtls/certificates/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/certificates/delete.ts)_
|
|
98
|
-
|
|
99
|
-
## `heroku data:mtls:certificates:download [ADDON]`
|
|
100
|
-
|
|
101
|
-
download your certificate bundle for your mTLS addon
|
|
102
|
-
|
|
103
|
-
```
|
|
104
|
-
USAGE
|
|
105
|
-
$ heroku data:mtls:certificates:download [ADDON]
|
|
106
|
-
|
|
107
|
-
OPTIONS
|
|
108
|
-
-a, --app=app (required) app to run command against
|
|
109
|
-
--dir=dir directory to download files to. defaults to HOME:/.postgresql
|
|
110
|
-
--id=id ID of certificate to download
|
|
111
|
-
--prefix=prefix (required) prefix to put in front of downloaded file names
|
|
112
|
-
|
|
113
|
-
EXAMPLES
|
|
114
|
-
$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id "3559a4df-2c82-4473-86cf-181310a6ef4f"
|
|
115
|
-
$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id "3559a4df-2c82-4473-86cf-181310a6ef4f" --dir
|
|
116
|
-
"./folder"
|
|
117
|
-
$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id "3559a4df-2c82-4473-86cf-181310a6ef4f --prefix
|
|
118
|
-
"prefix_"
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
_See code: [src/commands/data/mtls/certificates/download.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/certificates/download.ts)_
|
|
122
|
-
|
|
123
|
-
## `heroku data:mtls:certificates:get [ADDON]`
|
|
124
|
-
|
|
125
|
-
get a specific certificate for your MTLS enabled addon
|
|
126
|
-
|
|
127
|
-
```
|
|
128
|
-
USAGE
|
|
129
|
-
$ heroku data:mtls:certificates:get [ADDON]
|
|
130
|
-
|
|
131
|
-
OPTIONS
|
|
132
|
-
-a, --app=app (required) app to run command against
|
|
133
|
-
--id=id (required) id of IP Rule
|
|
134
|
-
|
|
135
|
-
EXAMPLE
|
|
136
|
-
$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
_See code: [src/commands/data/mtls/certificates/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/certificates/get.ts)_
|
|
140
|
-
|
|
141
|
-
## `heroku data:mtls:create [ADDON]`
|
|
142
|
-
|
|
143
|
-
enable MTLS for your addon
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
USAGE
|
|
147
|
-
$ heroku data:mtls:create [ADDON]
|
|
148
|
-
|
|
149
|
-
OPTIONS
|
|
150
|
-
-a, --app=app (required) app to run command against
|
|
151
|
-
|
|
152
|
-
EXAMPLE
|
|
153
|
-
$ heroku data:mtls:create postgresql-sushi-12345
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
_See code: [src/commands/data/mtls/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/create.ts)_
|
|
157
|
-
|
|
158
|
-
## `heroku data:mtls:destroy [ADDON]`
|
|
159
|
-
|
|
160
|
-
destroy MTLS configuration on your addon
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
USAGE
|
|
164
|
-
$ heroku data:mtls:destroy [ADDON]
|
|
165
|
-
|
|
166
|
-
OPTIONS
|
|
167
|
-
-a, --app=app (required) app to run command against
|
|
168
|
-
|
|
169
|
-
ALIASES
|
|
170
|
-
$ heroku data:mtls:delete
|
|
171
|
-
|
|
172
|
-
EXAMPLE
|
|
173
|
-
$ heroku data:mtls:destroy postgresql-sushi-12345
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
_See code: [src/commands/data/mtls/destroy.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/destroy.ts)_
|
|
177
|
-
|
|
178
|
-
## `heroku data:mtls:ip-rules [ADDON]`
|
|
179
|
-
|
|
180
|
-
get the IP Rules for your MTLS enabled addon
|
|
181
|
-
|
|
182
|
-
```
|
|
183
|
-
USAGE
|
|
184
|
-
$ heroku data:mtls:ip-rules [ADDON]
|
|
185
|
-
|
|
186
|
-
OPTIONS
|
|
187
|
-
-a, --app=app (required) app to run command against
|
|
188
|
-
|
|
189
|
-
EXAMPLE
|
|
190
|
-
$ heroku data:mtls:ip-rules postgresql-sushi-12345
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
_See code: [src/commands/data/mtls/ip-rules/index.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/ip-rules/index.ts)_
|
|
194
|
-
|
|
195
|
-
## `heroku data:mtls:ip-rules:create [ADDON]`
|
|
196
|
-
|
|
197
|
-
create an IP Rule for your MTLS enabled addon
|
|
198
|
-
|
|
199
|
-
```
|
|
200
|
-
USAGE
|
|
201
|
-
$ heroku data:mtls:ip-rules:create [ADDON]
|
|
202
|
-
|
|
203
|
-
OPTIONS
|
|
204
|
-
-a, --app=app (required) app to run command against
|
|
205
|
-
--cidr=cidr (required)
|
|
206
|
-
--description=description
|
|
207
|
-
|
|
208
|
-
EXAMPLE
|
|
209
|
-
$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr "1.2.3.4/32" --description "home IP address"
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
_See code: [src/commands/data/mtls/ip-rules/create.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/ip-rules/create.ts)_
|
|
213
|
-
|
|
214
|
-
## `heroku data:mtls:ip-rules:delete [ADDON]`
|
|
215
|
-
|
|
216
|
-
delete a specific IP Rule for your MTLS enabled addon
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
USAGE
|
|
220
|
-
$ heroku data:mtls:ip-rules:delete [ADDON]
|
|
221
|
-
|
|
222
|
-
OPTIONS
|
|
223
|
-
-a, --app=app (required) app to run command against
|
|
224
|
-
--cidr=cidr cidr of IP Rule
|
|
225
|
-
--id=id id of IP Rule
|
|
226
|
-
|
|
227
|
-
EXAMPLE
|
|
228
|
-
$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
_See code: [src/commands/data/mtls/ip-rules/delete.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/ip-rules/delete.ts)_
|
|
232
|
-
|
|
233
|
-
## `heroku data:mtls:ip-rules:get [ADDON]`
|
|
234
|
-
|
|
235
|
-
get a specific IP Rule for your MTLS enabled addon
|
|
236
|
-
|
|
237
|
-
```
|
|
238
|
-
USAGE
|
|
239
|
-
$ heroku data:mtls:ip-rules:get [ADDON]
|
|
240
|
-
|
|
241
|
-
OPTIONS
|
|
242
|
-
-a, --app=app (required) app to run command against
|
|
243
|
-
--id=id (required) id of IP Rule
|
|
244
|
-
|
|
245
|
-
EXAMPLE
|
|
246
|
-
$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
_See code: [src/commands/data/mtls/ip-rules/get.ts](https://github.com/heroku/heroku-cli-plugin-mtls/blob/v0.9.2/src/commands/data/mtls/ip-rules/get.ts)_
|
|
250
|
-
<!-- commandsstop -->
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSCertificateCreate extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
};
|
|
12
|
-
run(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const color_1 = require("@heroku-cli/color");
|
|
4
|
-
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const cli_ux_1 = require("cli-ux");
|
|
6
|
-
const base_1 = require("../../../../base");
|
|
7
|
-
const fetcher_1 = require("../../../../lib/fetcher");
|
|
8
|
-
class MTLSCertificateCreate extends base_1.default {
|
|
9
|
-
async run() {
|
|
10
|
-
const { args, flags } = this.parse(MTLSCertificateCreate);
|
|
11
|
-
const addon = await (0, 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.color.cyan(addon.name)}`);
|
|
16
|
-
const { body: res } = await this.shogun.post(`${addon.endpoint}/certificates`, this.shogun.defaults);
|
|
17
|
-
cli_ux_1.cli.action.stop();
|
|
18
|
-
cli_ux_1.cli.styledObject(res);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = MTLSCertificateCreate;
|
|
22
|
-
MTLSCertificateCreate.args = [
|
|
23
|
-
{ name: 'addon' }
|
|
24
|
-
];
|
|
25
|
-
MTLSCertificateCreate.description = 'create a new certificate for your MTLS enabled addon';
|
|
26
|
-
MTLSCertificateCreate.examples = [
|
|
27
|
-
'$ heroku data:mtls:certificates:create postgresql-sushi-12345'
|
|
28
|
-
];
|
|
29
|
-
MTLSCertificateCreate.flags = {
|
|
30
|
-
app: command_1.flags.app({ required: true })
|
|
31
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSCertificateDelete extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
id: flags.IOptionFlag<string>;
|
|
12
|
-
};
|
|
13
|
-
run(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const color_1 = require("@heroku-cli/color");
|
|
4
|
-
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const cli_ux_1 = require("cli-ux");
|
|
6
|
-
const base_1 = require("../../../../base");
|
|
7
|
-
const fetcher_1 = require("../../../../lib/fetcher");
|
|
8
|
-
class MTLSCertificateDelete extends base_1.default {
|
|
9
|
-
async run() {
|
|
10
|
-
const { args, flags } = this.parse(MTLSCertificateDelete);
|
|
11
|
-
const addon = await (0, 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.color.cyan(addon.name)}`);
|
|
16
|
-
await this.shogun.delete(`${addon.endpoint}/certificates/${flags.id}`, this.shogun.defaults);
|
|
17
|
-
cli_ux_1.cli.action.stop();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = MTLSCertificateDelete;
|
|
21
|
-
MTLSCertificateDelete.args = [
|
|
22
|
-
{ name: 'addon' }
|
|
23
|
-
];
|
|
24
|
-
MTLSCertificateDelete.description = 'delete a specific certificate for your MTLS enabled addon';
|
|
25
|
-
MTLSCertificateDelete.examples = [
|
|
26
|
-
'$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
|
|
27
|
-
];
|
|
28
|
-
MTLSCertificateDelete.flags = {
|
|
29
|
-
app: command_1.flags.app({ required: true }),
|
|
30
|
-
id: command_1.flags.string({ required: true, description: 'id of certificate' })
|
|
31
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSCertificateDownload extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
dir: flags.IOptionFlag<string | undefined>;
|
|
12
|
-
id: flags.IOptionFlag<string | undefined>;
|
|
13
|
-
prefix: flags.IOptionFlag<string>;
|
|
14
|
-
};
|
|
15
|
-
run(): Promise<void>;
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSCertificateGet extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
id: flags.IOptionFlag<string>;
|
|
12
|
-
};
|
|
13
|
-
run(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const cli_ux_1 = require("cli-ux");
|
|
5
|
-
const base_1 = require("../../../../base");
|
|
6
|
-
const fetcher_1 = require("../../../../lib/fetcher");
|
|
7
|
-
class MTLSCertificateGet extends base_1.default {
|
|
8
|
-
async run() {
|
|
9
|
-
const { args, flags } = this.parse(MTLSCertificateGet);
|
|
10
|
-
const addon = await (0, 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);
|
|
15
|
-
delete res.private_key;
|
|
16
|
-
delete res.certificate_with_chain;
|
|
17
|
-
cli_ux_1.cli.styledObject(res);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = MTLSCertificateGet;
|
|
21
|
-
MTLSCertificateGet.args = [
|
|
22
|
-
{ name: 'addon' }
|
|
23
|
-
];
|
|
24
|
-
MTLSCertificateGet.description = 'get a specific certificate for your MTLS enabled addon';
|
|
25
|
-
MTLSCertificateGet.examples = [
|
|
26
|
-
'$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
|
|
27
|
-
];
|
|
28
|
-
MTLSCertificateGet.flags = {
|
|
29
|
-
app: command_1.flags.app({ required: true }),
|
|
30
|
-
id: command_1.flags.string({ required: true, description: 'id of IP Rule' })
|
|
31
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSCertificatesIndex extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
};
|
|
12
|
-
run(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../base';
|
|
3
|
-
export default class MTLSCreate extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
};
|
|
12
|
-
run(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const color_1 = require("@heroku-cli/color");
|
|
4
|
-
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const cli_ux_1 = require("cli-ux");
|
|
6
|
-
const base_1 = require("../../../base");
|
|
7
|
-
const fetcher_1 = require("../../../lib/fetcher");
|
|
8
|
-
class MTLSCreate extends base_1.default {
|
|
9
|
-
async run() {
|
|
10
|
-
const { args, flags } = this.parse(MTLSCreate);
|
|
11
|
-
const addon = await (0, 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');
|
|
14
|
-
}
|
|
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.color.cyan(addon.name)}`);
|
|
17
|
-
try {
|
|
18
|
-
const { body: res } = await this.shogun.post(addon.endpoint, Object.assign(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');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.default = MTLSCreate;
|
|
33
|
-
MTLSCreate.args = [
|
|
34
|
-
{ name: 'addon' },
|
|
35
|
-
];
|
|
36
|
-
MTLSCreate.description = 'enable MTLS for your addon';
|
|
37
|
-
MTLSCreate.examples = [
|
|
38
|
-
'$ heroku data:mtls:create postgresql-sushi-12345'
|
|
39
|
-
];
|
|
40
|
-
MTLSCreate.flags = {
|
|
41
|
-
app: command_1.flags.app({ required: true })
|
|
42
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../base';
|
|
3
|
-
export default class MTLSDestroy extends BaseCommand {
|
|
4
|
-
static aliases: string[];
|
|
5
|
-
static args: {
|
|
6
|
-
name: string;
|
|
7
|
-
}[];
|
|
8
|
-
static description: string;
|
|
9
|
-
static examples: string[];
|
|
10
|
-
static flags: {
|
|
11
|
-
app: flags.IOptionFlag<string>;
|
|
12
|
-
};
|
|
13
|
-
run(): Promise<void>;
|
|
14
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const color_1 = require("@heroku-cli/color");
|
|
4
|
-
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const cli_ux_1 = require("cli-ux");
|
|
6
|
-
const base_1 = require("../../../base");
|
|
7
|
-
const fetcher_1 = require("../../../lib/fetcher");
|
|
8
|
-
class MTLSDestroy extends base_1.default {
|
|
9
|
-
async run() {
|
|
10
|
-
const { args, flags } = this.parse(MTLSDestroy);
|
|
11
|
-
const addon = await (0, 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.color.cyan(addon.name)}`);
|
|
16
|
-
await this.shogun.delete(addon.endpoint, this.shogun.defaults);
|
|
17
|
-
cli_ux_1.cli.action.stop();
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = MTLSDestroy;
|
|
21
|
-
MTLSDestroy.aliases = ['data:mtls:delete'];
|
|
22
|
-
MTLSDestroy.args = [
|
|
23
|
-
{ name: 'addon' },
|
|
24
|
-
];
|
|
25
|
-
MTLSDestroy.description = 'destroy MTLS configuration on your addon';
|
|
26
|
-
MTLSDestroy.examples = [
|
|
27
|
-
'$ heroku data:mtls:destroy postgresql-sushi-12345'
|
|
28
|
-
];
|
|
29
|
-
MTLSDestroy.flags = {
|
|
30
|
-
app: command_1.flags.app({ required: true })
|
|
31
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../base';
|
|
3
|
-
export default class MTLSIndex extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
};
|
|
12
|
-
run(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
|
-
import BaseCommand from '../../../../base';
|
|
3
|
-
export default class MTLSIPCreate extends BaseCommand {
|
|
4
|
-
static args: {
|
|
5
|
-
name: string;
|
|
6
|
-
}[];
|
|
7
|
-
static description: string;
|
|
8
|
-
static examples: string[];
|
|
9
|
-
static flags: {
|
|
10
|
-
app: flags.IOptionFlag<string>;
|
|
11
|
-
cidr: flags.IOptionFlag<string>;
|
|
12
|
-
description: flags.IOptionFlag<string | undefined>;
|
|
13
|
-
};
|
|
14
|
-
run(): Promise<void>;
|
|
15
|
-
}
|