From c18caf122110643897b114b73cddfd6469455675 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:52:41 +0000 Subject: [PATCH 1/3] build(deps): bump keycloak-js from 23.0.7 to 26.0.2 Bumps [keycloak-js](https://github.com/keycloak/keycloak) from 23.0.7 to 26.0.2. - [Release notes](https://github.com/keycloak/keycloak/releases) - [Commits](https://github.com/keycloak/keycloak/compare/23.0.7...26.0.2) --- updated-dependencies: - dependency-name: keycloak-js dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] (cherry picked from commit e9645dc80a89755b001b78201a5c85c328d9d1a1) --- packages/hawtio/package.json | 2 +- yarn.lock | 23 ++++++----------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/packages/hawtio/package.json b/packages/hawtio/package.json index 67d16abd..749d79e5 100644 --- a/packages/hawtio/package.json +++ b/packages/hawtio/package.json @@ -61,7 +61,7 @@ "jquery": "^3.7.1", "js-logger": "^1.6.1", "jwt-decode": "^4.0.0", - "keycloak-js": "^23.0.7", + "keycloak-js": "^26.0.2", "monaco-editor": "^0.52.0", "oauth4webapi": "^2.17.0", "react": "^18.3.1", diff --git a/yarn.lock b/yarn.lock index 2f48b289..e38f3564 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2051,7 +2051,7 @@ __metadata: jquery: "npm:^3.7.1" js-logger: "npm:^1.6.1" jwt-decode: "npm:^4.0.0" - keycloak-js: "npm:^23.0.7" + keycloak-js: "npm:^26.0.2" monaco-editor: "npm:^0.52.0" oauth4webapi: "npm:^2.17.0" react: "npm:^18.3.1" @@ -5169,7 +5169,7 @@ __metadata: languageName: node linkType: hard -"base64-js@npm:^1.3.1, base64-js@npm:^1.5.1": +"base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" checksum: 10/669632eb3745404c2f822a18fc3a0122d2f9a7a13f7fb8b5823ee19d1d2ff9ee5b52c53367176ea4ad093c332fd5ab4bd0ebae5a8e27917a4105a4cfc86b1005 @@ -10238,13 +10238,6 @@ __metadata: languageName: node linkType: hard -"js-sha256@npm:^0.10.1": - version: 0.10.1 - resolution: "js-sha256@npm:0.10.1" - checksum: 10/6bae235dd458744e573876cc0875e21ea18a84e3aec4ba82d0efdb28537366e225304d93072789883500ca995fcc7c4500528c66d02da88cc5d6ab4554ce2b8c - languageName: node - linkType: hard - "js-tokens@npm:^3.0.0 || ^4.0.0, js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -10465,14 +10458,10 @@ __metadata: languageName: node linkType: hard -"keycloak-js@npm:^23.0.7": - version: 23.0.7 - resolution: "keycloak-js@npm:23.0.7" - dependencies: - base64-js: "npm:^1.5.1" - js-sha256: "npm:^0.10.1" - jwt-decode: "npm:^4.0.0" - checksum: 10/61c127a9ac4954d1d0f7f1eee2348043322e21ec956f1ac7819bced39ce1360470cbbb5bd6f81ac1ee59a6fecc1cc5c2667f4e4f249c9c9b86a747a3654efb97 +"keycloak-js@npm:^26.0.2": + version: 26.0.2 + resolution: "keycloak-js@npm:26.0.2" + checksum: 10/e7df9c65e350ecdfb5e7e9ddfee853aa22824adcfca62a4de121448f9a0cfb1e773f476fb544a45725029cc3ee877d1c2c0103a07bd8ec4e8f15845678688fbd languageName: node linkType: hard From 81603328af2265b3e68d497f189fcdc597f70e36 Mon Sep 17 00:00:00 2001 From: Grzegorz Grzybek Date: Mon, 28 Oct 2024 14:00:31 +0100 Subject: [PATCH 2/3] chore(keycloak): Fix Jest tests with Keycloak.js 26 - but needs tsconfig.json change... (cherry picked from commit 072cb395a0afa0c2f3f2aad74c0b3f5ff3ba6b70) --- packages/hawtio/jest.config.ts | 1 + packages/hawtio/src/__mocks__/keycloak.js | 3 +++ packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts | 4 ++-- packages/hawtio/tsconfig.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 packages/hawtio/src/__mocks__/keycloak.js diff --git a/packages/hawtio/jest.config.ts b/packages/hawtio/jest.config.ts index d9d79a75..a38e5b72 100644 --- a/packages/hawtio/jest.config.ts +++ b/packages/hawtio/jest.config.ts @@ -15,6 +15,7 @@ const config: Config = { '\\.(css|less)$': '/src/__mocks__/styleMock.js', '@hawtiosrc/(.*)': '/src/$1', 'react-markdown': '/../../node_modules/react-markdown/react-markdown.min.js', + 'keycloak-js': path.resolve(__dirname, './src/__mocks__/keycloak.js'), 'monaco-editor': path.resolve(__dirname, './src/__mocks__/monacoEditor.js'), '@monaco-editor/react': path.resolve(__dirname, './src/__mocks__/monacoEditor.js'), '@patternfly/react-code-editor': path.resolve(__dirname, './src/__mocks__/codeEditorMock.js'), diff --git a/packages/hawtio/src/__mocks__/keycloak.js b/packages/hawtio/src/__mocks__/keycloak.js new file mode 100644 index 00000000..c3769a17 --- /dev/null +++ b/packages/hawtio/src/__mocks__/keycloak.js @@ -0,0 +1,3 @@ +module.exports = { + Keycloak: () => {}, +} diff --git a/packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts b/packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts index 0b451cb8..37eaff23 100644 --- a/packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts +++ b/packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts @@ -242,7 +242,7 @@ class KeycloakService implements IKeycloakService { keycloak .updateToken(KEYCLOAK_TOKEN_MINIMUM_VALIDITY) - .then(refreshed => { + .then((refreshed: boolean) => { if (refreshed) { const token = keycloak.token if (token) { @@ -252,7 +252,7 @@ class KeycloakService implements IKeycloakService { log.debug('Token is still valid') } }) - .catch(reason => { + .catch((reason: Error) => { log.error("Couldn't update token:", reason) errorFn?.() }) diff --git a/packages/hawtio/tsconfig.json b/packages/hawtio/tsconfig.json index 1440b66c..63068776 100644 --- a/packages/hawtio/tsconfig.json +++ b/packages/hawtio/tsconfig.json @@ -16,7 +16,7 @@ "noImplicitThis": true, "noUncheckedIndexedAccess": true, "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, From 50b7bc3d792e6bc7745650f41d1edea5924df7e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 05:37:30 +0000 Subject: [PATCH 3/3] build(deps): bump keycloak-js from 26.0.2 to 26.0.6 Bumps [keycloak-js](https://github.com/keycloak/keycloak) from 26.0.2 to 26.0.6. - [Release notes](https://github.com/keycloak/keycloak/releases) - [Commits](https://github.com/keycloak/keycloak/compare/26.0.2...26.0.6) --- updated-dependencies: - dependency-name: keycloak-js dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] (cherry picked from commit bc6ad2d65ca582ba9368605866d10ffe0eaeb4ad) --- packages/hawtio/package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/hawtio/package.json b/packages/hawtio/package.json index 749d79e5..dd380b74 100644 --- a/packages/hawtio/package.json +++ b/packages/hawtio/package.json @@ -61,7 +61,7 @@ "jquery": "^3.7.1", "js-logger": "^1.6.1", "jwt-decode": "^4.0.0", - "keycloak-js": "^26.0.2", + "keycloak-js": "^26.0.6", "monaco-editor": "^0.52.0", "oauth4webapi": "^2.17.0", "react": "^18.3.1", diff --git a/yarn.lock b/yarn.lock index e38f3564..a23ae45f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2051,7 +2051,7 @@ __metadata: jquery: "npm:^3.7.1" js-logger: "npm:^1.6.1" jwt-decode: "npm:^4.0.0" - keycloak-js: "npm:^26.0.2" + keycloak-js: "npm:^26.0.6" monaco-editor: "npm:^0.52.0" oauth4webapi: "npm:^2.17.0" react: "npm:^18.3.1" @@ -10458,10 +10458,10 @@ __metadata: languageName: node linkType: hard -"keycloak-js@npm:^26.0.2": - version: 26.0.2 - resolution: "keycloak-js@npm:26.0.2" - checksum: 10/e7df9c65e350ecdfb5e7e9ddfee853aa22824adcfca62a4de121448f9a0cfb1e773f476fb544a45725029cc3ee877d1c2c0103a07bd8ec4e8f15845678688fbd +"keycloak-js@npm:^26.0.6": + version: 26.0.6 + resolution: "keycloak-js@npm:26.0.6" + checksum: 10/f4cd1a46f379f38bd426076ab40625602226d8fc8565857d44d97bd408a2604864e567e129526ffe9a4be3bab2955d496aa5f09cda9c59e7eaf5e65eb95de197 languageName: node linkType: hard