@aws-sdk/credential-provider-node 3.972.47 → 3.972.48
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 +12 -1
- package/dist-es/runtime/memoize-chain.js +12 -1
- package/package.json +1 -1
package/dist-cjs/index.js
CHANGED
|
@@ -25,9 +25,20 @@ function memoizeChain(providers, treatAsExpired) {
|
|
|
25
25
|
let activeLock;
|
|
26
26
|
let passiveLock;
|
|
27
27
|
let credentials;
|
|
28
|
+
let forceRefreshLock;
|
|
28
29
|
const provider = async (options) => {
|
|
29
30
|
if (options?.forceRefresh) {
|
|
30
|
-
|
|
31
|
+
if (!forceRefreshLock) {
|
|
32
|
+
forceRefreshLock = chain(options)
|
|
33
|
+
.then((c) => {
|
|
34
|
+
credentials = c;
|
|
35
|
+
})
|
|
36
|
+
.finally(() => {
|
|
37
|
+
forceRefreshLock = undefined;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
await forceRefreshLock;
|
|
41
|
+
return credentials;
|
|
31
42
|
}
|
|
32
43
|
if (credentials?.expiration) {
|
|
33
44
|
if (credentials?.expiration?.getTime() < Date.now()) {
|
|
@@ -3,9 +3,20 @@ export function memoizeChain(providers, treatAsExpired) {
|
|
|
3
3
|
let activeLock;
|
|
4
4
|
let passiveLock;
|
|
5
5
|
let credentials;
|
|
6
|
+
let forceRefreshLock;
|
|
6
7
|
const provider = async (options) => {
|
|
7
8
|
if (options?.forceRefresh) {
|
|
8
|
-
|
|
9
|
+
if (!forceRefreshLock) {
|
|
10
|
+
forceRefreshLock = chain(options)
|
|
11
|
+
.then((c) => {
|
|
12
|
+
credentials = c;
|
|
13
|
+
})
|
|
14
|
+
.finally(() => {
|
|
15
|
+
forceRefreshLock = undefined;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
await forceRefreshLock;
|
|
19
|
+
return credentials;
|
|
9
20
|
}
|
|
10
21
|
if (credentials?.expiration) {
|
|
11
22
|
if (credentials?.expiration?.getTime() < Date.now()) {
|