@aws-sdk/client-cognito-identity 3.511.0 → 3.514.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.
Files changed (45) hide show
  1. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +1 -0
  2. package/dist-cjs/auth/httpAuthSchemeProvider.js +68 -0
  3. package/dist-cjs/index.js +84 -63
  4. package/dist-cjs/runtimeConfig.shared.js +16 -0
  5. package/dist-es/CognitoIdentityClient.js +17 -3
  6. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  7. package/dist-es/auth/httpAuthSchemeProvider.js +62 -0
  8. package/dist-es/commands/CreateIdentityPoolCommand.js +0 -2
  9. package/dist-es/commands/DeleteIdentitiesCommand.js +0 -2
  10. package/dist-es/commands/DeleteIdentityPoolCommand.js +0 -2
  11. package/dist-es/commands/DescribeIdentityCommand.js +0 -2
  12. package/dist-es/commands/DescribeIdentityPoolCommand.js +0 -2
  13. package/dist-es/commands/GetIdentityPoolRolesCommand.js +0 -2
  14. package/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js +0 -2
  15. package/dist-es/commands/GetPrincipalTagAttributeMapCommand.js +0 -2
  16. package/dist-es/commands/ListIdentitiesCommand.js +0 -2
  17. package/dist-es/commands/ListIdentityPoolsCommand.js +0 -2
  18. package/dist-es/commands/ListTagsForResourceCommand.js +0 -2
  19. package/dist-es/commands/LookupDeveloperIdentityCommand.js +0 -2
  20. package/dist-es/commands/MergeDeveloperIdentitiesCommand.js +0 -2
  21. package/dist-es/commands/SetIdentityPoolRolesCommand.js +0 -2
  22. package/dist-es/commands/SetPrincipalTagAttributeMapCommand.js +0 -2
  23. package/dist-es/commands/TagResourceCommand.js +0 -2
  24. package/dist-es/commands/UnlinkDeveloperIdentityCommand.js +0 -2
  25. package/dist-es/commands/UntagResourceCommand.js +0 -2
  26. package/dist-es/commands/UpdateIdentityPoolCommand.js +0 -2
  27. package/dist-es/runtimeConfig.shared.js +16 -0
  28. package/dist-es/runtimeExtensions.js +3 -0
  29. package/dist-types/CognitoIdentityClient.d.ts +13 -11
  30. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  31. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  32. package/dist-types/extensionConfiguration.d.ts +2 -1
  33. package/dist-types/runtimeConfig.browser.d.ts +13 -3
  34. package/dist-types/runtimeConfig.d.ts +12 -2
  35. package/dist-types/runtimeConfig.native.d.ts +14 -4
  36. package/dist-types/runtimeConfig.shared.d.ts +13 -0
  37. package/dist-types/ts3.4/CognitoIdentityClient.d.ts +11 -9
  38. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  39. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  40. package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  41. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +30 -5
  42. package/dist-types/ts3.4/runtimeConfig.d.ts +29 -4
  43. package/dist-types/ts3.4/runtimeConfig.native.d.ts +33 -8
  44. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +30 -0
  45. package/package.json +8 -8
@@ -0,0 +1 @@
1
+ module.exports = require("../index.js");
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveHttpAuthSchemeConfig = exports.defaultCognitoIdentityHttpAuthSchemeProvider = exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const util_middleware_1 = require("@smithy/util-middleware");
6
+ const defaultCognitoIdentityHttpAuthSchemeParametersProvider = async (config, context, input) => {
7
+ return {
8
+ operation: (0, util_middleware_1.getSmithyContext)(context).operation,
9
+ region: (await (0, util_middleware_1.normalizeProvider)(config.region)()) ||
10
+ (() => {
11
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
12
+ })(),
13
+ };
14
+ };
15
+ exports.defaultCognitoIdentityHttpAuthSchemeParametersProvider = defaultCognitoIdentityHttpAuthSchemeParametersProvider;
16
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
17
+ return {
18
+ schemeId: "aws.auth#sigv4",
19
+ signingProperties: {
20
+ name: "cognito-identity",
21
+ region: authParameters.region,
22
+ },
23
+ propertiesExtractor: (config, context) => ({
24
+ signingProperties: {
25
+ config,
26
+ context,
27
+ },
28
+ }),
29
+ };
30
+ }
31
+ function createSmithyApiNoAuthHttpAuthOption(authParameters) {
32
+ return {
33
+ schemeId: "smithy.api#noAuth",
34
+ };
35
+ }
36
+ const defaultCognitoIdentityHttpAuthSchemeProvider = (authParameters) => {
37
+ const options = [];
38
+ switch (authParameters.operation) {
39
+ case "GetCredentialsForIdentity": {
40
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
41
+ break;
42
+ }
43
+ case "GetId": {
44
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
45
+ break;
46
+ }
47
+ case "GetOpenIdToken": {
48
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
49
+ break;
50
+ }
51
+ case "UnlinkIdentity": {
52
+ options.push(createSmithyApiNoAuthHttpAuthOption(authParameters));
53
+ break;
54
+ }
55
+ default: {
56
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
57
+ }
58
+ }
59
+ return options;
60
+ };
61
+ exports.defaultCognitoIdentityHttpAuthSchemeProvider = defaultCognitoIdentityHttpAuthSchemeProvider;
62
+ const resolveHttpAuthSchemeConfig = (config) => {
63
+ const config_0 = (0, core_1.resolveAwsSdkSigV4Config)(config);
64
+ return {
65
+ ...config_0,
66
+ };
67
+ };
68
+ exports.resolveHttpAuthSchemeConfig = resolveHttpAuthSchemeConfig;
package/dist-cjs/index.js CHANGED
@@ -71,13 +71,14 @@ module.exports = __toCommonJS(src_exports);
71
71
  var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
72
72
  var import_middleware_logger = require("@aws-sdk/middleware-logger");
73
73
  var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
74
- var import_middleware_signing = require("@aws-sdk/middleware-signing");
75
74
  var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
76
75
  var import_config_resolver = require("@smithy/config-resolver");
76
+ var import_core = require("@smithy/core");
77
77
  var import_middleware_content_length = require("@smithy/middleware-content-length");
78
78
  var import_middleware_endpoint = require("@smithy/middleware-endpoint");
79
79
  var import_middleware_retry = require("@smithy/middleware-retry");
80
80
 
81
+ var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
81
82
 
82
83
  // src/endpoint/EndpointParameters.ts
83
84
  var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
@@ -102,19 +103,62 @@ var import_runtimeConfig = require("././runtimeConfig");
102
103
  var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
103
104
  var import_protocol_http = require("@smithy/protocol-http");
104
105
  var import_smithy_client = require("@smithy/smithy-client");
106
+
107
+ // src/auth/httpAuthExtensionConfiguration.ts
108
+ var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
109
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
110
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
111
+ let _credentials = runtimeConfig.credentials;
112
+ return {
113
+ setHttpAuthScheme(httpAuthScheme) {
114
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
115
+ if (index === -1) {
116
+ _httpAuthSchemes.push(httpAuthScheme);
117
+ } else {
118
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
119
+ }
120
+ },
121
+ httpAuthSchemes() {
122
+ return _httpAuthSchemes;
123
+ },
124
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
125
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
126
+ },
127
+ httpAuthSchemeProvider() {
128
+ return _httpAuthSchemeProvider;
129
+ },
130
+ setCredentials(credentials) {
131
+ _credentials = credentials;
132
+ },
133
+ credentials() {
134
+ return _credentials;
135
+ }
136
+ };
137
+ }, "getHttpAuthExtensionConfiguration");
138
+ var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
139
+ return {
140
+ httpAuthSchemes: config.httpAuthSchemes(),
141
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
142
+ credentials: config.credentials()
143
+ };
144
+ }, "resolveHttpAuthRuntimeConfig");
145
+
146
+ // src/runtimeExtensions.ts
105
147
  var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
106
148
  var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
107
149
  const extensionConfiguration = {
108
150
  ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
109
151
  ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
110
- ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
152
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
153
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig))
111
154
  };
112
155
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
113
156
  return {
114
157
  ...runtimeConfig,
115
158
  ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
116
159
  ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
117
- ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
160
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
161
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration)
118
162
  };
119
163
  }, "resolveRuntimeExtensions");
120
164
 
@@ -127,8 +171,8 @@ var _CognitoIdentityClient = class _CognitoIdentityClient extends import_smithy_
127
171
  const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
128
172
  const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
129
173
  const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
130
- const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
131
- const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
174
+ const _config_6 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_5);
175
+ const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
132
176
  const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
133
177
  super(_config_8);
134
178
  this.config = _config_8;
@@ -138,6 +182,13 @@ var _CognitoIdentityClient = class _CognitoIdentityClient extends import_smithy_
138
182
  this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
139
183
  this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
140
184
  this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
185
+ this.middlewareStack.use(
186
+ (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
187
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
188
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider()
189
+ })
190
+ );
191
+ this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
141
192
  }
142
193
  /**
143
194
  * Destroy underlying resources, like sockets. It's usually not necessary to do this.
@@ -147,6 +198,14 @@ var _CognitoIdentityClient = class _CognitoIdentityClient extends import_smithy_
147
198
  destroy() {
148
199
  super.destroy();
149
200
  }
201
+ getDefaultHttpAuthSchemeParametersProvider() {
202
+ return import_httpAuthSchemeProvider.defaultCognitoIdentityHttpAuthSchemeParametersProvider;
203
+ }
204
+ getIdentityProviderConfigProvider() {
205
+ return async (config) => new import_core.DefaultIdentityProviderConfig({
206
+ "aws.auth#sigv4": config.credentials
207
+ });
208
+ }
150
209
  };
151
210
  __name(_CognitoIdentityClient, "CognitoIdentityClient");
152
211
  var CognitoIdentityClient = _CognitoIdentityClient;
@@ -156,7 +215,6 @@ var CognitoIdentityClient = _CognitoIdentityClient;
156
215
 
157
216
  // src/commands/CreateIdentityPoolCommand.ts
158
217
 
159
-
160
218
  var import_middleware_serde = require("@smithy/middleware-serde");
161
219
 
162
220
  var import_types = require("@smithy/types");
@@ -1075,8 +1133,7 @@ var _CreateIdentityPoolCommand = class _CreateIdentityPoolCommand extends import
1075
1133
  }).m(function(Command, cs, config, o) {
1076
1134
  return [
1077
1135
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1078
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1079
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1136
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1080
1137
  ];
1081
1138
  }).s("AWSCognitoIdentityService", "CreateIdentityPool", {}).n("CognitoIdentityClient", "CreateIdentityPoolCommand").f(void 0, void 0).ser(se_CreateIdentityPoolCommand).de(de_CreateIdentityPoolCommand).build() {
1082
1139
  };
@@ -1088,14 +1145,12 @@ var CreateIdentityPoolCommand = _CreateIdentityPoolCommand;
1088
1145
 
1089
1146
 
1090
1147
 
1091
-
1092
1148
  var _DeleteIdentitiesCommand = class _DeleteIdentitiesCommand extends import_smithy_client.Command.classBuilder().ep({
1093
1149
  ...commonParams
1094
1150
  }).m(function(Command, cs, config, o) {
1095
1151
  return [
1096
1152
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1097
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1098
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1153
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1099
1154
  ];
1100
1155
  }).s("AWSCognitoIdentityService", "DeleteIdentities", {}).n("CognitoIdentityClient", "DeleteIdentitiesCommand").f(void 0, void 0).ser(se_DeleteIdentitiesCommand).de(de_DeleteIdentitiesCommand).build() {
1101
1156
  };
@@ -1107,14 +1162,12 @@ var DeleteIdentitiesCommand = _DeleteIdentitiesCommand;
1107
1162
 
1108
1163
 
1109
1164
 
1110
-
1111
1165
  var _DeleteIdentityPoolCommand = class _DeleteIdentityPoolCommand extends import_smithy_client.Command.classBuilder().ep({
1112
1166
  ...commonParams
1113
1167
  }).m(function(Command, cs, config, o) {
1114
1168
  return [
1115
1169
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1116
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1117
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1170
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1118
1171
  ];
1119
1172
  }).s("AWSCognitoIdentityService", "DeleteIdentityPool", {}).n("CognitoIdentityClient", "DeleteIdentityPoolCommand").f(void 0, void 0).ser(se_DeleteIdentityPoolCommand).de(de_DeleteIdentityPoolCommand).build() {
1120
1173
  };
@@ -1126,14 +1179,12 @@ var DeleteIdentityPoolCommand = _DeleteIdentityPoolCommand;
1126
1179
 
1127
1180
 
1128
1181
 
1129
-
1130
1182
  var _DescribeIdentityCommand = class _DescribeIdentityCommand extends import_smithy_client.Command.classBuilder().ep({
1131
1183
  ...commonParams
1132
1184
  }).m(function(Command, cs, config, o) {
1133
1185
  return [
1134
1186
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1135
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1136
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1187
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1137
1188
  ];
1138
1189
  }).s("AWSCognitoIdentityService", "DescribeIdentity", {}).n("CognitoIdentityClient", "DescribeIdentityCommand").f(void 0, void 0).ser(se_DescribeIdentityCommand).de(de_DescribeIdentityCommand).build() {
1139
1190
  };
@@ -1145,14 +1196,12 @@ var DescribeIdentityCommand = _DescribeIdentityCommand;
1145
1196
 
1146
1197
 
1147
1198
 
1148
-
1149
1199
  var _DescribeIdentityPoolCommand = class _DescribeIdentityPoolCommand extends import_smithy_client.Command.classBuilder().ep({
1150
1200
  ...commonParams
1151
1201
  }).m(function(Command, cs, config, o) {
1152
1202
  return [
1153
1203
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1154
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1155
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1204
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1156
1205
  ];
1157
1206
  }).s("AWSCognitoIdentityService", "DescribeIdentityPool", {}).n("CognitoIdentityClient", "DescribeIdentityPoolCommand").f(void 0, void 0).ser(se_DescribeIdentityPoolCommand).de(de_DescribeIdentityPoolCommand).build() {
1158
1207
  };
@@ -1198,14 +1247,12 @@ var GetIdCommand = _GetIdCommand;
1198
1247
 
1199
1248
 
1200
1249
 
1201
-
1202
1250
  var _GetIdentityPoolRolesCommand = class _GetIdentityPoolRolesCommand extends import_smithy_client.Command.classBuilder().ep({
1203
1251
  ...commonParams
1204
1252
  }).m(function(Command, cs, config, o) {
1205
1253
  return [
1206
1254
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1207
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1208
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1255
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1209
1256
  ];
1210
1257
  }).s("AWSCognitoIdentityService", "GetIdentityPoolRoles", {}).n("CognitoIdentityClient", "GetIdentityPoolRolesCommand").f(void 0, void 0).ser(se_GetIdentityPoolRolesCommand).de(de_GetIdentityPoolRolesCommand).build() {
1211
1258
  };
@@ -1234,14 +1281,12 @@ var GetOpenIdTokenCommand = _GetOpenIdTokenCommand;
1234
1281
 
1235
1282
 
1236
1283
 
1237
-
1238
1284
  var _GetOpenIdTokenForDeveloperIdentityCommand = class _GetOpenIdTokenForDeveloperIdentityCommand extends import_smithy_client.Command.classBuilder().ep({
1239
1285
  ...commonParams
1240
1286
  }).m(function(Command, cs, config, o) {
1241
1287
  return [
1242
1288
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1243
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1244
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1289
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1245
1290
  ];
1246
1291
  }).s("AWSCognitoIdentityService", "GetOpenIdTokenForDeveloperIdentity", {}).n("CognitoIdentityClient", "GetOpenIdTokenForDeveloperIdentityCommand").f(void 0, void 0).ser(se_GetOpenIdTokenForDeveloperIdentityCommand).de(de_GetOpenIdTokenForDeveloperIdentityCommand).build() {
1247
1292
  };
@@ -1253,14 +1298,12 @@ var GetOpenIdTokenForDeveloperIdentityCommand = _GetOpenIdTokenForDeveloperIdent
1253
1298
 
1254
1299
 
1255
1300
 
1256
-
1257
1301
  var _GetPrincipalTagAttributeMapCommand = class _GetPrincipalTagAttributeMapCommand extends import_smithy_client.Command.classBuilder().ep({
1258
1302
  ...commonParams
1259
1303
  }).m(function(Command, cs, config, o) {
1260
1304
  return [
1261
1305
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1262
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1263
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1306
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1264
1307
  ];
1265
1308
  }).s("AWSCognitoIdentityService", "GetPrincipalTagAttributeMap", {}).n("CognitoIdentityClient", "GetPrincipalTagAttributeMapCommand").f(void 0, void 0).ser(se_GetPrincipalTagAttributeMapCommand).de(de_GetPrincipalTagAttributeMapCommand).build() {
1266
1309
  };
@@ -1272,14 +1315,12 @@ var GetPrincipalTagAttributeMapCommand = _GetPrincipalTagAttributeMapCommand;
1272
1315
 
1273
1316
 
1274
1317
 
1275
-
1276
1318
  var _ListIdentitiesCommand = class _ListIdentitiesCommand extends import_smithy_client.Command.classBuilder().ep({
1277
1319
  ...commonParams
1278
1320
  }).m(function(Command, cs, config, o) {
1279
1321
  return [
1280
1322
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1281
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1282
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1323
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1283
1324
  ];
1284
1325
  }).s("AWSCognitoIdentityService", "ListIdentities", {}).n("CognitoIdentityClient", "ListIdentitiesCommand").f(void 0, void 0).ser(se_ListIdentitiesCommand).de(de_ListIdentitiesCommand).build() {
1285
1326
  };
@@ -1291,14 +1332,12 @@ var ListIdentitiesCommand = _ListIdentitiesCommand;
1291
1332
 
1292
1333
 
1293
1334
 
1294
-
1295
1335
  var _ListIdentityPoolsCommand = class _ListIdentityPoolsCommand extends import_smithy_client.Command.classBuilder().ep({
1296
1336
  ...commonParams
1297
1337
  }).m(function(Command, cs, config, o) {
1298
1338
  return [
1299
1339
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1300
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1301
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1340
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1302
1341
  ];
1303
1342
  }).s("AWSCognitoIdentityService", "ListIdentityPools", {}).n("CognitoIdentityClient", "ListIdentityPoolsCommand").f(void 0, void 0).ser(se_ListIdentityPoolsCommand).de(de_ListIdentityPoolsCommand).build() {
1304
1343
  };
@@ -1310,14 +1349,12 @@ var ListIdentityPoolsCommand = _ListIdentityPoolsCommand;
1310
1349
 
1311
1350
 
1312
1351
 
1313
-
1314
1352
  var _ListTagsForResourceCommand = class _ListTagsForResourceCommand extends import_smithy_client.Command.classBuilder().ep({
1315
1353
  ...commonParams
1316
1354
  }).m(function(Command, cs, config, o) {
1317
1355
  return [
1318
1356
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1319
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1320
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1357
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1321
1358
  ];
1322
1359
  }).s("AWSCognitoIdentityService", "ListTagsForResource", {}).n("CognitoIdentityClient", "ListTagsForResourceCommand").f(void 0, void 0).ser(se_ListTagsForResourceCommand).de(de_ListTagsForResourceCommand).build() {
1323
1360
  };
@@ -1329,14 +1366,12 @@ var ListTagsForResourceCommand = _ListTagsForResourceCommand;
1329
1366
 
1330
1367
 
1331
1368
 
1332
-
1333
1369
  var _LookupDeveloperIdentityCommand = class _LookupDeveloperIdentityCommand extends import_smithy_client.Command.classBuilder().ep({
1334
1370
  ...commonParams
1335
1371
  }).m(function(Command, cs, config, o) {
1336
1372
  return [
1337
1373
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1338
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1339
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1374
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1340
1375
  ];
1341
1376
  }).s("AWSCognitoIdentityService", "LookupDeveloperIdentity", {}).n("CognitoIdentityClient", "LookupDeveloperIdentityCommand").f(void 0, void 0).ser(se_LookupDeveloperIdentityCommand).de(de_LookupDeveloperIdentityCommand).build() {
1342
1377
  };
@@ -1348,14 +1383,12 @@ var LookupDeveloperIdentityCommand = _LookupDeveloperIdentityCommand;
1348
1383
 
1349
1384
 
1350
1385
 
1351
-
1352
1386
  var _MergeDeveloperIdentitiesCommand = class _MergeDeveloperIdentitiesCommand extends import_smithy_client.Command.classBuilder().ep({
1353
1387
  ...commonParams
1354
1388
  }).m(function(Command, cs, config, o) {
1355
1389
  return [
1356
1390
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1357
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1358
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1391
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1359
1392
  ];
1360
1393
  }).s("AWSCognitoIdentityService", "MergeDeveloperIdentities", {}).n("CognitoIdentityClient", "MergeDeveloperIdentitiesCommand").f(void 0, void 0).ser(se_MergeDeveloperIdentitiesCommand).de(de_MergeDeveloperIdentitiesCommand).build() {
1361
1394
  };
@@ -1367,14 +1400,12 @@ var MergeDeveloperIdentitiesCommand = _MergeDeveloperIdentitiesCommand;
1367
1400
 
1368
1401
 
1369
1402
 
1370
-
1371
1403
  var _SetIdentityPoolRolesCommand = class _SetIdentityPoolRolesCommand extends import_smithy_client.Command.classBuilder().ep({
1372
1404
  ...commonParams
1373
1405
  }).m(function(Command, cs, config, o) {
1374
1406
  return [
1375
1407
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1376
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1377
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1408
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1378
1409
  ];
1379
1410
  }).s("AWSCognitoIdentityService", "SetIdentityPoolRoles", {}).n("CognitoIdentityClient", "SetIdentityPoolRolesCommand").f(void 0, void 0).ser(se_SetIdentityPoolRolesCommand).de(de_SetIdentityPoolRolesCommand).build() {
1380
1411
  };
@@ -1386,14 +1417,12 @@ var SetIdentityPoolRolesCommand = _SetIdentityPoolRolesCommand;
1386
1417
 
1387
1418
 
1388
1419
 
1389
-
1390
1420
  var _SetPrincipalTagAttributeMapCommand = class _SetPrincipalTagAttributeMapCommand extends import_smithy_client.Command.classBuilder().ep({
1391
1421
  ...commonParams
1392
1422
  }).m(function(Command, cs, config, o) {
1393
1423
  return [
1394
1424
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1395
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1396
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1425
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1397
1426
  ];
1398
1427
  }).s("AWSCognitoIdentityService", "SetPrincipalTagAttributeMap", {}).n("CognitoIdentityClient", "SetPrincipalTagAttributeMapCommand").f(void 0, void 0).ser(se_SetPrincipalTagAttributeMapCommand).de(de_SetPrincipalTagAttributeMapCommand).build() {
1399
1428
  };
@@ -1405,14 +1434,12 @@ var SetPrincipalTagAttributeMapCommand = _SetPrincipalTagAttributeMapCommand;
1405
1434
 
1406
1435
 
1407
1436
 
1408
-
1409
1437
  var _TagResourceCommand = class _TagResourceCommand extends import_smithy_client.Command.classBuilder().ep({
1410
1438
  ...commonParams
1411
1439
  }).m(function(Command, cs, config, o) {
1412
1440
  return [
1413
1441
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1414
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1415
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1442
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1416
1443
  ];
1417
1444
  }).s("AWSCognitoIdentityService", "TagResource", {}).n("CognitoIdentityClient", "TagResourceCommand").f(void 0, void 0).ser(se_TagResourceCommand).de(de_TagResourceCommand).build() {
1418
1445
  };
@@ -1424,14 +1451,12 @@ var TagResourceCommand = _TagResourceCommand;
1424
1451
 
1425
1452
 
1426
1453
 
1427
-
1428
1454
  var _UnlinkDeveloperIdentityCommand = class _UnlinkDeveloperIdentityCommand extends import_smithy_client.Command.classBuilder().ep({
1429
1455
  ...commonParams
1430
1456
  }).m(function(Command, cs, config, o) {
1431
1457
  return [
1432
1458
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1433
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1434
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1459
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1435
1460
  ];
1436
1461
  }).s("AWSCognitoIdentityService", "UnlinkDeveloperIdentity", {}).n("CognitoIdentityClient", "UnlinkDeveloperIdentityCommand").f(void 0, void 0).ser(se_UnlinkDeveloperIdentityCommand).de(de_UnlinkDeveloperIdentityCommand).build() {
1437
1462
  };
@@ -1460,14 +1485,12 @@ var UnlinkIdentityCommand = _UnlinkIdentityCommand;
1460
1485
 
1461
1486
 
1462
1487
 
1463
-
1464
1488
  var _UntagResourceCommand = class _UntagResourceCommand extends import_smithy_client.Command.classBuilder().ep({
1465
1489
  ...commonParams
1466
1490
  }).m(function(Command, cs, config, o) {
1467
1491
  return [
1468
1492
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1469
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1470
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1493
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1471
1494
  ];
1472
1495
  }).s("AWSCognitoIdentityService", "UntagResource", {}).n("CognitoIdentityClient", "UntagResourceCommand").f(void 0, void 0).ser(se_UntagResourceCommand).de(de_UntagResourceCommand).build() {
1473
1496
  };
@@ -1479,14 +1502,12 @@ var UntagResourceCommand = _UntagResourceCommand;
1479
1502
 
1480
1503
 
1481
1504
 
1482
-
1483
1505
  var _UpdateIdentityPoolCommand = class _UpdateIdentityPoolCommand extends import_smithy_client.Command.classBuilder().ep({
1484
1506
  ...commonParams
1485
1507
  }).m(function(Command, cs, config, o) {
1486
1508
  return [
1487
1509
  (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
1488
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
1489
- (0, import_middleware_signing.getAwsAuthPlugin)(config)
1510
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
1490
1511
  ];
1491
1512
  }).s("AWSCognitoIdentityService", "UpdateIdentityPool", {}).n("CognitoIdentityClient", "UpdateIdentityPoolCommand").f(void 0, void 0).ser(se_UpdateIdentityPoolCommand).de(de_UpdateIdentityPoolCommand).build() {
1492
1513
  };
@@ -1526,7 +1547,7 @@ var CognitoIdentity = _CognitoIdentity;
1526
1547
  (0, import_smithy_client.createAggregatedClient)(commands, CognitoIdentity);
1527
1548
 
1528
1549
  // src/pagination/ListIdentityPoolsPaginator.ts
1529
- var import_core = require("@smithy/core");
1550
+
1530
1551
  var paginateListIdentityPools = (0, import_core.createPaginator)(CognitoIdentityClient, ListIdentityPoolsCommand, "NextToken", "NextToken", "MaxResults");
1531
1552
 
1532
1553
  // src/index.ts
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
5
+ const core_2 = require("@smithy/core");
4
6
  const smithy_client_1 = require("@smithy/smithy-client");
5
7
  const url_parser_1 = require("@smithy/url-parser");
6
8
  const util_base64_1 = require("@smithy/util-base64");
7
9
  const util_utf8_1 = require("@smithy/util-utf8");
10
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
11
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
12
  const getRuntimeConfig = (config) => {
10
13
  return {
@@ -14,6 +17,19 @@ const getRuntimeConfig = (config) => {
14
17
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
18
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
19
  extensions: config?.extensions ?? [],
20
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultCognitoIdentityHttpAuthSchemeProvider,
21
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
22
+ {
23
+ schemeId: "aws.auth#sigv4",
24
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
25
+ signer: new core_1.AwsSdkSigV4Signer(),
26
+ },
27
+ {
28
+ schemeId: "smithy.api#noAuth",
29
+ identityProvider: (ipc) => ipc.getIdentityProvider("smithy.api#noAuth") || (async () => ({})),
30
+ signer: new core_2.NoAuthSigner(),
31
+ },
32
+ ],
17
33
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
34
  serviceId: config?.serviceId ?? "Cognito Identity",
19
35
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -1,13 +1,14 @@
1
1
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
2
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
3
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
- import { resolveAwsAuthConfig } from "@aws-sdk/middleware-signing";
5
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
7
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
8
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
9
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
10
  import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultCognitoIdentityHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
11
12
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
12
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
13
14
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,8 +21,8 @@ export class CognitoIdentityClient extends __Client {
20
21
  const _config_3 = resolveEndpointConfig(_config_2);
21
22
  const _config_4 = resolveRetryConfig(_config_3);
22
23
  const _config_5 = resolveHostHeaderConfig(_config_4);
23
- const _config_6 = resolveAwsAuthConfig(_config_5);
24
- const _config_7 = resolveUserAgentConfig(_config_6);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
25
26
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
26
27
  super(_config_8);
27
28
  this.config = _config_8;
@@ -31,8 +32,21 @@ export class CognitoIdentityClient extends __Client {
31
32
  this.middlewareStack.use(getLoggerPlugin(this.config));
32
33
  this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
33
34
  this.middlewareStack.use(getUserAgentPlugin(this.config));
35
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
36
+ httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
37
+ identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
38
+ }));
39
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
34
40
  }
35
41
  destroy() {
36
42
  super.destroy();
37
43
  }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultCognitoIdentityHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
38
52
  }
@@ -0,0 +1,38 @@
1
+ export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
2
+ const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
3
+ let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
4
+ let _credentials = runtimeConfig.credentials;
5
+ return {
6
+ setHttpAuthScheme(httpAuthScheme) {
7
+ const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
8
+ if (index === -1) {
9
+ _httpAuthSchemes.push(httpAuthScheme);
10
+ }
11
+ else {
12
+ _httpAuthSchemes.splice(index, 1, httpAuthScheme);
13
+ }
14
+ },
15
+ httpAuthSchemes() {
16
+ return _httpAuthSchemes;
17
+ },
18
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
19
+ _httpAuthSchemeProvider = httpAuthSchemeProvider;
20
+ },
21
+ httpAuthSchemeProvider() {
22
+ return _httpAuthSchemeProvider;
23
+ },
24
+ setCredentials(credentials) {
25
+ _credentials = credentials;
26
+ },
27
+ credentials() {
28
+ return _credentials;
29
+ },
30
+ };
31
+ };
32
+ export const resolveHttpAuthRuntimeConfig = (config) => {
33
+ return {
34
+ httpAuthSchemes: config.httpAuthSchemes(),
35
+ httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
36
+ credentials: config.credentials(),
37
+ };
38
+ };