@aws-sdk/credential-provider-cognito-identity 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.
package/dist-cjs/index.js
CHANGED
|
@@ -72,15 +72,15 @@ __name(resolveLogins, "resolveLogins");
|
|
|
72
72
|
function fromCognitoIdentity(parameters) {
|
|
73
73
|
return async () => {
|
|
74
74
|
var _a, _b, _c;
|
|
75
|
-
(_a = parameters.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-cognito-identity
|
|
75
|
+
(_a = parameters.logger) == null ? void 0 : _a.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
76
76
|
const { GetCredentialsForIdentityCommand: GetCredentialsForIdentityCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
|
|
77
77
|
const {
|
|
78
78
|
Credentials: {
|
|
79
|
-
AccessKeyId = throwOnMissingAccessKeyId(),
|
|
79
|
+
AccessKeyId = throwOnMissingAccessKeyId(parameters.logger),
|
|
80
80
|
Expiration,
|
|
81
|
-
SecretKey = throwOnMissingSecretKey(),
|
|
81
|
+
SecretKey = throwOnMissingSecretKey(parameters.logger),
|
|
82
82
|
SessionToken
|
|
83
|
-
} = throwOnMissingCredentials()
|
|
83
|
+
} = throwOnMissingCredentials(parameters.logger)
|
|
84
84
|
} = await (parameters.client ?? new CognitoIdentityClient2(
|
|
85
85
|
Object.assign({}, parameters.clientConfig ?? {}, {
|
|
86
86
|
region: ((_b = parameters.clientConfig) == null ? void 0 : _b.region) ?? ((_c = parameters.parentClientConfig) == null ? void 0 : _c.region)
|
|
@@ -102,16 +102,16 @@ function fromCognitoIdentity(parameters) {
|
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
__name(fromCognitoIdentity, "fromCognitoIdentity");
|
|
105
|
-
function throwOnMissingAccessKeyId() {
|
|
106
|
-
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no access key ID");
|
|
105
|
+
function throwOnMissingAccessKeyId(logger) {
|
|
106
|
+
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no access key ID", { logger });
|
|
107
107
|
}
|
|
108
108
|
__name(throwOnMissingAccessKeyId, "throwOnMissingAccessKeyId");
|
|
109
|
-
function throwOnMissingCredentials() {
|
|
110
|
-
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no credentials");
|
|
109
|
+
function throwOnMissingCredentials(logger) {
|
|
110
|
+
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no credentials", { logger });
|
|
111
111
|
}
|
|
112
112
|
__name(throwOnMissingCredentials, "throwOnMissingCredentials");
|
|
113
|
-
function throwOnMissingSecretKey() {
|
|
114
|
-
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no secret key");
|
|
113
|
+
function throwOnMissingSecretKey(logger) {
|
|
114
|
+
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no secret key", { logger });
|
|
115
115
|
}
|
|
116
116
|
__name(throwOnMissingSecretKey, "throwOnMissingSecretKey");
|
|
117
117
|
|
|
@@ -236,7 +236,7 @@ function fromCognitoIdentityPool({
|
|
|
236
236
|
logger,
|
|
237
237
|
parentClientConfig
|
|
238
238
|
}) {
|
|
239
|
-
logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-cognito-identity
|
|
239
|
+
logger == null ? void 0 : logger.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
240
240
|
const cacheKey = userIdentifier ? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}` : void 0;
|
|
241
241
|
let provider = /* @__PURE__ */ __name(async () => {
|
|
242
242
|
const { GetIdCommand: GetIdCommand2, CognitoIdentityClient: CognitoIdentityClient2 } = await Promise.resolve().then(() => (init_loadCognitoIdentity(), loadCognitoIdentity_exports));
|
|
@@ -245,7 +245,7 @@ function fromCognitoIdentityPool({
|
|
|
245
245
|
);
|
|
246
246
|
let identityId = cacheKey && await cache.getItem(cacheKey);
|
|
247
247
|
if (!identityId) {
|
|
248
|
-
const { IdentityId = throwOnMissingId() } = await _client.send(
|
|
248
|
+
const { IdentityId = throwOnMissingId(logger) } = await _client.send(
|
|
249
249
|
new GetIdCommand2({
|
|
250
250
|
AccountId: accountId,
|
|
251
251
|
IdentityPoolId: identityPoolId,
|
|
@@ -275,8 +275,8 @@ function fromCognitoIdentityPool({
|
|
|
275
275
|
});
|
|
276
276
|
}
|
|
277
277
|
__name(fromCognitoIdentityPool, "fromCognitoIdentityPool");
|
|
278
|
-
function throwOnMissingId() {
|
|
279
|
-
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no identity ID");
|
|
278
|
+
function throwOnMissingId(logger) {
|
|
279
|
+
throw new import_property_provider.CredentialsProviderError("Response from Amazon Cognito contained no identity ID", { logger });
|
|
280
280
|
}
|
|
281
281
|
__name(throwOnMissingId, "throwOnMissingId");
|
|
282
282
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -2,9 +2,9 @@ import { CredentialsProviderError } from "@smithy/property-provider";
|
|
|
2
2
|
import { resolveLogins } from "./resolveLogins";
|
|
3
3
|
export function fromCognitoIdentity(parameters) {
|
|
4
4
|
return async () => {
|
|
5
|
-
parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity
|
|
5
|
+
parameters.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
6
6
|
const { GetCredentialsForIdentityCommand, CognitoIdentityClient } = await import("./loadCognitoIdentity");
|
|
7
|
-
const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(), Expiration, SecretKey = throwOnMissingSecretKey(), SessionToken, } = throwOnMissingCredentials(), } = await (parameters.client ??
|
|
7
|
+
const { Credentials: { AccessKeyId = throwOnMissingAccessKeyId(parameters.logger), Expiration, SecretKey = throwOnMissingSecretKey(parameters.logger), SessionToken, } = throwOnMissingCredentials(parameters.logger), } = await (parameters.client ??
|
|
8
8
|
new CognitoIdentityClient(Object.assign({}, parameters.clientConfig ?? {}, {
|
|
9
9
|
region: parameters.clientConfig?.region ?? parameters.parentClientConfig?.region,
|
|
10
10
|
}))).send(new GetCredentialsForIdentityCommand({
|
|
@@ -21,12 +21,12 @@ export function fromCognitoIdentity(parameters) {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function throwOnMissingAccessKeyId() {
|
|
25
|
-
throw new CredentialsProviderError("Response from Amazon Cognito contained no access key ID");
|
|
24
|
+
function throwOnMissingAccessKeyId(logger) {
|
|
25
|
+
throw new CredentialsProviderError("Response from Amazon Cognito contained no access key ID", { logger });
|
|
26
26
|
}
|
|
27
|
-
function throwOnMissingCredentials() {
|
|
28
|
-
throw new CredentialsProviderError("Response from Amazon Cognito contained no credentials");
|
|
27
|
+
function throwOnMissingCredentials(logger) {
|
|
28
|
+
throw new CredentialsProviderError("Response from Amazon Cognito contained no credentials", { logger });
|
|
29
29
|
}
|
|
30
|
-
function throwOnMissingSecretKey() {
|
|
31
|
-
throw new CredentialsProviderError("Response from Amazon Cognito contained no secret key");
|
|
30
|
+
function throwOnMissingSecretKey(logger) {
|
|
31
|
+
throw new CredentialsProviderError("Response from Amazon Cognito contained no secret key", { logger });
|
|
32
32
|
}
|
|
@@ -3,7 +3,7 @@ import { fromCognitoIdentity } from "./fromCognitoIdentity";
|
|
|
3
3
|
import { localStorage } from "./localStorage";
|
|
4
4
|
import { resolveLogins } from "./resolveLogins";
|
|
5
5
|
export function fromCognitoIdentityPool({ accountId, cache = localStorage(), client, clientConfig, customRoleArn, identityPoolId, logins, userIdentifier = !logins || Object.keys(logins).length === 0 ? "ANONYMOUS" : undefined, logger, parentClientConfig, }) {
|
|
6
|
-
logger?.debug("@aws-sdk/credential-provider-cognito-identity
|
|
6
|
+
logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
7
7
|
const cacheKey = userIdentifier
|
|
8
8
|
? `aws:cognito-identity-credentials:${identityPoolId}:${userIdentifier}`
|
|
9
9
|
: undefined;
|
|
@@ -13,7 +13,7 @@ export function fromCognitoIdentityPool({ accountId, cache = localStorage(), cli
|
|
|
13
13
|
new CognitoIdentityClient(Object.assign({}, clientConfig ?? {}, { region: clientConfig?.region ?? parentClientConfig?.region }));
|
|
14
14
|
let identityId = (cacheKey && (await cache.getItem(cacheKey)));
|
|
15
15
|
if (!identityId) {
|
|
16
|
-
const { IdentityId = throwOnMissingId() } = await _client.send(new GetIdCommand({
|
|
16
|
+
const { IdentityId = throwOnMissingId(logger) } = await _client.send(new GetIdCommand({
|
|
17
17
|
AccountId: accountId,
|
|
18
18
|
IdentityPoolId: identityPoolId,
|
|
19
19
|
Logins: logins ? await resolveLogins(logins) : undefined,
|
|
@@ -38,6 +38,6 @@ export function fromCognitoIdentityPool({ accountId, cache = localStorage(), cli
|
|
|
38
38
|
throw err;
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
function throwOnMissingId() {
|
|
42
|
-
throw new CredentialsProviderError("Response from Amazon Cognito contained no identity ID");
|
|
41
|
+
function throwOnMissingId(logger) {
|
|
42
|
+
throw new CredentialsProviderError("Response from Amazon Cognito contained no identity ID", { logger });
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/credential-provider-cognito-identity",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.588.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
6
6
|
"build:cjs": "node ../../scripts/compilation/inline credential-provider-cognito-identity",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@aws-sdk/client-cognito-identity": "3.
|
|
24
|
+
"@aws-sdk/client-cognito-identity": "3.588.0",
|
|
25
25
|
"@aws-sdk/types": "3.577.0",
|
|
26
|
-
"@smithy/property-provider": "^3.
|
|
26
|
+
"@smithy/property-provider": "^3.1.0",
|
|
27
27
|
"@smithy/types": "^3.0.0",
|
|
28
28
|
"tslib": "^2.6.2"
|
|
29
29
|
},
|