From bc5fd58773a806400504f84c56d3d6d890c1f7ea Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 5 Jul 2024 07:56:39 +0000 Subject: [PATCH 1/3] [skip ci] Update to version 7.22.13 in package.json --- packages/oidc-client-service-worker/package.json | 2 +- packages/oidc-client-service-worker/src/version.ts | 2 +- packages/oidc-client/package.json | 2 +- packages/oidc-client/src/version.ts | 2 +- packages/react-oidc/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/oidc-client-service-worker/package.json b/packages/oidc-client-service-worker/package.json index a7ecadb2e..9b4f1c20c 100644 --- a/packages/oidc-client-service-worker/package.json +++ b/packages/oidc-client-service-worker/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/oidc-client-service-worker", - "version": "7.22.9", + "version": "7.22.13", "type": "module", "private": false, "main": "dist/OidcServiceWorker.js", diff --git a/packages/oidc-client-service-worker/src/version.ts b/packages/oidc-client-service-worker/src/version.ts index e9360ead8..5c5154488 100644 --- a/packages/oidc-client-service-worker/src/version.ts +++ b/packages/oidc-client-service-worker/src/version.ts @@ -1 +1 @@ -export default '7.22.9'; +export default '7.22.13'; diff --git a/packages/oidc-client/package.json b/packages/oidc-client/package.json index b21bce7e9..b212dee77 100644 --- a/packages/oidc-client/package.json +++ b/packages/oidc-client/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/oidc-client", - "version": "7.22.9", + "version": "7.22.13", "private": false, "type": "module", "main": "./dist/index.umd.cjs", diff --git a/packages/oidc-client/src/version.ts b/packages/oidc-client/src/version.ts index e9360ead8..5c5154488 100644 --- a/packages/oidc-client/src/version.ts +++ b/packages/oidc-client/src/version.ts @@ -1 +1 @@ -export default '7.22.9'; +export default '7.22.13'; diff --git a/packages/react-oidc/package.json b/packages/react-oidc/package.json index e48c8ee48..246937cbe 100644 --- a/packages/react-oidc/package.json +++ b/packages/react-oidc/package.json @@ -1,6 +1,6 @@ { "name": "@axa-fr/react-oidc", - "version": "7.22.9", + "version": "7.22.13", "private": false, "type": "module", "main": "./dist/index.umd.cjs", From e07f8492c06b6607128a5e2c8e20e55dc0ef82a6 Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 5 Jul 2024 07:56:41 +0000 Subject: [PATCH 2/3] [skip ci] Generate changelog to version 7.22.13 --- CHANGELOG.md | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35904158f..fa2bced4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,24 @@ # Changelog -## 7.22.9 +## 7.22.13 + +- [95c814d](https://github.com/AxaFrance/oidc-client/commit/95c814dd9dd325a3a00c3a0dc049d301d983514e) - fix(ci): setup pnpm (release) (#1399), 2024-07-05 by *Guillaume Chervet* + + +## v7.22.12 + + + +## v7.22.11 + + + +## v7.22.10 + +- [6c80c5c](https://github.com/AxaFrance/oidc-client/commit/6c80c5cc77750aead50e62136a6594b05f21b42b) - fix(oidc): logout trigger login (release) (#1394), 2024-07-04 by *Guillaume Chervet* + + +## v7.22.9 - [77eb9e1](https://github.com/AxaFrance/oidc-client/commit/77eb9e1841814cfeb6c6672159740dad4c0a9d4d) - fix(oidc): MessageChannel is not closed after message is received (release) (#1396), 2024-07-02 by *radk0s* @@ -297,24 +315,3 @@ - [430a06b](https://github.com/AxaFrance/oidc-client/commit/430a06b27b2f7164bc1557a2e55e547b5af3d8d7) - build(npm): bump vite from 4.4.7 to 4.4.12 (#1231), 2023-12-07 by *dependabot[bot]* -## v7.13.1 - -- [96637a7](https://github.com/AxaFrance/oidc-client/commit/96637a73252e9ea34d8687409131f58f09633da6) - fix(oidc): sessions storage renew tokens (release) (#1230), 2023-12-05 by *Guillaume Chervet* - - -## v7.13.0 - -- [49c3d5e](https://github.com/AxaFrance/oidc-client/commit/49c3d5e5487d714ccd97272e37fc34f2a7bd0ff6) - feat(oidc-client): allow to take control on service-worker registration (release) (#1229), 2023-12-04 by *Guillaume Chervet* - - -## v7.12.12 - -- [b070c88](https://github.com/AxaFrance/oidc-client/commit/b070c8848582ac6f52ab7cb00f16b0fe9f702b5f) - fix(oidc-client): Update README.md (release), 2023-11-30 by *Guillaume Chervet* - - -## v7.12.11 - -- [d1480fb](https://github.com/AxaFrance/oidc-client/commit/d1480fbe2c0e275f17775768f83b70d9adf00ee1) - fix(all): dependencies update break the build (release), 2023-11-30 by *Guillaume Chervet* -- [6027511](https://github.com/AxaFrance/oidc-client/commit/6027511a0c8d2112d370d45cf42f144874112f77) - doc(readme) Update README.md, 2023-11-29 by *Guillaume Chervet* - - From 25c55eeb7682356c13987a91d7b8645cca1b0ad5 Mon Sep 17 00:00:00 2001 From: Jason Finch Date: Thu, 11 Jul 2024 01:53:12 +1000 Subject: [PATCH 3/3] refactor(oidc): null coalescing (#1404) (release) --- .../src/OidcServiceWorker.ts | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts index cb3b7ba93..768b5bf9f 100644 --- a/packages/oidc-client-service-worker/src/OidcServiceWorker.ts +++ b/packages/oidc-client-service-worker/src/OidcServiceWorker.ts @@ -97,8 +97,7 @@ const keepAliveAsync = async (event: FetchEvent) => { async function generateDpopAsync(originalRequest: Request, currentDatabase:OidcConfig|null, url: string, extrasClaims={} ) { const headersExtras = serializeHeaders(originalRequest.headers); - if (currentDatabase && - currentDatabase.demonstratingProofOfPossessionConfiguration && + if (currentDatabase?.demonstratingProofOfPossessionConfiguration && currentDatabase.demonstratingProofOfPossessionJwkJson && (!currentDatabase.demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent || currentDatabase.demonstratingProofOfPossessionOnlyWhenDpopHeaderPresent && headersExtras['dpop']) ) { @@ -125,11 +124,7 @@ const handleFetch = async (event: FetchEvent) => { url, trustedDomains, ); - if ( - currentDatabaseForRequestAccessToken && - currentDatabaseForRequestAccessToken.tokens && - currentDatabaseForRequestAccessToken.tokens.access_token - ) { + if (currentDatabaseForRequestAccessToken?.tokens?.access_token) { while ( currentDatabaseForRequestAccessToken.tokens && !isTokensValid(currentDatabaseForRequestAccessToken.tokens) @@ -205,7 +200,7 @@ const handleFetch = async (event: FetchEvent) => { let newBody = actualBody; for (let i = 0; i < numberDatabase; i++) { const currentDb = currentDatabases[i]; - if (currentDb && currentDb.tokens != null) { + if (currentDb?.tokens != null) { const claimsExtras = {ath: await base64urlOfHashOfASCIIEncodingAsync(currentDb.tokens.access_token),}; headers = await generateDpopAsync(originalRequest, currentDb, url, claimsExtras); const keyRefreshToken = @@ -246,10 +241,7 @@ const handleFetch = async (event: FetchEvent) => { integrity: clonedRequest.integrity, }); - if ( - currentDatabase && - currentDatabase.oidcServerConfiguration != null && - currentDatabase.oidcServerConfiguration.revocationEndpoint && + if (currentDatabase?.oidcServerConfiguration?.revocationEndpoint && url.startsWith( normalizeUrl( currentDatabase.oidcServerConfiguration.revocationEndpoint, @@ -272,7 +264,7 @@ const handleFetch = async (event: FetchEvent) => { // @ts-ignore currentDatabase = database[currentLoginCallbackConfigurationName]; let newBody = actualBody; - if (currentDatabase && currentDatabase.codeVerifier != null) { + if (currentDatabase?.codeVerifier != null) { newBody = replaceCodeVerifier( newBody, currentDatabase.codeVerifier, @@ -435,9 +427,7 @@ const handleMessage = async (event: ExtendableMessageEvent) => { if (tokens.refresh_token) { tokens.refresh_token = TOKEN.REFRESH_TOKEN + '_' + configurationName; } - if ( - tokens.idTokenPayload && - tokens.idTokenPayload.nonce && + if (tokens?.idTokenPayload?.nonce && currentDatabase.nonce != null ) { tokens.idTokenPayload.nonce =