@adobe/aio-cli-plugin-certificate 1.0.1 → 2.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/README.md CHANGED
@@ -42,7 +42,7 @@ 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.js](https://github.com/adobe/aio-cli-plugin-certificate/blob/1.0.1/src/commands/certificate/index.js)_
45
+ _See code: [src/commands/certificate/index.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/2.0.0/src/commands/certificate/index.ts)_
46
46
 
47
47
  ## `aio certificate fingerprint FILE`
48
48
 
@@ -50,7 +50,7 @@ Compute the fingerprint of a public key certificate for use with Adobe I/O
50
50
 
51
51
  ```
52
52
  USAGE
53
- $ aio certificate fingerprint [FILE]
53
+ $ aio certificate fingerprint FILE
54
54
 
55
55
  ARGUMENTS
56
56
  FILE file path to certificate to fingerprint
@@ -59,6 +59,8 @@ 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.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/2.0.0/src/commands/certificate/fingerprint.ts)_
63
+
62
64
  ## `aio certificate generate`
63
65
 
64
66
  Generate a new private/public key pair
@@ -82,18 +84,19 @@ FLAGS
82
84
 
83
85
  DESCRIPTION
84
86
  Generate a new private/public key pair
85
-
86
87
  Generate a self-signed certificate to enable https:// on localhost or signing jwt payloads for interacting with Adobe
87
88
  services.
88
89
  ```
89
90
 
91
+ _See code: [src/commands/certificate/generate.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/2.0.0/src/commands/certificate/generate.ts)_
92
+
90
93
  ## `aio certificate verify FILE`
91
94
 
92
95
  Verify a certificate for use with Adobe I/O
93
96
 
94
97
  ```
95
98
  USAGE
96
- $ aio certificate verify [FILE] [--days <value>]
99
+ $ aio certificate verify FILE [--days <value>]
97
100
 
98
101
  ARGUMENTS
99
102
  FILE file path to certificate to verify
@@ -103,9 +106,10 @@ FLAGS
103
106
 
104
107
  DESCRIPTION
105
108
  Verify a certificate for use with Adobe I/O
106
-
107
109
  Verifies that the certificate is valid, and/or will not expire in [--days] days from now.
108
110
  ```
111
+
112
+ _See code: [src/commands/certificate/verify.ts](https://github.com/adobe/aio-cli-plugin-certificate/blob/2.0.0/src/commands/certificate/verify.ts)_
109
113
  <!-- commandsstop -->
110
114
 
111
115
  ## Contributing
@@ -1 +1,133 @@
1
- {"version":"1.0.1","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":[]},"certificate":{"id":"certificate","description":"Generate, fingerprint, 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}]}}}
1
+ {
2
+ "version": "2.0.0",
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.1",
3
+ "version": "2.0.0",
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
- "codecov": "^3.2.0",
15
- "eslint": "^6.8.0",
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": "^14.1.0",
18
- "eslint-plugin-import": "^2.13.10",
19
- "eslint-plugin-jest": "^23.6.0",
20
- "eslint-plugin-node": "^11.0.0",
21
- "eslint-plugin-promise": "^4.0.0",
22
- "eslint-plugin-standard": "^4.0.0",
23
- "jest": "^24.1.0",
24
- "jest-junit": "^10.0.0",
25
- "jest-resolve": "^26.0.0",
26
- "oclif": "^3.2.0",
27
- "stdout-stderr": "^0.1.9"
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": "^14.18 || ^16.13 || >=18"
30
+ "node": ">=18"
31
31
  },
32
32
  "files": [
33
33
  "/oclif.manifest.json",
@@ -62,10 +62,6 @@
62
62
  "coveragePathIgnorePatterns": [
63
63
  "<rootDir>/tests/fixtures/"
64
64
  ],
65
- "reporters": [
66
- "default",
67
- "jest-junit"
68
- ],
69
65
  "testEnvironment": "node",
70
66
  "setupFilesAfterEnv": [
71
67
  "./test/jest.setup.js"
@@ -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) {