@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.
@@ -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,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -0,0 +1,7 @@
1
+ export function setCredentialFeature(credentials, feature, value) {
2
+ if (!credentials.$source) {
3
+ credentials.$source = {};
4
+ }
5
+ credentials.$source[feature] = value;
6
+ return credentials;
7
+ }
@@ -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: normalizedCreds,
81
+ credentials: isUserSupplied
82
+ ? async () => normalizedCreds().then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e"))
83
+ : normalizedCreds,
79
84
  signer,
80
85
  };
81
86
  };
@@ -1,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -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;
@@ -1,2 +1,3 @@
1
1
  export * from "./emitWarningIfUnsupportedVersion";
2
+ export * from "./setCredentialFeature";
2
3
  export * from "./setFeature";
@@ -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.666.0",
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.664.0",
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",