@adobe/aio-cli-plugin-certificate 0.2.1 → 0.4.0-pre.2022-06-15.0957a096
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 +43 -34
- package/oclif.manifest.json +1 -1
- package/package.json +12 -18
- package/src/certificate.js +38 -0
- package/src/commands/certificate/fingerprint.js +52 -0
- package/src/commands/certificate/generate.js +11 -11
- package/src/commands/certificate/index.js +3 -4
- package/src/commands/certificate/verify.js +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://npmjs.org/package/@adobe/aio-cli-plugin-certificate)
|
|
2
2
|
[](https://npmjs.org/package/@adobe/aio-cli-plugin-certificate)
|
|
3
|
-
[](https://github.com/adobe/aio-cli-plugin-certificate/actions/workflows/node.js.yml)
|
|
4
4
|
[](https://codecov.io/gh/adobe/aio-cli-plugin-certificate/)
|
|
5
5
|
|
|
6
6
|
|
|
@@ -26,6 +26,7 @@ $ aio certificate --help
|
|
|
26
26
|
# Commands
|
|
27
27
|
<!-- commands -->
|
|
28
28
|
* [`aio certificate`](#aio-certificate)
|
|
29
|
+
* [`aio certificate:fingerprint FILE`](#aio-certificatefingerprint-file)
|
|
29
30
|
* [`aio certificate:generate`](#aio-certificategenerate)
|
|
30
31
|
* [`aio certificate:verify FILE`](#aio-certificateverify-file)
|
|
31
32
|
|
|
@@ -34,75 +35,83 @@ $ aio certificate --help
|
|
|
34
35
|
Generate or verify a certificate for use with Adobe I/O
|
|
35
36
|
|
|
36
37
|
```
|
|
37
|
-
Generate or verify a certificate for use with Adobe I/O
|
|
38
|
-
|
|
39
38
|
USAGE
|
|
40
39
|
$ aio certificate
|
|
40
|
+
|
|
41
|
+
DESCRIPTION
|
|
42
|
+
Generate or verify a certificate for use with Adobe I/O
|
|
41
43
|
```
|
|
42
44
|
|
|
43
|
-
_See code: [src/commands/certificate/index.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.
|
|
45
|
+
_See code: [src/commands/certificate/index.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.4.0-pre.2022-06-15.0957a096/src/commands/certificate/index.js)_
|
|
44
46
|
|
|
45
|
-
## `aio certificate:
|
|
47
|
+
## `aio certificate:fingerprint FILE`
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
Compute the fingerprint of a public key certificate for use with Adobe I/O
|
|
48
50
|
|
|
49
51
|
```
|
|
50
|
-
Generate a new private/public key pair
|
|
51
|
-
Generate a self-signed certificate to enable https:// on localhost or signing jwt payloads for interacting with Adobe services.
|
|
52
|
-
|
|
53
|
-
|
|
54
52
|
USAGE
|
|
55
|
-
$ aio certificate:
|
|
53
|
+
$ aio certificate:fingerprint [FILE]
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
-l, --locality=locality Locality, or city name
|
|
60
|
-
|
|
61
|
-
-n, --name=name [default: selfsign.localhost] Common Name: typically a host domain name, like
|
|
62
|
-
www.mysite.com
|
|
63
|
-
|
|
64
|
-
-o, --organization=organization Organization name
|
|
55
|
+
ARGUMENTS
|
|
56
|
+
FILE file path to certificate to fingerprint
|
|
65
57
|
|
|
66
|
-
|
|
58
|
+
DESCRIPTION
|
|
59
|
+
Compute the fingerprint of a public key certificate for use with Adobe I/O
|
|
60
|
+
```
|
|
67
61
|
|
|
68
|
-
|
|
62
|
+
_See code: [src/commands/certificate/fingerprint.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.4.0-pre.2022-06-15.0957a096/src/commands/certificate/fingerprint.js)_
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
## `aio certificate:generate`
|
|
71
65
|
|
|
72
|
-
|
|
66
|
+
Generate a new private/public key pair
|
|
73
67
|
|
|
74
|
-
|
|
68
|
+
```
|
|
69
|
+
USAGE
|
|
70
|
+
$ aio certificate:generate [--keyout <value>] [--out <value>] [-n <value>] [-c <value>] [-s <value>] [-l <value>] [-o
|
|
71
|
+
<value>] [-u <value>] [--days <value>]
|
|
72
|
+
|
|
73
|
+
FLAGS
|
|
74
|
+
-c, --country=<value> Country Name
|
|
75
|
+
-l, --locality=<value> Locality, or city name
|
|
76
|
+
-n, --name=<value> [default: selfsign.localhost] Common Name: typically a host domain name, like
|
|
77
|
+
www.mysite.com
|
|
78
|
+
-o, --organization=<value> Organization name
|
|
79
|
+
-s, --state=<value> State or Province
|
|
80
|
+
-u, --unit=<value> Organizational unit or department
|
|
81
|
+
--days=<value> [default: 365] Number of days the certificate should be valid for. (Max 365)
|
|
82
|
+
--keyout=<value> [default: private.key] file to send the key to
|
|
83
|
+
--out=<value> [default: certificate_pub.crt] output file
|
|
75
84
|
|
|
76
85
|
DESCRIPTION
|
|
77
|
-
Generate a
|
|
86
|
+
Generate a new private/public key pair
|
|
87
|
+
|
|
88
|
+
Generate a self-signed certificate to enable https:// on localhost or signing jwt payloads for interacting with Adobe
|
|
78
89
|
services.
|
|
79
90
|
```
|
|
80
91
|
|
|
81
|
-
_See code: [src/commands/certificate/generate.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.
|
|
92
|
+
_See code: [src/commands/certificate/generate.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.4.0-pre.2022-06-15.0957a096/src/commands/certificate/generate.js)_
|
|
82
93
|
|
|
83
94
|
## `aio certificate:verify FILE`
|
|
84
95
|
|
|
85
96
|
Verify a certificate for use with Adobe I/O
|
|
86
97
|
|
|
87
98
|
```
|
|
88
|
-
Verify a certificate for use with Adobe I/O
|
|
89
|
-
Verifies that the certificate is valid, and/or will not expire in [--days] days from now.
|
|
90
|
-
|
|
91
|
-
|
|
92
99
|
USAGE
|
|
93
|
-
$ aio certificate:verify FILE
|
|
100
|
+
$ aio certificate:verify [FILE] [--days <value>]
|
|
94
101
|
|
|
95
102
|
ARGUMENTS
|
|
96
103
|
FILE file path to certificate to verify
|
|
97
104
|
|
|
98
|
-
|
|
99
|
-
--days
|
|
105
|
+
FLAGS
|
|
106
|
+
--days=<value> +- is certificate valid in --days
|
|
100
107
|
|
|
101
108
|
DESCRIPTION
|
|
109
|
+
Verify a certificate for use with Adobe I/O
|
|
110
|
+
|
|
102
111
|
Verifies that the certificate is valid, and/or will not expire in [--days] days from now.
|
|
103
112
|
```
|
|
104
113
|
|
|
105
|
-
_See code: [src/commands/certificate/verify.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.
|
|
114
|
+
_See code: [src/commands/certificate/verify.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/0.4.0-pre.2022-06-15.0957a096/src/commands/certificate/verify.js)_
|
|
106
115
|
<!-- commandsstop -->
|
|
107
116
|
|
|
108
117
|
## Contributing
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.4.0-pre.2022-06-15.0957a096","commands":{"certificate:fingerprint":{"id":"certificate:fingerprint","description":"Compute the fingerprint of a public key certificate for use with Adobe I/O","strict":true,"pluginName":"@adobe/aio-cli-plugin-certificate","pluginAlias":"@adobe/aio-cli-plugin-certificate","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"file","description":"file path to certificate to fingerprint","required":true}]},"certificate:generate":{"id":"certificate:generate","description":"Generate a new private/public key pair\nGenerate a self-signed certificate to enable https:// on localhost or signing jwt payloads for interacting with Adobe services.\n","strict":true,"pluginName":"@adobe/aio-cli-plugin-certificate","pluginAlias":"@adobe/aio-cli-plugin-certificate","pluginType":"core","aliases":[],"flags":{"keyout":{"name":"keyout","type":"option","description":"file to send the key to","multiple":false,"default":"private.key"},"out":{"name":"out","type":"option","description":"output file","multiple":false,"default":"certificate_pub.crt"},"name":{"name":"name","type":"option","char":"n","description":"Common Name: typically a host domain name, like www.mysite.com","multiple":false,"default":"selfsign.localhost"},"country":{"name":"country","type":"option","char":"c","description":"Country Name","multiple":false},"state":{"name":"state","type":"option","char":"s","description":"State or Province","multiple":false},"locality":{"name":"locality","type":"option","char":"l","description":"Locality, or city name","multiple":false},"organization":{"name":"organization","type":"option","char":"o","description":"Organization name","multiple":false},"unit":{"name":"unit","type":"option","char":"u","description":"Organizational unit or department","multiple":false},"days":{"name":"days","type":"option","description":"Number of days the certificate should be valid for. (Max 365)","multiple":false,"default":365}},"args":[],"_globalFlags":{}},"certificate":{"id":"certificate","description":"Generate or verify a certificate for use with Adobe I/O","strict":true,"pluginName":"@adobe/aio-cli-plugin-certificate","pluginAlias":"@adobe/aio-cli-plugin-certificate","pluginType":"core","aliases":[],"flags":{},"args":[]},"certificate:verify":{"id":"certificate:verify","description":"Verify a certificate for use with Adobe I/O\nVerifies that the certificate is valid, and/or will not expire in [--days] days from now.\n","strict":true,"pluginName":"@adobe/aio-cli-plugin-certificate","pluginAlias":"@adobe/aio-cli-plugin-certificate","pluginType":"core","aliases":[],"flags":{"days":{"name":"days","type":"option","description":"+- is certificate valid in --days","multiple":false}},"args":[{"name":"file","description":"file path to certificate to verify","required":true}],"_globalFlags":{}}}}
|
package/package.json
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-cli-plugin-certificate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-pre.2022-06-15.0957a096",
|
|
4
4
|
"description": "Generate and validate private certs, and public key pairs for use with Adobe IO Console",
|
|
5
5
|
"repository": "adobe/aio-cli-plugin-certificate",
|
|
6
6
|
"homepage": "https://github.com/adobe/aio-cli-plugin-certificate",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@oclif/
|
|
9
|
-
"
|
|
10
|
-
"@oclif/errors": "^1.1.2",
|
|
11
|
-
"debug": "^4.1.0",
|
|
8
|
+
"@oclif/core": "^1.9.0",
|
|
9
|
+
"debug": "^4.3.3",
|
|
12
10
|
"fs-extra": "^9.0.0",
|
|
13
|
-
"node-forge": "^
|
|
11
|
+
"node-forge": "^1.3.0"
|
|
14
12
|
},
|
|
15
13
|
"devDependencies": {
|
|
16
|
-
"@oclif/dev-cli": "^1.21.3",
|
|
17
|
-
"@oclif/plugin-help": "^2.1.4",
|
|
18
|
-
"@oclif/test": "^1",
|
|
19
14
|
"codecov": "^3.2.0",
|
|
20
15
|
"eslint": "^6.8.0",
|
|
21
|
-
"eslint-config-oclif": "^
|
|
16
|
+
"eslint-config-oclif": "^4.0.0",
|
|
22
17
|
"eslint-config-standard": "^14.1.0",
|
|
23
18
|
"eslint-plugin-import": "^2.13.10",
|
|
24
19
|
"eslint-plugin-jest": "^23.6.0",
|
|
@@ -28,10 +23,11 @@
|
|
|
28
23
|
"jest": "^24.1.0",
|
|
29
24
|
"jest-junit": "^10.0.0",
|
|
30
25
|
"jest-resolve": "^26.0.0",
|
|
26
|
+
"oclif": "^3.0.1",
|
|
31
27
|
"stdout-stderr": "^0.1.9"
|
|
32
28
|
},
|
|
33
29
|
"engines": {
|
|
34
|
-
"node": "
|
|
30
|
+
"node": "^14.18 || ^16.13 || >=18"
|
|
35
31
|
},
|
|
36
32
|
"files": [
|
|
37
33
|
"/oclif.manifest.json",
|
|
@@ -46,9 +42,6 @@
|
|
|
46
42
|
"oclif": {
|
|
47
43
|
"commands": "./src/commands",
|
|
48
44
|
"bin": "aio",
|
|
49
|
-
"devPlugins": [
|
|
50
|
-
"@oclif/plugin-help"
|
|
51
|
-
],
|
|
52
45
|
"repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>"
|
|
53
46
|
},
|
|
54
47
|
"main": "src/certificate.js",
|
|
@@ -56,9 +49,9 @@
|
|
|
56
49
|
"posttest": "eslint src test",
|
|
57
50
|
"test": "npm run unit-tests",
|
|
58
51
|
"unit-tests": "jest --ci",
|
|
59
|
-
"prepack": "oclif
|
|
52
|
+
"prepack": "oclif manifest && oclif readme",
|
|
60
53
|
"postpack": "rm -f oclif.manifest.json",
|
|
61
|
-
"version": "oclif
|
|
54
|
+
"version": "oclif readme && git add README.md"
|
|
62
55
|
},
|
|
63
56
|
"jest": {
|
|
64
57
|
"collectCoverage": true,
|
|
@@ -76,5 +69,6 @@
|
|
|
76
69
|
"setupFilesAfterEnv": [
|
|
77
70
|
"./test/jest.setup.js"
|
|
78
71
|
]
|
|
79
|
-
}
|
|
80
|
-
|
|
72
|
+
},
|
|
73
|
+
"prereleaseSha": "0957a09615dca816fac13e92302c0621f7cde786"
|
|
74
|
+
}
|
package/src/certificate.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe Inc. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
7
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
8
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
9
|
+
governing permissions and limitations under the License.
|
|
10
|
+
*/
|
|
11
|
+
|
|
1
12
|
const debug = require('debug')('aio-cli-plugin-certificate:helpers')
|
|
2
13
|
const forge = require('node-forge')
|
|
3
14
|
const pki = forge.pki
|
|
15
|
+
const asn1 = forge.asn1
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Computes the SHA-1 digest of the entire DER-encoded x.509 certificate
|
|
19
|
+
* contained in the provided PEM-encoded string, which gives the same result as
|
|
20
|
+
* using "openssl x509 -fingerprint", except without delimiters and in
|
|
21
|
+
* all lowercase.
|
|
22
|
+
*
|
|
23
|
+
* @param {string|Buffer} pemCert PEM-encoded sting containing x509 certificate
|
|
24
|
+
* @returns {{certificateFingerprint: string}} x509 fingerprint
|
|
25
|
+
*/
|
|
26
|
+
function fingerprint (pemCert) {
|
|
27
|
+
const cert = pki.certificateFromPem(pemCert)
|
|
28
|
+
const bytes = asn1.toDer(pki.certificateToAsn1(cert)).getBytes()
|
|
29
|
+
const md = forge.md.sha1.create()
|
|
30
|
+
md.start()
|
|
31
|
+
md.update(bytes)
|
|
32
|
+
return { certificateFingerprint: md.digest().toHex() }
|
|
33
|
+
}
|
|
4
34
|
|
|
5
35
|
/**
|
|
6
36
|
openssl req -x509 -sha256 -nodes -days 365 -subj "/C=US/" -newkey rsa:2048 -keyout private.key -out certificate_pub.crt
|
|
@@ -90,6 +120,13 @@ function generate (commonName, days, /* istanbul ignore next */ attributes = {})
|
|
|
90
120
|
codeSigning: true,
|
|
91
121
|
emailProtection: true,
|
|
92
122
|
timeStamping: true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'subjectAltName',
|
|
126
|
+
altNames: [{
|
|
127
|
+
type: 2, // DNS
|
|
128
|
+
value: commonName
|
|
129
|
+
}]
|
|
93
130
|
}
|
|
94
131
|
])
|
|
95
132
|
|
|
@@ -128,6 +165,7 @@ function verify (pemCert) {
|
|
|
128
165
|
}
|
|
129
166
|
|
|
130
167
|
module.exports = {
|
|
168
|
+
fingerprint,
|
|
131
169
|
generate,
|
|
132
170
|
verify
|
|
133
171
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2019 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { Command } = require('@oclif/core')
|
|
14
|
+
const fs = require('fs-extra')
|
|
15
|
+
const debug = require('debug')('aio-cli-plugin-certificate:fingerprint')
|
|
16
|
+
|
|
17
|
+
const cert = require('../../certificate')
|
|
18
|
+
|
|
19
|
+
class FingerprintCommand extends Command {
|
|
20
|
+
async run () {
|
|
21
|
+
const { args } = await this.parse(FingerprintCommand)
|
|
22
|
+
|
|
23
|
+
if (!fs.existsSync(args.file)) {
|
|
24
|
+
this.error('input file does not exist: ' + args.file)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
const pemCert = fs.readFileSync(args.file).toString()
|
|
29
|
+
debug('fingerprinting cert from pem: ', pemCert)
|
|
30
|
+
// this will throw if file is not a valid pem content
|
|
31
|
+
const res = cert.fingerprint(pemCert)
|
|
32
|
+
|
|
33
|
+
this.log(res.certificateFingerprint)
|
|
34
|
+
return res.certificateFingerprint
|
|
35
|
+
} catch (err) {
|
|
36
|
+
debug('error fingerprinting certificate: ', err)
|
|
37
|
+
this.error(err.message)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
FingerprintCommand.description = 'Compute the fingerprint of a public key certificate for use with Adobe I/O'
|
|
43
|
+
|
|
44
|
+
FingerprintCommand.args = [
|
|
45
|
+
{
|
|
46
|
+
name: 'file',
|
|
47
|
+
required: true,
|
|
48
|
+
description: 'file path to certificate to fingerprint'
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
module.exports = FingerprintCommand
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const { Command,
|
|
13
|
+
const { Command, Flags } = require('@oclif/core')
|
|
14
14
|
const fs = require('fs-extra')
|
|
15
15
|
const debug = require('debug')('aio-cli-plugin-certificate:generate')
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ const cert = require('../../certificate')
|
|
|
18
18
|
|
|
19
19
|
class GenerateCommand extends Command {
|
|
20
20
|
async run () {
|
|
21
|
-
const { flags } = this.parse(GenerateCommand)
|
|
21
|
+
const { flags } = await this.parse(GenerateCommand)
|
|
22
22
|
if (fs.existsSync(flags.keyout)) {
|
|
23
23
|
this.error('--keyout file exists: ' + flags.keyout)
|
|
24
24
|
}
|
|
@@ -40,40 +40,40 @@ Generate a self-signed certificate to enable https:// on localhost or signing jw
|
|
|
40
40
|
`
|
|
41
41
|
|
|
42
42
|
GenerateCommand.flags = {
|
|
43
|
-
keyout:
|
|
43
|
+
keyout: Flags.string({
|
|
44
44
|
description: 'file to send the key to',
|
|
45
45
|
default: 'private.key'
|
|
46
46
|
}),
|
|
47
|
-
out:
|
|
47
|
+
out: Flags.string({
|
|
48
48
|
description: 'output file',
|
|
49
49
|
default: 'certificate_pub.crt'
|
|
50
50
|
}),
|
|
51
|
-
name:
|
|
51
|
+
name: Flags.string({
|
|
52
52
|
char: 'n',
|
|
53
53
|
description: 'Common Name: typically a host domain name, like www.mysite.com',
|
|
54
54
|
default: 'selfsign.localhost'
|
|
55
55
|
}),
|
|
56
|
-
country:
|
|
56
|
+
country: Flags.string({
|
|
57
57
|
char: 'c',
|
|
58
58
|
description: 'Country Name'
|
|
59
59
|
}),
|
|
60
|
-
state:
|
|
60
|
+
state: Flags.string({
|
|
61
61
|
char: 's',
|
|
62
62
|
description: 'State or Province'
|
|
63
63
|
}),
|
|
64
|
-
locality:
|
|
64
|
+
locality: Flags.string({
|
|
65
65
|
char: 'l',
|
|
66
66
|
description: 'Locality, or city name'
|
|
67
67
|
}),
|
|
68
|
-
organization:
|
|
68
|
+
organization: Flags.string({
|
|
69
69
|
char: 'o',
|
|
70
70
|
description: 'Organization name'
|
|
71
71
|
}),
|
|
72
|
-
unit:
|
|
72
|
+
unit: Flags.string({
|
|
73
73
|
char: 'u',
|
|
74
74
|
description: 'Organizational unit or department'
|
|
75
75
|
}),
|
|
76
|
-
days:
|
|
76
|
+
days: Flags.integer({
|
|
77
77
|
description: 'Number of days the certificate should be valid for. (Max 365)',
|
|
78
78
|
default: 365
|
|
79
79
|
})
|
|
@@ -10,13 +10,12 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const { Command } = require('@oclif/command')
|
|
13
|
+
const { Command, Help } = require('@oclif/core')
|
|
15
14
|
|
|
16
15
|
class AIOCommand extends Command {
|
|
17
16
|
async run () {
|
|
18
|
-
const help = new
|
|
19
|
-
help.showHelp(['certificate:generate', '--help'])
|
|
17
|
+
const help = new Help(this.config)
|
|
18
|
+
return await help.showHelp(['certificate:generate', '--help'])
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
21
|
|
|
@@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
const { Command,
|
|
13
|
+
const { Command, Flags } = require('@oclif/core')
|
|
14
14
|
const fs = require('fs-extra')
|
|
15
15
|
const debug = require('debug')('aio-cli-plugin-certificate:verify')
|
|
16
16
|
|
|
@@ -18,7 +18,7 @@ const cert = require('../../certificate')
|
|
|
18
18
|
|
|
19
19
|
class VerifyCommand extends Command {
|
|
20
20
|
async run () {
|
|
21
|
-
const { flags, args } = this.parse(VerifyCommand)
|
|
21
|
+
const { flags, args } = await this.parse(VerifyCommand)
|
|
22
22
|
|
|
23
23
|
if (!fs.existsSync(args.file)) {
|
|
24
24
|
this.error('input file does not exist: ' + args.file)
|
|
@@ -65,7 +65,7 @@ Verifies that the certificate is valid, and/or will not expire in [--days] days
|
|
|
65
65
|
`
|
|
66
66
|
|
|
67
67
|
VerifyCommand.flags = {
|
|
68
|
-
days:
|
|
68
|
+
days: Flags.integer({
|
|
69
69
|
description: '+- is certificate valid in --days'
|
|
70
70
|
})
|
|
71
71
|
}
|