From d099dbac22d8d49e1b10707a1a7209bc6cf5d893 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 27 Oct 2026 03:56:50 +0000 Subject: [PATCH] chore: Update dist --- THIRD-PARTY | 20 ++++++++-------- dist/index.js | 65 ++++++++++++++++++++++++++++++++------------------- 2 files changed, 51 insertions(+), 34 deletions(-) diff --git a/THIRD-PARTY b/THIRD-PARTY index efec133f..9e595948 100644 --- a/THIRD-PARTY +++ b/THIRD-PARTY @@ -432,7 +432,7 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/signature-v4-multi-region@3.996.48 + - @aws-sdk/signature-v4-multi-region@3.996.49 - @smithy/core@3.36.2 - @smithy/types@4.19.0 @@ -1043,9 +1043,9 @@ Apache License The following npm packages may be included in this product: - @aws-sdk/credential-provider-env@3.972.76 - - @aws-sdk/credential-provider-ini@3.973.19 - - @aws-sdk/credential-provider-node@3.972.86 - - @aws-sdk/token-providers@3.1150.0 + - @aws-sdk/credential-provider-ini@3.973.21 + - @aws-sdk/credential-provider-node@3.972.88 + - @aws-sdk/token-providers@3.1155.0 - @aws-sdk/types@3.975.0 - @aws-sdk/xml-builder@3.972.41 - @smithy/credential-provider-imds@4.5.2 @@ -1261,9 +1261,9 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-process@3.972.74 - - @aws-sdk/credential-provider-sso@3.973.18 - - @aws-sdk/credential-provider-web-identity@3.972.80 + - @aws-sdk/credential-provider-process@3.972.76 + - @aws-sdk/credential-provider-sso@3.973.20 + - @aws-sdk/credential-provider-web-identity@3.972.82 These packages each contain the following license: @@ -1473,9 +1473,9 @@ Apache License The following npm packages may be included in this product: - - @aws-sdk/credential-provider-http@3.972.76 - - @aws-sdk/credential-provider-login@3.972.81 - - @aws-sdk/nested-clients@3.997.48 + - @aws-sdk/credential-provider-http@3.972.78 + - @aws-sdk/credential-provider-login@3.972.83 + - @aws-sdk/nested-clients@3.997.50 These packages each contain the following license: diff --git a/dist/index.js b/dist/index.js index 4c5bb143..a9e139c5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -37191,7 +37191,7 @@ var init_package = __esm({ "node_modules/@aws-sdk/nested-clients/package.json"() { package_default = { name: "@aws-sdk/nested-clients", - version: "3.997.48", + version: "3.997.50", description: "Nested clients for AWS SDK packages.", homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients", license: "Apache-2.0", @@ -37291,10 +37291,10 @@ var init_package = __esm({ "test:watch": "yarn g:vitest watch" }, dependencies: { - "@aws-sdk/core": "^3.978.3", - "@aws-sdk/signature-v4-multi-region": "^3.996.48", - "@aws-sdk/types": "^3.974.6", - "@smithy/core": "^3.35.2", + "@aws-sdk/core": "^3.978.5", + "@aws-sdk/signature-v4-multi-region": "^3.996.49", + "@aws-sdk/types": "^3.975.0", + "@smithy/core": "^3.36.1", "@smithy/fetch-http-handler": "^5.8.0", "@smithy/node-http-handler": "^4.12.1", "@smithy/types": "^4.19.0", @@ -41583,6 +41583,7 @@ var require_dist_cjs9 = __commonJS({ return writeFile2(tokenFilepath, tokenString); }; var lastRefreshAttemptTimes = /* @__PURE__ */ new Map(); + var inFlightRefreshes = /* @__PURE__ */ new Map(); var fromSso = (init = {}) => async ({ callerClientConfig } = {}) => { init.logger?.debug("@aws-sdk/token-providers - fromSso"); const profiles = await parseKnownFiles2(init); @@ -41596,6 +41597,10 @@ var require_dist_cjs9 = __commonJS({ throw new TokenProviderError2(`Profile '${profileName}' is missing required property 'sso_session'.`); } const ssoSessionName = profile["sso_session"]; + const inFlightRefresh = inFlightRefreshes.get(ssoSessionName); + if (inFlightRefresh) { + return await inFlightRefresh; + } const ssoSessions = await loadSsoSessionData2(init); const ssoSession = ssoSessions[ssoSessionName]; if (!ssoSession) { @@ -41624,6 +41629,10 @@ var require_dist_cjs9 = __commonJS({ if (existingToken.expiration.getTime() - Date.now() > EXPIRE_WINDOW_MS) { return existingToken; } + const inFlightRefreshAfterReadingToken = inFlightRefreshes.get(ssoSessionName); + if (inFlightRefreshAfterReadingToken) { + return await inFlightRefreshAfterReadingToken; + } const lastRefreshAttemptTime = lastRefreshAttemptTimes.get(ssoSessionName) ?? 0; if (Date.now() - lastRefreshAttemptTime < 30 * 1e3) { validateTokenExpiry(existingToken); @@ -41632,28 +41641,36 @@ var require_dist_cjs9 = __commonJS({ validateTokenKey("clientId", ssoToken.clientId, true); validateTokenKey("clientSecret", ssoToken.clientSecret, true); validateTokenKey("refreshToken", ssoToken.refreshToken, true); - try { - lastRefreshAttemptTimes.set(ssoSessionName, Date.now()); - const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig); - validateTokenKey("accessToken", newSsoOidcToken.accessToken); - validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); - const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3); + const refresh = (async () => { try { - await writeSSOTokenToFile(ssoSessionName, { - ...ssoToken, - accessToken: newSsoOidcToken.accessToken, - expiresAt: newTokenExpiration.toISOString(), - refreshToken: newSsoOidcToken.refreshToken - }); + lastRefreshAttemptTimes.set(ssoSessionName, Date.now()); + const newSsoOidcToken = await getNewSsoOidcToken(ssoToken, ssoRegion, init, callerClientConfig); + validateTokenKey("accessToken", newSsoOidcToken.accessToken); + validateTokenKey("expiresIn", newSsoOidcToken.expiresIn); + const newTokenExpiration = new Date(Date.now() + newSsoOidcToken.expiresIn * 1e3); + try { + await writeSSOTokenToFile(ssoSessionName, { + ...ssoToken, + accessToken: newSsoOidcToken.accessToken, + expiresAt: newTokenExpiration.toISOString(), + refreshToken: newSsoOidcToken.refreshToken + }); + } catch (error3) { + } + return { + token: newSsoOidcToken.accessToken, + expiration: newTokenExpiration + }; } catch (error3) { + validateTokenExpiry(existingToken); + return existingToken; } - return { - token: newSsoOidcToken.accessToken, - expiration: newTokenExpiration - }; - } catch (error3) { - validateTokenExpiry(existingToken); - return existingToken; + })(); + inFlightRefreshes.set(ssoSessionName, refresh); + try { + return await refresh; + } finally { + inFlightRefreshes.delete(ssoSessionName); } }; var fromStatic2 = ({ token, logger: logger2 }) => async () => {