@aws-sdk/core 3.666.0 → 3.667.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.
- package/dist-cjs/submodules/client/index.js +12 -0
- package/dist-cjs/submodules/httpAuthSchemes/index.js +6 -1
- package/dist-es/submodules/client/index.js +1 -0
- package/dist-es/submodules/client/setCredentialFeature.js +7 -0
- package/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js +6 -1
- package/dist-types/submodules/client/index.d.ts +1 -0
- package/dist-types/submodules/client/setCredentialFeature.d.ts +7 -0
- package/dist-types/ts3.4/submodules/client/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/client/setCredentialFeature.d.ts +11 -0
- package/package.json +2 -2
|
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var client_exports = {};
|
|
23
23
|
__export(client_exports, {
|
|
24
24
|
emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion,
|
|
25
|
+
setCredentialFeature: () => setCredentialFeature,
|
|
25
26
|
setFeature: () => setFeature
|
|
26
27
|
});
|
|
27
28
|
module.exports = __toCommonJS(client_exports);
|
|
@@ -43,6 +44,16 @@ More information can be found at: https://a.co/74kJMmI`
|
|
|
43
44
|
}
|
|
44
45
|
}, "emitWarningIfUnsupportedVersion");
|
|
45
46
|
|
|
47
|
+
// src/submodules/client/setCredentialFeature.ts
|
|
48
|
+
function setCredentialFeature(credentials, feature, value) {
|
|
49
|
+
if (!credentials.$source) {
|
|
50
|
+
credentials.$source = {};
|
|
51
|
+
}
|
|
52
|
+
credentials.$source[feature] = value;
|
|
53
|
+
return credentials;
|
|
54
|
+
}
|
|
55
|
+
__name(setCredentialFeature, "setCredentialFeature");
|
|
56
|
+
|
|
46
57
|
// src/submodules/client/setFeature.ts
|
|
47
58
|
function setFeature(context, feature, value) {
|
|
48
59
|
if (!context.__aws_sdk_context) {
|
|
@@ -58,5 +69,6 @@ __name(setFeature, "setFeature");
|
|
|
58
69
|
// Annotate the CommonJS export names for ESM import in node:
|
|
59
70
|
0 && (module.exports = {
|
|
60
71
|
emitWarningIfUnsupportedVersion,
|
|
72
|
+
setCredentialFeature,
|
|
61
73
|
setFeature
|
|
62
74
|
});
|
|
@@ -191,11 +191,14 @@ var NODE_SIGV4A_CONFIG_OPTIONS = {
|
|
|
191
191
|
};
|
|
192
192
|
|
|
193
193
|
// src/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.ts
|
|
194
|
+
var import_client = require("@aws-sdk/core/client");
|
|
194
195
|
var import_core2 = require("@smithy/core");
|
|
195
196
|
var import_signature_v4 = require("@smithy/signature-v4");
|
|
196
197
|
var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
|
|
198
|
+
let isUserSupplied = false;
|
|
197
199
|
let normalizedCreds;
|
|
198
200
|
if (config.credentials) {
|
|
201
|
+
isUserSupplied = true;
|
|
199
202
|
normalizedCreds = (0, import_core2.memoizeIdentityProvider)(config.credentials, import_core2.isIdentityExpired, import_core2.doesIdentityRequireRefresh);
|
|
200
203
|
}
|
|
201
204
|
if (!normalizedCreds) {
|
|
@@ -280,7 +283,9 @@ var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
|
|
|
280
283
|
...config,
|
|
281
284
|
systemClockOffset,
|
|
282
285
|
signingEscapePath,
|
|
283
|
-
credentials: normalizedCreds
|
|
286
|
+
credentials: isUserSupplied ? async () => normalizedCreds().then(
|
|
287
|
+
(creds) => (0, import_client.setCredentialFeature)(creds, "CREDENTIALS_CODE", "e")
|
|
288
|
+
) : normalizedCreds,
|
|
284
289
|
signer
|
|
285
290
|
};
|
|
286
291
|
}, "resolveAwsSdkSigV4Config");
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { setCredentialFeature } from "@aws-sdk/core/client";
|
|
1
2
|
import { doesIdentityRequireRefresh, isIdentityExpired, memoizeIdentityProvider, normalizeProvider, } from "@smithy/core";
|
|
2
3
|
import { SignatureV4 } from "@smithy/signature-v4";
|
|
3
4
|
export const resolveAwsSdkSigV4Config = (config) => {
|
|
5
|
+
let isUserSupplied = false;
|
|
4
6
|
let normalizedCreds;
|
|
5
7
|
if (config.credentials) {
|
|
8
|
+
isUserSupplied = true;
|
|
6
9
|
normalizedCreds = memoizeIdentityProvider(config.credentials, isIdentityExpired, doesIdentityRequireRefresh);
|
|
7
10
|
}
|
|
8
11
|
if (!normalizedCreds) {
|
|
@@ -75,7 +78,9 @@ export const resolveAwsSdkSigV4Config = (config) => {
|
|
|
75
78
|
...config,
|
|
76
79
|
systemClockOffset,
|
|
77
80
|
signingEscapePath,
|
|
78
|
-
credentials:
|
|
81
|
+
credentials: isUserSupplied
|
|
82
|
+
? async () => normalizedCreds().then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e"))
|
|
83
|
+
: normalizedCreds,
|
|
79
84
|
signer,
|
|
80
85
|
};
|
|
81
86
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AttributedAwsCredentialIdentity, AwsSdkCredentialsFeatures } from "@aws-sdk/types";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*
|
|
5
|
+
* @returns the credentials with source feature attribution.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setCredentialFeature<F extends keyof AwsSdkCredentialsFeatures>(credentials: AttributedAwsCredentialIdentity, feature: F, value: AwsSdkCredentialsFeatures[F]): AttributedAwsCredentialIdentity;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AttributedAwsCredentialIdentity,
|
|
3
|
+
AwsSdkCredentialsFeatures,
|
|
4
|
+
} from "@aws-sdk/types";
|
|
5
|
+
export declare function setCredentialFeature<
|
|
6
|
+
F extends keyof AwsSdkCredentialsFeatures
|
|
7
|
+
>(
|
|
8
|
+
credentials: AttributedAwsCredentialIdentity,
|
|
9
|
+
feature: F,
|
|
10
|
+
value: AwsSdkCredentialsFeatures[F]
|
|
11
|
+
): AttributedAwsCredentialIdentity;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.667.0",
|
|
4
4
|
"description": "Core functions & classes shared by multiple AWS SDK clients.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"license": "Apache-2.0",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@aws-sdk/types": "3.
|
|
82
|
+
"@aws-sdk/types": "3.667.0",
|
|
83
83
|
"@smithy/core": "^2.4.8",
|
|
84
84
|
"@smithy/node-config-provider": "^3.1.8",
|
|
85
85
|
"@smithy/property-provider": "^3.1.7",
|