From 5f07cb374bc303fb1bb98dab207acb27d80c29c3 Mon Sep 17 00:00:00 2001 From: actions Date: Wed, 8 Dec 2021 14:54:09 +0000 Subject: [PATCH 01/13] Update changelog v4.2.13 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1c12d66d..5fc1a127c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### **4.2.13** (2021-12-08) + +- Fix broken link about how to import fonts #62 +- Add a video to show how to test the theme in a local container + ### **4.2.12** (2021-12-08) - Update post build instructions From f316f38ae5bf74f1673b952d2d60be54e19318f2 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Thu, 9 Dec 2021 01:57:03 +0100 Subject: [PATCH 02/13] Update CI workflow (changelog ignore) --- .github/workflows/ci.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ed58c6367..4435b2287 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,7 +28,6 @@ jobs: strategy: matrix: node: [ '15', '14', '13' ] - os: [ windows-latest, ubuntu-latest ] name: Test with Node v${{ matrix.node }} steps: - name: Tell if project is using npm or yarn @@ -150,4 +149,4 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }} - IS_BETA: ${{ needs.check_if_version_upgraded.outputs.is_release_beta }} \ No newline at end of file + IS_BETA: ${{ needs.check_if_version_upgraded.outputs.is_release_beta }} From cb18d3d7654f482c326f66757725c5db5de7ed16 Mon Sep 17 00:00:00 2001 From: garronej Date: Thu, 9 Dec 2021 02:00:50 +0100 Subject: [PATCH 03/13] Bump version (changelog ignore) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc442f2a3..9dbe76f0c 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "4.2.13", + "version": "4.2.14-beta.0", "description": "Keycloak theme generator for Reacts app", "repository": { "type": "git", From 6e0553af9bbc0487cf280c9ff8e54649930c5aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=81=D1=82=D1=80=D0=BE=D0=B2=D0=B0=20=D0=90?= =?UTF-8?q?=D0=BD=D0=BD=D0=B0?= Date: Wed, 8 Dec 2021 10:30:36 +0300 Subject: [PATCH 04/13] Avoid error in Keycloak logs, fix long template loading time --- .gitignore | 2 + .../generateFtl/Object.deepAssign.js | 28 --- .../generateFtl/common.ftl | 208 ---------------- ..._object_to_js_code_declaring_an_object.ftl | 230 ++++++++++++++++++ .../generateFtl/generateFtl.ts | 45 ++-- 5 files changed, 247 insertions(+), 266 deletions(-) delete mode 100644 src/bin/build-keycloak-theme/generateFtl/Object.deepAssign.js delete mode 100644 src/bin/build-keycloak-theme/generateFtl/common.ftl create mode 100644 src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl diff --git a/.gitignore b/.gitignore index 6ab010484..574512007 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,5 @@ jspm_packages /sample_react_project/ /.yarn_home/ + +.idea diff --git a/src/bin/build-keycloak-theme/generateFtl/Object.deepAssign.js b/src/bin/build-keycloak-theme/generateFtl/Object.deepAssign.js deleted file mode 100644 index 028d99900..000000000 --- a/src/bin/build-keycloak-theme/generateFtl/Object.deepAssign.js +++ /dev/null @@ -1,28 +0,0 @@ - -Object.defineProperty( - Object, - "deepAssign", - { - "value": function callee(target, source) { - Object.keys(source).forEach(function (key) { - var value = source[key]; - if (target[key] === undefined) { - target[key] = value; - return; - } - if (value instanceof Object) { - if (value instanceof Array) { - value.forEach(function (entry) { - target[key].push(entry); - }); - return; - } - callee(target[key], value); - return; - } - target[key] = value; - }); - return target; - } - } -); \ No newline at end of file diff --git a/src/bin/build-keycloak-theme/generateFtl/common.ftl b/src/bin/build-keycloak-theme/generateFtl/common.ftl deleted file mode 100644 index 5323e8962..000000000 --- a/src/bin/build-keycloak-theme/generateFtl/common.ftl +++ /dev/null @@ -1,208 +0,0 @@ - \ No newline at end of file diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl new file mode 100644 index 000000000..183d3b950 --- /dev/null +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -0,0 +1,230 @@ + \ No newline at end of file diff --git a/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts b/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts index ab4171408..89e63fa84 100644 --- a/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts +++ b/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts @@ -21,10 +21,6 @@ export const pageIds = [ export type PageId = typeof pageIds[number]; -function loadAdjacentFile(fileBasename: string) { - return fs.readFileSync(pathJoin(__dirname, fileBasename)).toString("utf8"); -} - export function generateFtlFilesCodeFactory(params: { cssGlobalsToDefine: Record; indexHtmlCode: string; @@ -77,8 +73,11 @@ export function generateFtlFilesCodeFactory(params: { ); //FTL is no valid html, we can't insert with cheerio, we put placeholder for injecting later. - const ftlPlaceholders = { - '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': loadAdjacentFile("common.ftl").match(/^", - "", "", - pageSpecificCodePlaceholder, - "", - objectKeys(ftlPlaceholders)[1], + objectKeys(replaceValueBySearchValue)[1], ].join("\n"), ); @@ -129,19 +121,12 @@ export function generateFtlFilesCodeFactory(params: { const $ = cheerio.load(partiallyFixedIndexHtmlCode); - let ftlCode = $.html().replace( - pageSpecificCodePlaceholder, - [ - "", - ].join("\n"), - ); - - objectKeys(ftlPlaceholders).forEach(id => (ftlCode = ftlCode.replace(id, ftlPlaceholders[id]))); + let ftlCode = $.html(); + + Object.entries({ + ...replaceValueBySearchValue, + [pageIdSearchValue]: pageId, + }).map(([searchValue, replaceValue]) => (ftlCode = ftlCode.replace(searchValue, replaceValue))); return { ftlCode }; } From 484f95f5d2bea5fd756d1698d4aa0bcf0eb4adf4 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 12:53:11 +0100 Subject: [PATCH 05/13] Bump beta version (changelog ignore) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9dbe76f0c..3b59dcfdc 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keycloakify", - "version": "4.2.14-beta.0", + "version": "4.2.14-beta.1", "description": "Keycloak theme generator for Reacts app", "repository": { "type": "git", From d70985d8d2109afa794d62c35d862c57b3d094e8 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 14:10:00 +0100 Subject: [PATCH 06/13] Update README, remove all instruction about errors in logs --- README.md | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 3c8025eef..4cbb54835 100644 --- a/README.md +++ b/README.md @@ -20,10 +20,10 @@

-**NEW in v4** +**NEW in 4.2.14** -- Out of the box [frontend form validation](#user-profile-and-frontend-form-validation) 🥳 -- Improvements (and breaking changes in `import { useKcMessage } from "keycloakify"`. +- No more error in Keycloak logs 🍾 +- Templates now load in fraction of a second 🏎 # Motivations @@ -76,8 +76,6 @@ If you already have a Keycloak custom theme, it can be easily ported to Keycloak - [Possible workarounds](#possible-workarounds) - [Implement context persistence (optional)](#implement-context-persistence-optional) - [Kickstart video](#kickstart-video) -- [About the errors related to `objectToJson` in Keycloak logs.](#about-the-errors-related-to-objecttojson-in-keycloak-logs) -- [The pages take too long to load ?](#the-pages-take-too-long-to-load-) - [Adding custom message (to `i18n/useKcMessage.tsx`)](#adding-custom-message-to-i18nusekcmessagetsx) - [Email domain whitelist](#email-domain-whitelist) - [Changelog highlights](#changelog-highlights) @@ -442,36 +440,6 @@ flash of the blank html before the js bundle have been evaluated _NOTE: keycloak-react-theming was renamed keycloakify since this video was recorded_ [![kickstart_video](https://user-images.githubusercontent.com/6702424/108877866-f146ee80-75ff-11eb-8120-003b3c5f6dd8.png)](https://youtu.be/xTz0Rj7i2v8) -# About the errors related to `objectToJson` in Keycloak logs. - -The logs of your keycloak server will always show this kind of errors every time a client request a page: - -```log -FTL stack trace ("~" means nesting-related): - - Failed at: #local value = object[key] [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 70, column 21] - - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5] - - Reached through: @objectToJson_please_ignore_errors object=value depth=(dep... [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 81, column 27] - - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5] - - Reached through: @objectToJson_please_ignore_errors object=(.data_model) de... [in template "login.ftl" at line 163, column 43] -``` - -Theses are expected to show up in the log. -Unfortunately, there is nothing I know of that can be done to avoid them or even mute them. -They can be, however, safely ignored. - -To [converts the `.ftl` values into a JavaScript object](https://github.com/InseeFrLab/keycloakify/blob/main/src/bin/build-keycloak-theme/generateFtl/common.ftl) -without making assumptions on the `.data_model` we have to do things that throws. -It's all-right because every statement that can fail is inside an `<#attempt><#recorver>` block but it results in errors being printed to the logs. - -# The pages take too long to load ? - -The problem of templates taking a long time to load only happens in the test environment, when you have a console logging all the above-mentioned `.ftl` warnings in real time. Logging all those warnings is what takes time. Once in production page load is way faster. - -If you run the docker container locally we acknowledge that the loading time is getting out of hand. -We are [in the process](https://github.com/InseeFrLab/keycloakify/pull/63) of resolving this issue. - -In the meantime we recommend [to run the docker container as a background task](https://youtu.be/F29Z1GaH-jk). - # Adding custom message (to `i18n/useKcMessage.tsx`) You can reproduce [this approach](https://github.com/garronej/keycloakify-demo-app/blob/main/src/kcMessagesExtension.ts) From 159429da6e3f0043943a99b00268ffb782439dd1 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 17:39:39 +0100 Subject: [PATCH 07/13] Remove extra semicollon in ftl (changelog ignore) --- .../generateFtl/ftl_object_to_js_code_declaring_an_object.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 183d3b950..814ba0da4 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -78,7 +78,7 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; return out; -})(); +})() <#function ftl_object_to_js_code_declaring_an_object object path> <#local isHash = ""> From cee9569581e4232e3d63a3cf7c1c57ad8139f0e7 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 18:59:39 +0100 Subject: [PATCH 08/13] Refactor: Create ftl function are_same_path (changelog ignore) --- ..._object_to_js_code_declaring_an_object.ftl | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 814ba0da4..730c4d438 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -113,7 +113,7 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; <#if ["loginUpdatePasswordUrl", "loginUpdateProfileUrl", "loginUsernameReminderUrl", "loginUpdateTotpUrl"]?seq_contains(key) && - path?map(x -> x?is_number?string("_index_",x))?join("°") == ["url"]?join("°") + are_same_path(path, ["url"]) > <#local out_seq += ["/*If you need" + key + " please submit an issue to the Keycloakify repo*/"]> <#continue> @@ -226,5 +226,40 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; <#return "ABORT: Couldn't convert into string non hash, non method, non boolean, non enumerable object"> + +<#function are_same_path path searchedPath> + + <#if path?size != path?size> + <#return false> + + + <#local i=0> + + <#list path as property> + + <#local searchedProperty=searchedPath[i]> + + <#if searchedProperty?is_string && searchedProperty == "*"> + <#continue> + + + <#if searchedProperty?is_string && !property?is_string> + <#return false> + + + <#if searchedProperty?is_number && !property?is_number> + <#return false> + + + <#if searchedProperty?string != property?string> + <#return false> + + + <#local i+= 1> + + + + <#return true> + \ No newline at end of file From 57a5d034ddd770e3e81fa8b81bf8054bfaed55d2 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 19:06:12 +0100 Subject: [PATCH 09/13] Fix ftl error as comment formatting --- .../generateFtl/ftl_object_to_js_code_declaring_an_object.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 730c4d438..8522aaeaa 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -115,7 +115,7 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; ["loginUpdatePasswordUrl", "loginUpdateProfileUrl", "loginUsernameReminderUrl", "loginUpdateTotpUrl"]?seq_contains(key) && are_same_path(path, ["url"]) > - <#local out_seq += ["/*If you need" + key + " please submit an issue to the Keycloakify repo*/"]> + <#local out_seq += ["/*If you need '" + key + "' please submit an issue to the Keycloakify repo*/"]> <#continue> From b3892dab8d4908bdd58b530387395bf090652f7b Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 19:19:17 +0100 Subject: [PATCH 10/13] Ftl prevent error with auth.attemptedUsername --- .../ftl_object_to_js_code_declaring_an_object.ftl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 8522aaeaa..c2cb7df2f 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -119,6 +119,18 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; <#continue> + <#if key == "attemptedUsername" && are_same_path(path, ["auth"])> + + <#attempt> + <#-- https://github.com/keycloak/keycloak/blob/3a2bf0c04bcde185e497aaa32d0bb7ab7520cf4a/themes/src/main/resources/theme/base/login/template.ftl#L63 --> + <#if !(auth?has_content && auth.showUsername() && !auth.showResetCredentials())> + <#continue> + + <#recover> + + + + <#attempt> <#if !object[key]??> <#continue> From 86ab9f72a5f572a30937a0a1a3667807c74e1aa9 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 19:34:50 +0100 Subject: [PATCH 11/13] Ftl prevent error with updateProfileCtx --- .../ftl_object_to_js_code_declaring_an_object.ftl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index c2cb7df2f..0e1389857 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -111,9 +111,15 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc}; <#continue> + <#-- Skip values that are known to throw sometime and that are used nowhere in the base Keycloak template --> <#if - ["loginUpdatePasswordUrl", "loginUpdateProfileUrl", "loginUsernameReminderUrl", "loginUpdateTotpUrl"]?seq_contains(key) && - are_same_path(path, ["url"]) + ( + ["loginUpdatePasswordUrl", "loginUpdateProfileUrl", "loginUsernameReminderUrl", "loginUpdateTotpUrl"]?seq_contains(key) && + are_same_path(path, ["url"]) + ) || ( + key == "updateProfileCtx" && + are_same_path(path, []) + ) > <#local out_seq += ["/*If you need '" + key + "' please submit an issue to the Keycloakify repo*/"]> <#continue> From a8623d80661e5f5163f10536c4b73e6686bb5ecd Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 20:17:50 +0100 Subject: [PATCH 12/13] Fix ftl error related to url.loginAction in saml-post-form.ftl --- .../ftl_object_to_js_code_declaring_an_object.ftl | 11 +++++++++-- .../build-keycloak-theme/generateFtl/generateFtl.ts | 6 ++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl index 0e1389857..b1e6627d3 100644 --- a/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl +++ b/src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl @@ -1,4 +1,5 @@ ", "", objectKeys(replaceValueBySearchValue)[1], @@ -125,7 +122,8 @@ export function generateFtlFilesCodeFactory(params: { Object.entries({ ...replaceValueBySearchValue, - [pageIdSearchValue]: pageId, + //If updated, don't forget to change in the ftl script as well. + "PAGE_ID_xIgLsPgGId9D8e": pageId, }).map(([searchValue, replaceValue]) => (ftlCode = ftlCode.replace(searchValue, replaceValue))); return { ftlCode }; From 26b80d6af71695162767d7943fbfe92aefa92f40 Mon Sep 17 00:00:00 2001 From: garronej Date: Sun, 12 Dec 2021 20:44:03 +0100 Subject: [PATCH 13/13] Encourage users to report errors in logs --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 55498c7b7..1989dc3fd 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ If you already have a Keycloak custom theme, it can be easily ported to Keycloak - [Possible workarounds](#possible-workarounds) - [Implement context persistence (optional)](#implement-context-persistence-optional) - [Kickstart video](#kickstart-video) +- [FTL errors related to `ftl_object_to_js_code_declaring_an_object` in Keycloak logs.](#ftl-errors-related-to-ftl_object_to_js_code_declaring_an_object-in-keycloak-logs) - [Adding custom message (to `i18n/useKcMessage.tsx`)](#adding-custom-message-to-i18nusekcmessagetsx) - [Email domain whitelist](#email-domain-whitelist) - [Changelog highlights](#changelog-highlights) @@ -436,6 +437,23 @@ flash of the blank html before the js bundle have been evaluated _NOTE: keycloak-react-theming was renamed keycloakify since this video was recorded_ [![kickstart_video](https://user-images.githubusercontent.com/6702424/108877866-f146ee80-75ff-11eb-8120-003b3c5f6dd8.png)](https://youtu.be/xTz0Rj7i2v8) +# FTL errors related to `ftl_object_to_js_code_declaring_an_object` in Keycloak logs. + +If you ever encounter one of these errors: + +```log +FTL stack trace ("~" means nesting-related): + - Failed at: #local value = object[key] [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 70, column 21] + - Reached through: @compress [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 36, column 5] + - Reached through: @ftl_object_to_js_code_declaring_an_object object=value depth=(dep... [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 81, column 27] + - Reached through: @compress [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 36, column 5] + - Reached through: @ftl_object_to_js_code_declaring_an_object object=(.data_model) de... [in template "login.ftl" at line 163, column 43] +``` + +It's just noise, they can be safely ignored. +You can, however, and are encouraged to, report any that you would spot. +Just open an issue about it and I will release a patched version of Keycloakify in the better delays. + # Adding custom message (to `i18n/useKcMessage.tsx`) You can reproduce [this approach](https://github.com/garronej/keycloakify-demo-app/blob/main/src/kcMessagesExtension.ts)