presidium 1.4.0 → 1.4.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/Docker.js CHANGED
@@ -24,21 +24,29 @@ const handleDockerHTTPResponse = require('./internal/handleDockerHTTPResponse')
24
24
  *
25
25
  * @docs
26
26
  * ```coffeescript [specscript]
27
- * new Docker() -> docker Docker
27
+ * new Docker(options {
28
+ * apiVersion: string,
29
+ * }) -> docker Docker
28
30
  * ```
29
31
  *
30
32
  * Presidium Docker client for [Docker](https://docs.docker.com/reference/).
31
33
  *
32
34
  * Note: the Presidium Docker client connects to the Docker socket. Please use caution when creating production services using the Presidium Docker client, see [How would an attacker gain access to the host machine from within a Docker container?](https://www.google.com/search?hl=en&q=how%20would%20an%20attacker%20gain%20access%20to%20the%20host%20machine%20from%20within%20a%20docker%20container).
35
+ *
36
+ * Arguments:
37
+ * * `options`
38
+ * * `apiVersion` - the version of the Docker API. Defaults to `'1.48'`.
33
39
  */
34
40
  class Docker {
35
- constructor() {
41
+ constructor(options = {}) {
36
42
  const agent = new http.Agent({
37
43
  socketPath: '/var/run/docker.sock',
38
44
  maxSockets: Infinity,
39
45
  })
40
46
 
41
- this.http = new HTTP('http://0.0.0.0/v1.48', { agent })
47
+ this.apiVersion = options.apiVersion ?? '1.48'
48
+
49
+ this.http = new HTTP(`http://0.0.0.0/v${this.apiVersion}`, { agent })
42
50
  }
43
51
 
44
52
  /**
package/SecretsManager.js CHANGED
@@ -164,7 +164,7 @@ class SecretsManager {
164
164
 
165
165
  if (createSecretAwsError.name == 'ResourceExistsException') {
166
166
  // continue
167
- } else if (retryableErrorNames.includes(error.name)) {
167
+ } else if (retryableErrorNames.includes(createSecretAwsError.name)) {
168
168
  await sleep(1000)
169
169
  return putSecret.call(this, name, secretString)
170
170
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",