Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6.x keycloak upgrade #1252

Merged
merged 3 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/hawtio/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const config: Config = {
'\\.(css|less)$': '<rootDir>/src/__mocks__/styleMock.js',
'@hawtiosrc/(.*)': '<rootDir>/src/$1',
'react-markdown': '<rootDir>/../../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'),
Expand Down
2 changes: 1 addition & 1 deletion packages/hawtio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.6",
"monaco-editor": "^0.52.0",
"oauth4webapi": "^2.17.0",
"react": "^18.3.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/hawtio/src/__mocks__/keycloak.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
Keycloak: () => {},
}
4 changes: 2 additions & 2 deletions packages/hawtio/src/plugins/auth/keycloak/keycloak-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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?.()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/hawtio/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"noImplicitThis": true,
"noUncheckedIndexedAccess": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
Expand Down
23 changes: 6 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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.6"
monaco-editor: "npm:^0.52.0"
oauth4webapi: "npm:^2.17.0"
react: "npm:^18.3.1"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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.6":
version: 26.0.6
resolution: "keycloak-js@npm:26.0.6"
checksum: 10/f4cd1a46f379f38bd426076ab40625602226d8fc8565857d44d97bd408a2604864e567e129526ffe9a4be3bab2955d496aa5f09cda9c59e7eaf5e65eb95de197
languageName: node
linkType: hard

Expand Down
Loading