aws4-axios
Advanced tools
Comparing version 3.2.24 to 3.3.0
@@ -17,2 +17,3 @@ import { CredentialsProvider } from "./credentialsProvider"; | ||
expirationMarginSec?: number; | ||
roleSessionName?: string; | ||
} | ||
@@ -23,2 +24,3 @@ export interface ResolvedAssumeRoleCredentialsProviderOptions { | ||
expirationMarginSec: number; | ||
roleSessionName: string; | ||
} |
@@ -16,3 +16,3 @@ "use strict"; | ||
constructor(options) { | ||
this.options = Object.assign(Object.assign({}, options), { region: options.region || process.env.AWS_REGION, expirationMarginSec: options.expirationMarginSec || 5 }); | ||
this.options = Object.assign(Object.assign({}, options), { region: options.region || process.env.AWS_REGION, expirationMarginSec: options.expirationMarginSec || 5, roleSessionName: options.roleSessionName || "axios" }); | ||
this.sts = new client_sts_1.STSClient({ region: this.options.region }); | ||
@@ -43,3 +43,3 @@ } | ||
RoleArn: this.options.roleArn, | ||
RoleSessionName: "axios", | ||
RoleSessionName: this.options.roleSessionName, | ||
})); | ||
@@ -46,0 +46,0 @@ if (!res.Credentials) { |
@@ -28,2 +28,10 @@ import { AxiosInstance, AxiosRequestHeaders, InternalAxiosRequestConfig, Method } from "axios"; | ||
assumedRoleExpirationMarginSec?: number; | ||
/** | ||
* An identifier for the assumed role session. | ||
* Use the role session name to uniquely identify a session when the same role is | ||
* assumed by different principals or for different reasons. | ||
* In cross-account scenarios, the role session name is visible to, | ||
* and can be logged by the account that owns the role. | ||
*/ | ||
assumeRoleSessionName?: string; | ||
} | ||
@@ -30,0 +38,0 @@ export interface SigningOptions { |
@@ -63,2 +63,3 @@ "use strict"; | ||
expirationMarginSec: options.assumedRoleExpirationMarginSec, | ||
roleSessionName: options.assumeRoleSessionName, | ||
}); | ||
@@ -65,0 +66,0 @@ } |
{ | ||
"name": "aws4-axios", | ||
"version": "3.2.24", | ||
"version": "3.3.0", | ||
"description": "Axios request interceptor for signing requests with AWSv4", | ||
@@ -49,6 +49,6 @@ "author": "James Bourne", | ||
"eslint": "^8.0.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"husky": "^8.0.0", | ||
"jest": "^26.6.3", | ||
"lint-staged": "^13.0.0", | ||
"lint-staged": "^14.0.0", | ||
"nock": "^13.3.0", | ||
@@ -55,0 +55,0 @@ "npm-run-all": "^4.1.5", |
@@ -177,2 +177,3 @@ # aws4-axios | ||
assumeRoleArn: "arn:aws:iam::111111111111:role/MyRole", | ||
assumeRoleSessionName: "MyApiClient", // optional, default value is "axios" | ||
}, | ||
@@ -179,0 +180,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65302
1324
211