@aws-sdk/credential-providers 3.583.0 → 3.588.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.
|
@@ -28,11 +28,14 @@ const property_provider_1 = require("@smithy/property-provider");
|
|
|
28
28
|
const fromTemporaryCredentials = (options) => {
|
|
29
29
|
let stsClient;
|
|
30
30
|
return async () => {
|
|
31
|
-
options.logger?.debug("@aws-sdk/credential-providers
|
|
31
|
+
options.logger?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");
|
|
32
32
|
const params = { ...options.params, RoleSessionName: options.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() };
|
|
33
33
|
if (params?.SerialNumber) {
|
|
34
34
|
if (!options.mfaCodeProvider) {
|
|
35
|
-
throw new property_provider_1.CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`,
|
|
35
|
+
throw new property_provider_1.CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`, {
|
|
36
|
+
tryNextLink: false,
|
|
37
|
+
logger: options.logger,
|
|
38
|
+
});
|
|
36
39
|
}
|
|
37
40
|
params.TokenCode = await options.mfaCodeProvider(params?.SerialNumber);
|
|
38
41
|
}
|
|
@@ -46,7 +49,9 @@ const fromTemporaryCredentials = (options) => {
|
|
|
46
49
|
}
|
|
47
50
|
const { Credentials } = await stsClient.send(new AssumeRoleCommand(params));
|
|
48
51
|
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
49
|
-
throw new property_provider_1.CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}
|
|
52
|
+
throw new property_provider_1.CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`, {
|
|
53
|
+
logger: options.logger,
|
|
54
|
+
});
|
|
50
55
|
}
|
|
51
56
|
return {
|
|
52
57
|
accessKeyId: Credentials.AccessKeyId,
|
|
@@ -2,11 +2,14 @@ import { CredentialsProviderError } from "@smithy/property-provider";
|
|
|
2
2
|
export const fromTemporaryCredentials = (options) => {
|
|
3
3
|
let stsClient;
|
|
4
4
|
return async () => {
|
|
5
|
-
options.logger?.debug("@aws-sdk/credential-providers
|
|
5
|
+
options.logger?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");
|
|
6
6
|
const params = { ...options.params, RoleSessionName: options.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() };
|
|
7
7
|
if (params?.SerialNumber) {
|
|
8
8
|
if (!options.mfaCodeProvider) {
|
|
9
|
-
throw new CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`,
|
|
9
|
+
throw new CredentialsProviderError(`Temporary credential requires multi-factor authentication,` + ` but no MFA code callback was provided.`, {
|
|
10
|
+
tryNextLink: false,
|
|
11
|
+
logger: options.logger,
|
|
12
|
+
});
|
|
10
13
|
}
|
|
11
14
|
params.TokenCode = await options.mfaCodeProvider(params?.SerialNumber);
|
|
12
15
|
}
|
|
@@ -20,7 +23,9 @@ export const fromTemporaryCredentials = (options) => {
|
|
|
20
23
|
}
|
|
21
24
|
const { Credentials } = await stsClient.send(new AssumeRoleCommand(params));
|
|
22
25
|
if (!Credentials || !Credentials.AccessKeyId || !Credentials.SecretAccessKey) {
|
|
23
|
-
throw new CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}
|
|
26
|
+
throw new CredentialsProviderError(`Invalid response from STS.assumeRole call with role ${params.RoleArn}`, {
|
|
27
|
+
logger: options.logger,
|
|
28
|
+
});
|
|
24
29
|
}
|
|
25
30
|
return {
|
|
26
31
|
accessKeyId: Credentials.AccessKeyId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-providers",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.588.0",
|
|
4
4
|
"description": "A collection of credential providers, without requiring service clients like STS, Cognito",
|
|
5
5
|
"main": "./dist-cjs/index.js",
|
|
6
6
|
"module": "./dist-es/index.js",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aws-sdk/client-cognito-identity": "3.
|
|
32
|
-
"@aws-sdk/client-sso": "3.
|
|
33
|
-
"@aws-sdk/client-sts": "3.
|
|
34
|
-
"@aws-sdk/credential-provider-cognito-identity": "3.
|
|
35
|
-
"@aws-sdk/credential-provider-env": "3.
|
|
36
|
-
"@aws-sdk/credential-provider-http": "3.
|
|
37
|
-
"@aws-sdk/credential-provider-ini": "3.
|
|
38
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
39
|
-
"@aws-sdk/credential-provider-process": "3.
|
|
40
|
-
"@aws-sdk/credential-provider-sso": "3.
|
|
41
|
-
"@aws-sdk/credential-provider-web-identity": "3.
|
|
31
|
+
"@aws-sdk/client-cognito-identity": "3.588.0",
|
|
32
|
+
"@aws-sdk/client-sso": "3.588.0",
|
|
33
|
+
"@aws-sdk/client-sts": "3.588.0",
|
|
34
|
+
"@aws-sdk/credential-provider-cognito-identity": "3.588.0",
|
|
35
|
+
"@aws-sdk/credential-provider-env": "3.587.0",
|
|
36
|
+
"@aws-sdk/credential-provider-http": "3.587.0",
|
|
37
|
+
"@aws-sdk/credential-provider-ini": "3.588.0",
|
|
38
|
+
"@aws-sdk/credential-provider-node": "3.588.0",
|
|
39
|
+
"@aws-sdk/credential-provider-process": "3.587.0",
|
|
40
|
+
"@aws-sdk/credential-provider-sso": "3.588.0",
|
|
41
|
+
"@aws-sdk/credential-provider-web-identity": "3.587.0",
|
|
42
42
|
"@aws-sdk/types": "3.577.0",
|
|
43
|
-
"@smithy/credential-provider-imds": "^3.
|
|
44
|
-
"@smithy/property-provider": "^3.
|
|
43
|
+
"@smithy/credential-provider-imds": "^3.1.0",
|
|
44
|
+
"@smithy/property-provider": "^3.1.0",
|
|
45
45
|
"@smithy/types": "^3.0.0",
|
|
46
46
|
"tslib": "^2.6.2"
|
|
47
47
|
},
|