@itentialopensource/adapter-utils 5.10.18 → 5.10.19

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.
@@ -282,7 +282,30 @@ class AuthenticationHandler {
282
282
  }
283
283
 
284
284
  // set up data for first assume role call
285
- const stsrole = new AWS.STS();
285
+ let stsConfigObj;
286
+
287
+ // Add optional config items (ssl, endpoint, proxy)
288
+ if (this.allProps.authentication.aws_sts && this.allProps.authentication.aws_sts.use_proxy_for_initial_auth === true) {
289
+ stsConfigObj = {};
290
+ // Use AWS STS-specific region if available, otherwise fall back to global region
291
+ stsConfigObj.region = this.allProps.authentication.aws_sts.region || this.allProps.region;
292
+ if (this.allProps.authentication.aws_sts.sslEnable === false) {
293
+ stsConfigObj.sslEnabled = false;
294
+ }
295
+ if (this.allProps.authentication.aws_sts.endpoint) {
296
+ stsConfigObj.endpoint = this.allProps.authentication.aws_sts.endpoint;
297
+ }
298
+ if (this.allProps.authentication.aws_sts.proxy) {
299
+ stsConfigObj.httpOptions = {
300
+ proxy: this.allProps.authentication.aws_sts.proxy
301
+ };
302
+ if (this.allProps.authentication.aws_sts.proxyagent) {
303
+ stsConfigObj.httpOptions.agent = this.allProps.authentication.aws_sts.proxyagent;
304
+ }
305
+ }
306
+ }
307
+
308
+ const stsrole = stsConfigObj ? new AWS.STS(stsConfigObj) : new AWS.STS();
286
309
  const stsData = {
287
310
  RoleArn: myRole,
288
311
  RoleSessionName: mySess,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-utils",
3
- "version": "5.10.18",
3
+ "version": "5.10.19",
4
4
  "description": "Itential Adapter Utility Libraries",
5
5
  "scripts": {
6
6
  "postinstall": "node utils/setup.js",
@@ -96,10 +96,10 @@
96
96
  "https"
97
97
  ]
98
98
  },
99
- "service" : {
100
- "type" : "string",
99
+ "service": {
100
+ "type": "string",
101
101
  "description": "Service we are integrating with -- used with AWS Authentication",
102
- "examples" : [
102
+ "examples": [
103
103
  "ec2",
104
104
  "route53"
105
105
  ]
@@ -344,7 +344,7 @@
344
344
  "responseFields": {
345
345
  "type": "object",
346
346
  "description": "The fields from the step result"
347
- },
347
+ },
348
348
  "successfullResponseCode": {
349
349
  "type": "integer",
350
350
  "description": "Expected response code for given step, if not set any successfull http response is accepted",
@@ -429,6 +429,11 @@
429
429
  "https",
430
430
  "http"
431
431
  ]
432
+ },
433
+ "use_proxy_for_initial_auth": {
434
+ "type": "boolean",
435
+ "description": "When true, use proxy for initial authentication requests",
436
+ "default": false
432
437
  }
433
438
  }
434
439
  }
@@ -1753,4 +1758,4 @@
1753
1758
  }
1754
1759
  }
1755
1760
  }
1756
- }
1761
+ }