@adobe/aio-cli-plugin-certificate 1.0.0 → 1.0.1-pre.2024-01-08.sha-f2646ee4
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 +13 -15
- package/oclif.manifest.json +133 -1
- package/package.json +20 -22
- package/src/certificate.js +8 -8
package/README.md
CHANGED
|
@@ -26,9 +26,9 @@ $ aio certificate --help
|
|
|
26
26
|
# Commands
|
|
27
27
|
<!-- commands -->
|
|
28
28
|
* [`aio certificate`](#aio-certificate)
|
|
29
|
-
* [`aio certificate
|
|
30
|
-
* [`aio certificate
|
|
31
|
-
* [`aio certificate
|
|
29
|
+
* [`aio certificate fingerprint FILE`](#aio-certificate-fingerprint-file)
|
|
30
|
+
* [`aio certificate generate`](#aio-certificate-generate)
|
|
31
|
+
* [`aio certificate verify FILE`](#aio-certificate-verify-file)
|
|
32
32
|
|
|
33
33
|
## `aio certificate`
|
|
34
34
|
|
|
@@ -42,15 +42,15 @@ DESCRIPTION
|
|
|
42
42
|
Generate, fingerprint, or verify a certificate for use with Adobe I/O
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
_See code: [src/commands/certificate/index.
|
|
45
|
+
_See code: [src/commands/certificate/index.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/1.0.1-pre.2024-01-08.sha-f2646ee4/src/commands/certificate/index.ts)_
|
|
46
46
|
|
|
47
|
-
## `aio certificate
|
|
47
|
+
## `aio certificate fingerprint FILE`
|
|
48
48
|
|
|
49
49
|
Compute the fingerprint of a public key certificate for use with Adobe I/O
|
|
50
50
|
|
|
51
51
|
```
|
|
52
52
|
USAGE
|
|
53
|
-
$ aio certificate
|
|
53
|
+
$ aio certificate fingerprint FILE
|
|
54
54
|
|
|
55
55
|
ARGUMENTS
|
|
56
56
|
FILE file path to certificate to fingerprint
|
|
@@ -59,15 +59,15 @@ DESCRIPTION
|
|
|
59
59
|
Compute the fingerprint of a public key certificate for use with Adobe I/O
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
_See code: [src/commands/certificate/fingerprint.
|
|
62
|
+
_See code: [src/commands/certificate/fingerprint.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/1.0.1-pre.2024-01-08.sha-f2646ee4/src/commands/certificate/fingerprint.ts)_
|
|
63
63
|
|
|
64
|
-
## `aio certificate
|
|
64
|
+
## `aio certificate generate`
|
|
65
65
|
|
|
66
66
|
Generate a new private/public key pair
|
|
67
67
|
|
|
68
68
|
```
|
|
69
69
|
USAGE
|
|
70
|
-
$ aio certificate
|
|
70
|
+
$ aio certificate generate [--keyout <value>] [--out <value>] [-n <value>] [-c <value>] [-s <value>] [-l <value>] [-o
|
|
71
71
|
<value>] [-u <value>] [--days <value>]
|
|
72
72
|
|
|
73
73
|
FLAGS
|
|
@@ -84,20 +84,19 @@ FLAGS
|
|
|
84
84
|
|
|
85
85
|
DESCRIPTION
|
|
86
86
|
Generate a new private/public key pair
|
|
87
|
-
|
|
88
87
|
Generate a self-signed certificate to enable https:// on localhost or signing jwt payloads for interacting with Adobe
|
|
89
88
|
services.
|
|
90
89
|
```
|
|
91
90
|
|
|
92
|
-
_See code: [src/commands/certificate/generate.
|
|
91
|
+
_See code: [src/commands/certificate/generate.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/1.0.1-pre.2024-01-08.sha-f2646ee4/src/commands/certificate/generate.ts)_
|
|
93
92
|
|
|
94
|
-
## `aio certificate
|
|
93
|
+
## `aio certificate verify FILE`
|
|
95
94
|
|
|
96
95
|
Verify a certificate for use with Adobe I/O
|
|
97
96
|
|
|
98
97
|
```
|
|
99
98
|
USAGE
|
|
100
|
-
$ aio certificate
|
|
99
|
+
$ aio certificate verify FILE [--days <value>]
|
|
101
100
|
|
|
102
101
|
ARGUMENTS
|
|
103
102
|
FILE file path to certificate to verify
|
|
@@ -107,11 +106,10 @@ FLAGS
|
|
|
107
106
|
|
|
108
107
|
DESCRIPTION
|
|
109
108
|
Verify a certificate for use with Adobe I/O
|
|
110
|
-
|
|
111
109
|
Verifies that the certificate is valid, and/or will not expire in [--days] days from now.
|
|
112
110
|
```
|
|
113
111
|
|
|
114
|
-
_See code: [src/commands/certificate/verify.
|
|
112
|
+
_See code: [src/commands/certificate/verify.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/1.0.1-pre.2024-01-08.sha-f2646ee4/src/commands/certificate/verify.ts)_
|
|
115
113
|
<!-- commandsstop -->
|
|
116
114
|
|
|
117
115
|
## Contributing
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,133 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.1-pre.2024-01-08.sha-f2646ee4",
|
|
3
|
+
"commands": {
|
|
4
|
+
"certificate:fingerprint": {
|
|
5
|
+
"id": "certificate:fingerprint",
|
|
6
|
+
"description": "Compute the fingerprint of a public key certificate for use with Adobe I/O",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"pluginName": "@adobe/aio-cli-plugin-certificate",
|
|
9
|
+
"pluginAlias": "@adobe/aio-cli-plugin-certificate",
|
|
10
|
+
"pluginType": "core",
|
|
11
|
+
"aliases": [],
|
|
12
|
+
"flags": {},
|
|
13
|
+
"args": {
|
|
14
|
+
"file": {
|
|
15
|
+
"name": "file",
|
|
16
|
+
"description": "file path to certificate to fingerprint",
|
|
17
|
+
"required": true
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"certificate:generate": {
|
|
22
|
+
"id": "certificate:generate",
|
|
23
|
+
"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",
|
|
24
|
+
"strict": true,
|
|
25
|
+
"pluginName": "@adobe/aio-cli-plugin-certificate",
|
|
26
|
+
"pluginAlias": "@adobe/aio-cli-plugin-certificate",
|
|
27
|
+
"pluginType": "core",
|
|
28
|
+
"aliases": [],
|
|
29
|
+
"flags": {
|
|
30
|
+
"keyout": {
|
|
31
|
+
"name": "keyout",
|
|
32
|
+
"type": "option",
|
|
33
|
+
"description": "file to send the key to",
|
|
34
|
+
"multiple": false,
|
|
35
|
+
"default": "private.key"
|
|
36
|
+
},
|
|
37
|
+
"out": {
|
|
38
|
+
"name": "out",
|
|
39
|
+
"type": "option",
|
|
40
|
+
"description": "output file",
|
|
41
|
+
"multiple": false,
|
|
42
|
+
"default": "certificate_pub.crt"
|
|
43
|
+
},
|
|
44
|
+
"name": {
|
|
45
|
+
"name": "name",
|
|
46
|
+
"type": "option",
|
|
47
|
+
"char": "n",
|
|
48
|
+
"description": "Common Name: typically a host domain name, like www.mysite.com",
|
|
49
|
+
"multiple": false,
|
|
50
|
+
"default": "selfsign.localhost"
|
|
51
|
+
},
|
|
52
|
+
"country": {
|
|
53
|
+
"name": "country",
|
|
54
|
+
"type": "option",
|
|
55
|
+
"char": "c",
|
|
56
|
+
"description": "Country Name",
|
|
57
|
+
"multiple": false
|
|
58
|
+
},
|
|
59
|
+
"state": {
|
|
60
|
+
"name": "state",
|
|
61
|
+
"type": "option",
|
|
62
|
+
"char": "s",
|
|
63
|
+
"description": "State or Province",
|
|
64
|
+
"multiple": false
|
|
65
|
+
},
|
|
66
|
+
"locality": {
|
|
67
|
+
"name": "locality",
|
|
68
|
+
"type": "option",
|
|
69
|
+
"char": "l",
|
|
70
|
+
"description": "Locality, or city name",
|
|
71
|
+
"multiple": false
|
|
72
|
+
},
|
|
73
|
+
"organization": {
|
|
74
|
+
"name": "organization",
|
|
75
|
+
"type": "option",
|
|
76
|
+
"char": "o",
|
|
77
|
+
"description": "Organization name",
|
|
78
|
+
"multiple": false
|
|
79
|
+
},
|
|
80
|
+
"unit": {
|
|
81
|
+
"name": "unit",
|
|
82
|
+
"type": "option",
|
|
83
|
+
"char": "u",
|
|
84
|
+
"description": "Organizational unit or department",
|
|
85
|
+
"multiple": false
|
|
86
|
+
},
|
|
87
|
+
"days": {
|
|
88
|
+
"name": "days",
|
|
89
|
+
"type": "option",
|
|
90
|
+
"description": "Number of days the certificate should be valid for. (Max 365)",
|
|
91
|
+
"multiple": false,
|
|
92
|
+
"default": 365
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"args": {}
|
|
96
|
+
},
|
|
97
|
+
"certificate": {
|
|
98
|
+
"id": "certificate",
|
|
99
|
+
"description": "Generate, fingerprint, or verify a certificate for use with Adobe I/O",
|
|
100
|
+
"strict": true,
|
|
101
|
+
"pluginName": "@adobe/aio-cli-plugin-certificate",
|
|
102
|
+
"pluginAlias": "@adobe/aio-cli-plugin-certificate",
|
|
103
|
+
"pluginType": "core",
|
|
104
|
+
"aliases": [],
|
|
105
|
+
"flags": {},
|
|
106
|
+
"args": {}
|
|
107
|
+
},
|
|
108
|
+
"certificate:verify": {
|
|
109
|
+
"id": "certificate:verify",
|
|
110
|
+
"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",
|
|
111
|
+
"strict": true,
|
|
112
|
+
"pluginName": "@adobe/aio-cli-plugin-certificate",
|
|
113
|
+
"pluginAlias": "@adobe/aio-cli-plugin-certificate",
|
|
114
|
+
"pluginType": "core",
|
|
115
|
+
"aliases": [],
|
|
116
|
+
"flags": {
|
|
117
|
+
"days": {
|
|
118
|
+
"name": "days",
|
|
119
|
+
"type": "option",
|
|
120
|
+
"description": "+- is certificate valid in --days",
|
|
121
|
+
"multiple": false
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"args": {
|
|
125
|
+
"file": {
|
|
126
|
+
"name": "file",
|
|
127
|
+
"description": "file path to certificate to verify",
|
|
128
|
+
"required": true
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/aio-cli-plugin-certificate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-pre.2024-01-08.sha-f2646ee4",
|
|
4
4
|
"description": "Generate and validate private certificates, 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",
|
|
@@ -11,23 +11,23 @@
|
|
|
11
11
|
"node-forge": "^1.3.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"
|
|
15
|
-
"eslint": "^
|
|
14
|
+
"@adobe/eslint-config-aio-lib-config": "^2.0.2",
|
|
15
|
+
"eslint": "^8.56.0",
|
|
16
16
|
"eslint-config-oclif": "^4.0.0",
|
|
17
|
-
"eslint-config-standard": "^
|
|
18
|
-
"eslint-plugin-import": "^2.
|
|
19
|
-
"eslint-plugin-jest": "^
|
|
20
|
-
"eslint-plugin-
|
|
21
|
-
"eslint-plugin-
|
|
22
|
-
"eslint-plugin-
|
|
23
|
-
"
|
|
24
|
-
"jest
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
17
|
+
"eslint-config-standard": "^17.1.0",
|
|
18
|
+
"eslint-plugin-import": "^2.29.1",
|
|
19
|
+
"eslint-plugin-jest": "^27.6.1",
|
|
20
|
+
"eslint-plugin-jsdoc": "^42.0.0",
|
|
21
|
+
"eslint-plugin-n": "^15.7.0",
|
|
22
|
+
"eslint-plugin-node": "^11.1.0",
|
|
23
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
24
|
+
"jest": "^29",
|
|
25
|
+
"stdout-stderr": "^0.1.9",
|
|
26
|
+
"typescript": "^5.3.3",
|
|
27
|
+
"oclif": "^3.2.0"
|
|
28
28
|
},
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": "
|
|
30
|
+
"node": ">=18"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"/oclif.manifest.json",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"oclif": {
|
|
43
43
|
"commands": "./src/commands",
|
|
44
44
|
"bin": "aio",
|
|
45
|
+
"topicSeparator": " ",
|
|
45
46
|
"repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>"
|
|
46
47
|
},
|
|
47
48
|
"main": "src/certificate.js",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"posttest": "eslint src test",
|
|
50
51
|
"test": "npm run unit-tests",
|
|
51
52
|
"unit-tests": "jest --ci",
|
|
52
|
-
"prepack": "oclif manifest && oclif readme",
|
|
53
|
+
"prepack": "oclif manifest && oclif readme --no-aliases",
|
|
53
54
|
"postpack": "rm -f oclif.manifest.json",
|
|
54
55
|
"version": "oclif readme && git add README.md"
|
|
55
56
|
},
|
|
@@ -61,13 +62,10 @@
|
|
|
61
62
|
"coveragePathIgnorePatterns": [
|
|
62
63
|
"<rootDir>/tests/fixtures/"
|
|
63
64
|
],
|
|
64
|
-
"reporters": [
|
|
65
|
-
"default",
|
|
66
|
-
"jest-junit"
|
|
67
|
-
],
|
|
68
65
|
"testEnvironment": "node",
|
|
69
66
|
"setupFilesAfterEnv": [
|
|
70
67
|
"./test/jest.setup.js"
|
|
71
68
|
]
|
|
72
|
-
}
|
|
73
|
-
|
|
69
|
+
},
|
|
70
|
+
"prereleaseSha": "f2646ee441d27bb1ccdd7aadb018db619424f201"
|
|
71
|
+
}
|
package/src/certificate.js
CHANGED
|
@@ -41,20 +41,20 @@ function fingerprint (pemCert) {
|
|
|
41
41
|
-newkey rsa:bits generate a new RSA key of 'bits' in size
|
|
42
42
|
-keyout arg file to send the key to
|
|
43
43
|
-out arg output file
|
|
44
|
-
*/
|
|
44
|
+
*/
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Generates a certificate and a private key pair
|
|
48
48
|
* Similar to openssl req -x509 -sha256 -nodes -days 365 -subj "/C=US/" -newkey rsa:2048
|
|
49
49
|
*
|
|
50
|
-
* @param {string} commonName
|
|
50
|
+
* @param {string} commonName the common name of the cert
|
|
51
51
|
* @param {number} days (integer)
|
|
52
52
|
* @param {object} [attributes={}] optional certificate attributes
|
|
53
|
-
* @param {string} [attributes.country]
|
|
54
|
-
* @param {string} [attributes.state]
|
|
55
|
-
* @param {string} [attributes.locality]
|
|
56
|
-
* @param {string} [attributes.organization]
|
|
57
|
-
* @param {string} [attributes.unit]
|
|
53
|
+
* @param {string} [attributes.country] the cert country
|
|
54
|
+
* @param {string} [attributes.state] the cert state
|
|
55
|
+
* @param {string} [attributes.locality] the cert locality
|
|
56
|
+
* @param {string} [attributes.organization] the cert organization
|
|
57
|
+
* @param {string} [attributes.unit] the cert unit (in the org)
|
|
58
58
|
* @returns {{privateKey: string, cert: string}} key pair
|
|
59
59
|
*/
|
|
60
60
|
function generate (commonName, days, /* istanbul ignore next */ attributes = {}) {
|
|
@@ -146,7 +146,7 @@ function generate (commonName, days, /* istanbul ignore next */ attributes = {})
|
|
|
146
146
|
* Verifies a valid pem certificate and returns information about its validity
|
|
147
147
|
* Throws if the input is not a valid pem certificate.
|
|
148
148
|
*
|
|
149
|
-
* @param {string|Buffer} pemCert
|
|
149
|
+
* @param {string|Buffer} pemCert the contents of the cert
|
|
150
150
|
* @returns {{verified: boolean, validUntil: Date, validSince: Date}} key pair
|
|
151
151
|
*/
|
|
152
152
|
function verify (pemCert) {
|