@small-tech/auto-encrypt 4.1.0 → 4.1.2

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
@@ -12,9 +12,9 @@ When not provisioning certificates, Auto Encrypt also forwards HTTP calls to HTT
12
12
 
13
13
  ## Compatibility
14
14
 
15
- All tests pass on Node.js LTS (version 22).
15
+ Node.js 18.20.0+.
16
16
 
17
- [Tests fail on Node.js 19 (socket hang up error).](https://codeberg.org/small-tech/auto-encrypt/issues/3)
17
+ All tests pass on Node.js LTS (version 22).
18
18
 
19
19
  ## Installation
20
20
 
@@ -6,6 +6,7 @@
6
6
  * @license AGPLv3 or later.
7
7
  */
8
8
 
9
+ import packageJson from '../package.json' with { type: 'json' }
9
10
  import jose from 'jose'
10
11
  import prepareRequest from 'bent'
11
12
  import types from '../typedefs/lib/AcmeRequest.js'
@@ -34,6 +35,8 @@ export default class AcmeRequest {
34
35
  static accountIdentity = null
35
36
  static nonce = null
36
37
  static __account = null
38
+ /** @type {string} */
39
+ static autoEncryptVersion = packageJson.version
37
40
 
38
41
  static initialise (directory = throws.ifMissing(), accountIdentity = throws.ifMissing()) {
39
42
  this.directory = directory
@@ -166,9 +169,9 @@ export default class AcmeRequest {
166
169
  * Concatenates the output of a stream and returns a buffer. Taken from the bent module.
167
170
  *
168
171
  * @param {stream} stream A Node stream.
169
- * @returns {Buffer} The concatenated output of the Node stream.
172
+ * @returns {Promise<Buffer>} The concatenated output of the Node stream.
170
173
  */
171
- async getBuffer (stream) {
174
+ getBuffer (stream) {
172
175
  return new Promise((resolve, reject) => {
173
176
  const parts = []
174
177
  stream.on('error', reject)
@@ -228,7 +231,7 @@ export default class AcmeRequest {
228
231
 
229
232
  const httpsHeaders = {
230
233
  'Content-Type': 'application/jose+json',
231
- 'User-Agent': 'small-tech.org-acme/1.0.0 node/12.16.0',
234
+ 'User-Agent': `small-tech.org-auto-encrypt/${AcmeRequest.autoEncryptVersion}`,
232
235
  'Accept-Language': 'en-US'
233
236
  }
234
237
 
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@small-tech/auto-encrypt",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Automatically provisions and renews Let’s Encrypt TLS certificates on Node.js https servers (including Kitten, Polka, Express.js, etc.)",
5
5
  "engines": {
6
- "node": ">=18.2.0"
6
+ "node": ">=18.20.0"
7
7
  },
8
8
  "keywords": [
9
9
  "let's encrypt",