keycloakify 4.2.12 β†’ 4.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ### **4.2.14** (2021-12-12)
2
+
3
+ - Merge pull request #65 from InseeFrLab/doge_ftl_errors
4
+
5
+ Prevent ftl errors in Keycloak log
6
+ - Encourage users to report errors in logs
7
+ - Fix ftl error related to url.loginAction in saml-post-form.ftl
8
+ - Ftl prevent error with updateProfileCtx
9
+ - Ftl prevent error with auth.attemptedUsername
10
+ - Fix ftl error as comment formatting
11
+ - Merge remote-tracking branch 'origin/main' into doge_ftl_errors
12
+ - Update README, remove all instruction about errors in logs
13
+ - Avoid error in Keycloak logs, fix long template loading time
14
+ - Add missing collon in README sample code
15
+
16
+ Add miss ','
17
+
18
+ ### **4.2.13** (2021-12-08)
19
+
20
+ - Fix broken link about how to import fonts #62
21
+ - Add a video to show how to test the theme in a local container
22
+
1
23
  ### **4.2.12** (2021-12-08)
2
24
 
3
25
  - Update post build instructions
package/README.md CHANGED
@@ -20,10 +20,10 @@
20
20
  <img src="https://user-images.githubusercontent.com/6702424/110260457-a1c3d380-7fac-11eb-853a-80459b65626b.png">
21
21
  </p>
22
22
 
23
- **NEW in v4**
23
+ **NEW in 4.2.14**
24
24
 
25
- - Out of the box [frontend form validation](#user-profile-and-frontend-form-validation) πŸ₯³
26
- - Improvements (and breaking changes in `import { useKcMessage } from "keycloakify"`.
25
+ - No more error in Keycloak logs 🍾
26
+ - Templates now load in fraction of a second 🏎
27
27
 
28
28
  # Motivations
29
29
 
@@ -71,13 +71,12 @@ If you already have a Keycloak custom theme, it can be easily ported to Keycloak
71
71
  - [GitHub Actions](#github-actions)
72
72
  - [Limitations](#limitations)
73
73
  - [`process.env.PUBLIC_URL` not supported.](#processenvpublic_url-not-supported)
74
- - [`@font-face` importing fonts from theΒ `src/` dir](#font-face-importing-fonts-from-thesrc-dir)
74
+ - [`@font-face` importing fonts from the `src/` dir](#font-face-importing-fonts-from-the-src-dir)
75
75
  - [Example of setup that **won't** work](#example-of-setup-that-wont-work)
76
76
  - [Possible workarounds](#possible-workarounds)
77
77
  - [Implement context persistence (optional)](#implement-context-persistence-optional)
78
78
  - [Kickstart video](#kickstart-video)
79
- - [About the errors related to `objectToJson` in Keycloak logs.](#about-the-errors-related-to-objecttojson-in-keycloak-logs)
80
- - [The pages take too long to load ?](#the-pages-take-too-long-to-load-)
79
+ - [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)
81
80
  - [Adding custom message (to `i18n/useKcMessage.tsx`)](#adding-custom-message-to-i18nusekcmessagetsx)
82
81
  - [Email domain whitelist](#email-domain-whitelist)
83
82
  - [Changelog highlights](#changelog-highlights)
@@ -152,27 +151,23 @@ your index should look something like:
152
151
  `src/index.tsx`
153
152
 
154
153
  ```tsx
155
- import {Β App } from "./<wherever>/App";
156
- import {
157
- KcApp,
158
- defaultKcProps,
159
- getKcContext
160
- } from "keycloakify";
161
- import {Β css }Β from "tss-react/@emotion/css";
154
+ import { App } from "./<wherever>/App";
155
+ import { KcApp, defaultKcProps, getKcContext } from "keycloakify";
156
+ import { css } from "tss-react/@emotion/css";
162
157
 
163
158
  const { kcContext } = getKcContext();
164
159
 
165
160
  const myClassName = css({ "color": "red" });
166
161
 
167
162
  reactDom.render(
168
- <KcApp
169
- kcContext={kcContext}
170
- {...{
171
- ...defaultKcProps,
172
- "kcHeaderWrapperClass": myClassName
173
- }}
174
- />
175
- document.getElementById("root")
163
+ <KcApp
164
+ kcContext={kcContext}
165
+ {...{
166
+ ...defaultKcProps,
167
+ "kcHeaderWrapperClass": myClassName,
168
+ }}
169
+ />,
170
+ document.getElementById("root"),
176
171
  );
177
172
  ```
178
173
 
@@ -358,7 +353,7 @@ the building and publishing of the theme (the .jar file).
358
353
  You won't be able to [import things from your public directory **in your JavaScript code**](https://create-react-app.dev/docs/using-the-public-folder/#adding-assets-outside-of-the-module-system).
359
354
  (This isn't recommended anyway).
360
355
 
361
- ## `@font-face` importing fonts from theΒ `src/` dir
356
+ ## `@font-face` importing fonts from the `src/` dir
362
357
 
363
358
  If you are building the theme with [--external-assets](#enable-loading-in-a-blink-of-a-eye-of-login-pages-)
364
359
  this limitation doesn't apply, you can import fonts however you see fit.
@@ -374,7 +369,8 @@ this limitation doesn't apply, you can import fonts however you see fit.
374
369
  - If it is possible, use Google Fonts or any other font provider.
375
370
  - If you want to host your font recommended approach is to move your fonts into the `public`
376
371
  directory and to place your `@font-face` statements in the `public/index.html`.
377
- Example [here](https://github.com/InseeFrLab/onyxia-ui/blob/0e3a04610cfe872ca71dad59e05ced8f785dee4b/public/index.html#L6-L51).
372
+ Example [here](https://github.com/garronej/keycloakify-demo-app/blob/9aa2dbaec28a7786d6b2983c9a59d393dec1b2d6/public/index.html#L27-L73)
373
+ (and the font are [here](https://github.com/garronej/keycloakify-demo-app/tree/main/public/fonts/WorkSans)).
378
374
  - You can also [use non relative url](https://github.com/garronej/keycloakify-demo-app/blob/2de8a9eb6f5de9c94f9cd3991faad0377e63268c/src/fonts.scss#L16) but don't forget [`Access-Control-Allow-Origin`](https://github.com/garronej/keycloakify-demo-app/blob/2de8a9eb6f5de9c94f9cd3991faad0377e63268c/nginx.conf#L17-L19).
379
375
 
380
376
  # Implement context persistence (optional)
@@ -441,35 +437,22 @@ flash of the blank html before the js bundle have been evaluated
441
437
  _NOTE: keycloak-react-theming was renamed keycloakify since this video was recorded_
442
438
  [![kickstart_video](https://user-images.githubusercontent.com/6702424/108877866-f146ee80-75ff-11eb-8120-003b3c5f6dd8.png)](https://youtu.be/xTz0Rj7i2v8)
443
439
 
444
- # About the errors related to `objectToJson` in Keycloak logs.
440
+ # FTL errors related to `ftl_object_to_js_code_declaring_an_object` in Keycloak logs.
445
441
 
446
- The logs of your keycloak server will always show this kind of errors every time a client request a page:
442
+ If you ever encounter one of these errors:
447
443
 
448
444
  ```log
449
445
  FTL stack trace ("~" means nesting-related):
450
- - Failed at: #local value = object[key] [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 70, column 21]
451
- - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5]
452
- - 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]
453
- - Reached through: @compress [in template "login.ftl" in macro "objectToJson_please_ignore_errors" at line 36, column 5]
454
- - Reached through: @objectToJson_please_ignore_errors object=(.data_model) de... [in template "login.ftl" at line 163, column 43]
446
+ - 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]
447
+ - Reached through: @compress [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 36, column 5]
448
+ - 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]
449
+ - Reached through: @compress [in template "login.ftl" in macro "ftl_object_to_js_code_declaring_an_object" at line 36, column 5]
450
+ - Reached through: @ftl_object_to_js_code_declaring_an_object object=(.data_model) de... [in template "login.ftl" at line 163, column 43]
455
451
  ```
456
452
 
457
- Theses are expected to show up in the log.
458
- Unfortunately, there is nothing I know of that can be done to avoid them or even mute them.
459
- They can be, however, safely ignored.
460
-
461
- To [converts the `.ftl` values into a JavaScript object](https://github.com/InseeFrLab/keycloakify/blob/main/src/bin/build-keycloak-theme/generateFtl/common.ftl)
462
- without making assumptions on the `.data_model` we have to do things that throws.
463
- 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.
464
-
465
- # The pages take too long to load ?
466
-
467
- 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.
468
-
469
- If you run the docker container locally we aknowelage that the loading time is getting out of hand.
470
- We are [in the process](https://github.com/InseeFrLab/keycloakify/pull/63) of resolving this issue.
471
-
472
- In the meantime we recommend to run the docker container as a background task.
453
+ It's just noise, they can be safely ignored.
454
+ You can, however, and are encouraged to, report any that you would spot.
455
+ Just open an issue about it and I will release a patched version of Keycloakify in the better delays.
473
456
 
474
457
  # Adding custom message (to `i18n/useKcMessage.tsx`)
475
458
 
@@ -127,13 +127,14 @@ function main() {
127
127
  "",
128
128
  "\uD83D\uDC49 $ ./" + (0, path_1.relative)(reactProjectDirPath, (0, path_1.join)(exports.keycloakThemeBuildingDirPath, generateDebugFiles_1.containerLaunchScriptBasename)) + " \uD83D\uDC48",
129
129
  "",
130
- "To test your theme: ",
130
+ "Once your container is up and running: ",
131
131
  "- Log into the admin console πŸ‘‰ http://localhost:8080 username: admin, password: admin πŸ‘ˆ",
132
132
  '- Create a realm named "myrealm"',
133
133
  '- Create a client with id "myclient" and root url: "https://www.keycloak.org/app/"',
134
134
  "- Select Login Theme: " + themeName + " (don't forget to save at the bottom of the page)",
135
- "- Go to \uD83D\uDC49 https://www.keycloak.org/app/ \uD83D\uDC48 Click \"Save\" then \"Sign in\"",
136
- "You should see your login page, More details: https://www.keycloak.org/getting-started/getting-started-docker",
135
+ "- Go to \uD83D\uDC49 https://www.keycloak.org/app/ \uD83D\uDC48 Click \"Save\" then \"Sign in\". You should see your login page",
136
+ "",
137
+ "Video demoing this process: https://youtu.be/N3wlBoH4hKg",
137
138
  "",
138
139
  ].join("\n"));
139
140
  }
@@ -1 +1 @@
1
- {"version":3,"file":"build-keycloak-theme.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/build-keycloak-theme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAkF;AAClF,mEAAkE;AAClE,6BAA4F;AAC5F,2DAA+C;AAC/C,2DAAyF;AACzF,2BAA0B;AAQ1B,IAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1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,IAAA,eAAY,EAAC,WAAW,CAAC,4BAAuB,IAAA,eAAY,EAAC,WAAW,CAAG;QACzH,yBAAyB;QACzB,gCAAgC;QAChC,sCAAsC;QACtC,UAAU;QACV,8BAA8B;QAC9B,gCAAgC;QAChC,qEAAqE;QACrE,iBAAiB;QACjB,2BAA2B;QAC3B,oBAAoB;QACpB,+BAA+B;QAC/B,wBAAwB;QACxB,uBAAuB;QACvB,yCAAyC;QACzC,EAAE;QACF,EAAE;QACF,8HAA8H;QAC9H,EAAE;QACF,sBAAU,IAAA,eAAY,EAAC,mBAAmB,EAAE,IAAA,WAAQ,EAAC,oCAA4B,EAAE,kDAA6B,CAAC,CAAC,kBAAK;QACvH,EAAE;QACF,sBAAsB;QACtB,2FAA2F;QAC3F,kCAAkC;QAClC,oFAAoF;QACpF,2BAAyB,SAAS,sDAAmD;QACrF,iGAAyE;QACzE,+GAA+G;QAC/G,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;AACN,CAAC;AAzGD,oBAyGC"}
1
+ {"version":3,"file":"build-keycloak-theme.js","sourceRoot":"","sources":["../../src/bin/build-keycloak-theme/build-keycloak-theme.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mFAAkF;AAClF,mEAAkE;AAClE,6BAA4F;AAC5F,2DAA+C;AAC/C,2DAAyF;AACzF,2BAA0B;AAQ1B,IAAM,mBAAmB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAE1C,IAAM,mBAAmB,GAAG,CAAA,MAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,0CAAE,WAAW,EAAE,MAAK,mBAAmB,CAAC;AAEnF,IAAM,iBAAiB,GAAsB,OAAO,CAAC,IAAA,WAAQ,EAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC,CAAC;AAEvF,QAAA,4BAA4B,GAAG,IAAA,WAAQ,EAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC;AAE5F,S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8HAA8H;QAC9H,EAAE;QACF,sBAAU,IAAA,eAAY,EAAC,mBAAmB,EAAE,IAAA,WAAQ,EAAC,oCAA4B,EAAE,kDAA6B,CAAC,CAAC,kBAAK;QACvH,EAAE;QACF,yCAAyC;QACzC,2FAA2F;QAC3F,kCAAkC;QAClC,oFAAoF;QACpF,2BAAyB,SAAS,sDAAmD;QACrF,iIAAyG;QACzG,EAAE;QACF,0DAA0D;QAC1D,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CACf,CAAC;AACN,CAAC;AA1GD,oBA0GC"}
@@ -0,0 +1,290 @@
1
+ <script>const _=
2
+ <#assign pageId="PAGE_ID_xIgLsPgGId9D8e">
3
+ (()=>{
4
+
5
+ const out =
6
+ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
7
+
8
+ out["msg"]= function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); };
9
+ out["advancedMsg"]= function(){ throw new Error("use import { useKcMessage } from 'keycloakify'"); };
10
+
11
+ out["messagesPerField"]= {
12
+ <#assign fieldNames = [
13
+ "global", "userLabel", "username", "email", "firstName", "lastName", "password", "password-confirm",
14
+ "totp", "totpSecret", "SAMLRequest", "SAMLResponse", "relayState", "device_user_code", "code",
15
+ "password-new", "rememberMe", "login", "authenticationExecution", "cancel-aia", "clientDataJSON",
16
+ "authenticatorData", "signature", "credentialId", "userHandle", "error", "authn_use_chk", "authenticationExecution",
17
+ "isSetRetry", "try-again", "attestationObject", "publicKeyCredentialId", "authenticatorLabel"
18
+ ]>
19
+
20
+ <#attempt>
21
+ <#if profile?? && profile.attributes?? && profile.attributes?is_enumerable>
22
+ <#list profile.attributes as attribute>
23
+ <#if fieldNames?seq_contains(attribute.name)>
24
+ <#continue>
25
+ </#if>
26
+ <#assign fieldNames += [attribute.name]>
27
+ </#list>
28
+ </#if>
29
+ <#recover>
30
+ </#attempt>
31
+
32
+ "printIfExists": function (fieldName, x) {
33
+ <#list fieldNames as fieldName>
34
+ if(fieldName === "${fieldName}" ){
35
+ <#attempt>
36
+ return "${messagesPerField.printIfExists(fieldName,'1')}" ? x : undefined;
37
+ <#recover>
38
+ </#attempt>
39
+ }
40
+ </#list>
41
+ throw new Error("There is no " + fieldName + " field");
42
+ },
43
+ "existsError": function (fieldName) {
44
+ <#list fieldNames as fieldName>
45
+ if(fieldName === "${fieldName}" ){
46
+ <#attempt>
47
+ return <#if messagesPerField.existsError('${fieldName}')>true<#else>false</#if>;
48
+ <#recover>
49
+ </#attempt>
50
+ }
51
+ </#list>
52
+ throw new Error("There is no " + fieldName + " field");
53
+ },
54
+ "get": function (fieldName) {
55
+ <#list fieldNames as fieldName>
56
+ if(fieldName === "${fieldName}" ){
57
+ <#attempt>
58
+ <#if messagesPerField.existsError('${fieldName}')>
59
+ return "${messagesPerField.get('${fieldName}')?no_esc}";
60
+ </#if>
61
+ <#recover>
62
+ </#attempt>
63
+ }
64
+ </#list>
65
+ throw new Error("There is no " + fieldName + " field");
66
+ },
67
+ "exists": function (fieldName) {
68
+ <#list fieldNames as fieldName>
69
+ if(fieldName === "${fieldName}" ){
70
+ <#attempt>
71
+ return <#if messagesPerField.exists('${fieldName}')>true<#else>false</#if>;
72
+ <#recover>
73
+ </#attempt>
74
+ }
75
+ </#list>
76
+ throw new Error("There is no " + fieldName + " field");
77
+ }
78
+ };
79
+
80
+ out["pageId"] = "${pageId}";
81
+
82
+ return out;
83
+
84
+ })()
85
+ <#function ftl_object_to_js_code_declaring_an_object object path>
86
+
87
+ <#local isHash = "">
88
+ <#attempt>
89
+ <#local isHash = object?is_hash || object?is_hash_ex>
90
+ <#recover>
91
+ <#return "ABORT: Can't evaluate if " + path?join(".") + " is hash">
92
+ </#attempt>
93
+
94
+ <#if isHash>
95
+
96
+ <#if path?size gt 10>
97
+ <#return "ABORT: Too many recursive calls">
98
+ </#if>
99
+
100
+ <#local keys = "">
101
+
102
+ <#attempt>
103
+ <#local keys = object?keys>
104
+ <#recover>
105
+ <#return "ABORT: We can't list keys on this object">
106
+ </#attempt>
107
+
108
+
109
+ <#local out_seq = []>
110
+
111
+ <#list keys as key>
112
+
113
+ <#if ["class","declaredConstructors","superclass","declaringClass" ]?seq_contains(key) >
114
+ <#continue>
115
+ </#if>
116
+
117
+ <#if
118
+ (
119
+ ["loginUpdatePasswordUrl", "loginUpdateProfileUrl", "loginUsernameReminderUrl", "loginUpdateTotpUrl"]?seq_contains(key) &&
120
+ are_same_path(path, ["url"])
121
+ ) || (
122
+ key == "updateProfileCtx" &&
123
+ are_same_path(path, [])
124
+ ) || (
125
+ <#-- https://github.com/InseeFrLab/keycloakify/pull/65#issuecomment-991896344 -->
126
+ key == "loginAction" &&
127
+ are_same_path(path, ["url"]) &&
128
+ pageId == "saml-post-form.ftl"
129
+ )
130
+ >
131
+ <#local out_seq += ["/*If you need '" + key + "' on " + pageId + ", please submit an issue to the Keycloakify repo*/"]>
132
+ <#continue>
133
+ </#if>
134
+
135
+ <#if key == "attemptedUsername" && are_same_path(path, ["auth"])>
136
+
137
+ <#attempt>
138
+ <#-- https://github.com/keycloak/keycloak/blob/3a2bf0c04bcde185e497aaa32d0bb7ab7520cf4a/themes/src/main/resources/theme/base/login/template.ftl#L63 -->
139
+ <#if !(auth?has_content && auth.showUsername() && !auth.showResetCredentials())>
140
+ <#continue>
141
+ </#if>
142
+ <#recover>
143
+ </#attempt>
144
+
145
+ </#if>
146
+
147
+ <#attempt>
148
+ <#if !object[key]??>
149
+ <#continue>
150
+ </#if>
151
+ <#recover>
152
+ <#local out_seq += ["/*Couldn't test if '" + key + "' is available on this object*/"]>
153
+ <#continue>
154
+ </#attempt>
155
+
156
+ <#local propertyValue = "">
157
+
158
+ <#attempt>
159
+ <#local propertyValue = object[key]>
160
+ <#recover>
161
+ <#local out_seq += ["/*Couldn't dereference '" + key + "' on this object*/"]>
162
+ <#continue>
163
+ </#attempt>
164
+
165
+ <#local rec_out = ftl_object_to_js_code_declaring_an_object(propertyValue, path + [ key ])>
166
+
167
+ <#if rec_out?starts_with("ABORT:")>
168
+
169
+ <#local errorMessage = rec_out?remove_beginning("ABORT:")>
170
+
171
+ <#if errorMessage != " It's a method" >
172
+ <#local out_seq += ["/*" + key + ": " + errorMessage + "*/"]>
173
+ </#if>
174
+
175
+ <#continue>
176
+ </#if>
177
+
178
+ <#local out_seq += ['"' + key + '": ' + rec_out + ","]>
179
+
180
+ </#list>
181
+
182
+ <#return (["{"] + out_seq?map(str -> ""?right_pad(4 * (path?size + 1)) + str) + [ ""?right_pad(4 * path?size) + "}"])?join("\n")>
183
+
184
+ </#if>
185
+
186
+ <#local isMethod = "">
187
+ <#attempt>
188
+ <#local isMethod = object?is_method>
189
+ <#recover>
190
+ <#return "ABORT: Can't test if it'sa method.">
191
+ </#attempt>
192
+
193
+ <#if isMethod>
194
+ <#return "ABORT: It's a method">
195
+ </#if>
196
+
197
+ <#local isBoolean = "">
198
+ <#attempt>
199
+ <#local isBoolean = object?is_boolean>
200
+ <#recover>
201
+ <#return "ABORT: Can't test if it's a boolean">
202
+ </#attempt>
203
+
204
+ <#if isBoolean>
205
+ <#return object?c>
206
+ </#if>
207
+
208
+ <#local isEnumerable = "">
209
+ <#attempt>
210
+ <#local isEnumerable = object?is_enumerable>
211
+ <#recover>
212
+ <#return "ABORT: Can't test if it's an enumerable">
213
+ </#attempt>
214
+
215
+
216
+ <#if isEnumerable>
217
+
218
+ <#local out_seq = []>
219
+
220
+ <#local i = 0>
221
+
222
+ <#list object as array_item>
223
+
224
+ <#local rec_out = ftl_object_to_js_code_declaring_an_object(array_item, path + [ i ])>
225
+
226
+ <#local i = i + 1>
227
+
228
+ <#if rec_out?starts_with("ABORT:")>
229
+
230
+ <#local errorMessage = rec_out?remove_beginning("ABORT:")>
231
+
232
+ <#if errorMessage != " It's a method" >
233
+ <#local out_seq += ["/*" + i?string + ": " + errorMessage + "*/"]>
234
+ </#if>
235
+
236
+ <#continue>
237
+ </#if>
238
+
239
+ <#local out_seq += [rec_out + ","]>
240
+
241
+ </#list>
242
+
243
+ <#return (["["] + out_seq?map(str -> ""?right_pad(4 * (path?size + 1)) + str) + [ ""?right_pad(4 * path?size) + "]"])?join("\n")>
244
+
245
+ </#if>
246
+
247
+ <#attempt>
248
+ <#return '"' + object?js_string + '"'>;
249
+ <#recover>
250
+ </#attempt>
251
+
252
+ <#return "ABORT: Couldn't convert into string non hash, non method, non boolean, non enumerable object">
253
+
254
+ </#function>
255
+ <#function are_same_path path searchedPath>
256
+
257
+ <#if path?size != path?size>
258
+ <#return false>
259
+ </#if>
260
+
261
+ <#local i=0>
262
+
263
+ <#list path as property>
264
+
265
+ <#local searchedProperty=searchedPath[i]>
266
+
267
+ <#if searchedProperty?is_string && searchedProperty == "*">
268
+ <#continue>
269
+ </#if>
270
+
271
+ <#if searchedProperty?is_string && !property?is_string>
272
+ <#return false>
273
+ </#if>
274
+
275
+ <#if searchedProperty?is_number && !property?is_number>
276
+ <#return false>
277
+ </#if>
278
+
279
+ <#if searchedProperty?string != property?string>
280
+ <#return false>
281
+ </#if>
282
+
283
+ <#local i+= 1>
284
+
285
+ </#list>
286
+
287
+ <#return true>
288
+
289
+ </#function>
290
+ </script>
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __read = (this && this.__read) || function (o, n) {
3
14
  var m = typeof Symbol === "function" && o[Symbol.iterator];
4
15
  if (!m) return o;
@@ -48,9 +59,6 @@ exports.pageIds = [
48
59
  "login-update-profile.ftl",
49
60
  "login-idp-link-confirm.ftl",
50
61
  ];
51
- function loadAdjacentFile(fileBasename) {
52
- return fs_1.default.readFileSync((0, path_1.join)(__dirname, fileBasename)).toString("utf8");
53
- }
54
62
  function generateFtlFilesCodeFactory(params) {
55
63
  var cssGlobalsToDefine = params.cssGlobalsToDefine, indexHtmlCode = params.indexHtmlCode, urlPathname = params.urlPathname, urlOrigin = params.urlOrigin;
56
64
  var $ = cheerio_1.default.load(indexHtmlCode);
@@ -100,8 +108,11 @@ function generateFtlFilesCodeFactory(params) {
100
108
  });
101
109
  });
102
110
  //FTL is no valid html, we can't insert with cheerio, we put placeholder for injecting later.
103
- var ftlPlaceholders = {
104
- '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': loadAdjacentFile("common.ftl").match(/^<script>const _=((?:.|\n)+)<\/script>[\n]?$/)[1],
111
+ var replaceValueBySearchValue = {
112
+ '{ "x": "vIdLqMeOed9sdLdIdOxdK0d" }': fs_1.default
113
+ .readFileSync((0, path_1.join)(__dirname, "ftl_object_to_js_code_declaring_an_object.ftl"))
114
+ .toString("utf8")
115
+ .match(/^<script>const _=((?:.|\n)+)<\/script>[\n]?$/)[1],
105
116
  "<!-- xIdLqMeOedErIdLsPdNdI9dSlxI -->": [
106
117
  "<#if scripts??>",
107
118
  " <#list scripts as script>",
@@ -110,7 +121,6 @@ function generateFtlFilesCodeFactory(params) {
110
121
  "</#if>",
111
122
  ].join("\n"),
112
123
  };
113
- var pageSpecificCodePlaceholder = "<!-- dIddLqMeOedErIdLsPdNdI9dSl42sw -->";
114
124
  $("head").prepend(__spreadArray(__spreadArray([], __read((Object.keys(cssGlobalsToDefine).length === 0
115
125
  ? []
116
126
  : [
@@ -124,32 +134,22 @@ function generateFtlFilesCodeFactory(params) {
124
134
  "",
125
135
  ])), false), [
126
136
  "<script>",
127
- loadAdjacentFile("Object.deepAssign.js"),
128
- "</script>",
129
- "<script>",
130
- " window." + ftlValuesGlobalName_1.ftlValuesGlobalName + "= Object.assign(",
131
- " {},",
132
- " " + (0, objectKeys_1.objectKeys)(ftlPlaceholders)[0],
133
- " );",
137
+ " window." + ftlValuesGlobalName_1.ftlValuesGlobalName + "= " + (0, objectKeys_1.objectKeys)(replaceValueBySearchValue)[0] + ";",
134
138
  "</script>",
135
139
  "",
136
- pageSpecificCodePlaceholder,
137
- "",
138
- (0, objectKeys_1.objectKeys)(ftlPlaceholders)[1],
140
+ (0, objectKeys_1.objectKeys)(replaceValueBySearchValue)[1],
139
141
  ], false).join("\n"));
140
142
  var partiallyFixedIndexHtmlCode = $.html();
141
143
  function generateFtlFilesCode(params) {
142
144
  var pageId = params.pageId;
143
145
  var $ = cheerio_1.default.load(partiallyFixedIndexHtmlCode);
144
- var ftlCode = $.html().replace(pageSpecificCodePlaceholder, [
145
- "<script>",
146
- " Object.deepAssign(",
147
- " window." + ftlValuesGlobalName_1.ftlValuesGlobalName + ",",
148
- " { \"pageId\": \"" + pageId + "\" }",
149
- " );",
150
- "</script>",
151
- ].join("\n"));
152
- (0, objectKeys_1.objectKeys)(ftlPlaceholders).forEach(function (id) { return (ftlCode = ftlCode.replace(id, ftlPlaceholders[id])); });
146
+ var ftlCode = $.html();
147
+ Object.entries(__assign(__assign({}, replaceValueBySearchValue), {
148
+ //If updated, don't forget to change in the ftl script as well.
149
+ "PAGE_ID_xIgLsPgGId9D8e": pageId })).map(function (_a) {
150
+ var _b = __read(_a, 2), searchValue = _b[0], replaceValue = _b[1];
151
+ return (ftlCode = ftlCode.replace(searchValue, replaceValue));
152
+ });
153
153
  return { ftlCode: ftlCode };
154
154
  }
155
155
  return { generateFtlFilesCode: generateFtlFilesCode };
@@ -1 +1 @@
1
- {"version":3,"file":"generateFtl.js","sourceRoot":"","sources":["../../../src/bin/build-keycloak-theme/generateFtl/generateFtl.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,sEAA6I;AAC7I,0CAAoB;AACpB,6BAAwC;AACxC,+CAA8C;AAC9C,8DAA6D;AAEhD,QAAA,OAAO,GAAG;IACnB,WAAW;IACX,cAAc;IACd,2BAA2B;IAC3B,UAAU;IACV,WAAW;IACX,0BAA0B;IAC1B,wBAAwB;IACxB,WAAW;IAC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D;YAC/D,wBAAwB,EAAE,MAAM,IAClC,CAAC,GAAG,CAAC,UAAC,EAA2B;gBAA3B,KAAA,aAA2B,EAA1B,WAAW,QAAA,EAAE,YAAY,QAAA;YAAM,OAAA,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAAtD,CAAsD,CAAC,CAAC;QAEhG,OAAO,EAAE,OAAO,SAAA,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,EAAE,oBAAoB,sBAAA,EAAE,CAAC;AACpC,CAAC;AA7GD,kEA6GC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keycloakify",
3
- "version": "4.2.12",
3
+ "version": "4.2.14",
4
4
  "description": "Keycloak theme generator for Reacts app",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,8 +32,7 @@
32
32
  "src/bin/build-keycloak-theme/generateDebugFiles/index.ts",
33
33
  "src/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_11.0.3.xml",
34
34
  "src/bin/build-keycloak-theme/generateDebugFiles/standalone-ha_15.0.2.xml",
35
- "src/bin/build-keycloak-theme/generateFtl/Object.deepAssign.js",
36
- "src/bin/build-keycloak-theme/generateFtl/common.ftl",
35
+ "src/bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl",
37
36
  "src/bin/build-keycloak-theme/generateFtl/generateFtl.ts",
38
37
  "src/bin/build-keycloak-theme/generateFtl/index.ts",
39
38
  "src/bin/build-keycloak-theme/generateJavaStackFiles.ts",
@@ -114,8 +113,7 @@
114
113
  "bin/build-keycloak-theme/generateDebugFiles/index.js.map",
115
114
  "bin/build-keycloak-theme/generateDebugFiles/standalone-ha_11.0.3.xml",
116
115
  "bin/build-keycloak-theme/generateDebugFiles/standalone-ha_15.0.2.xml",
117
- "bin/build-keycloak-theme/generateFtl/Object.deepAssign.js",
118
- "bin/build-keycloak-theme/generateFtl/common.ftl",
116
+ "bin/build-keycloak-theme/generateFtl/ftl_object_to_js_code_declaring_an_object.ftl",
119
117
  "bin/build-keycloak-theme/generateFtl/generateFtl.d.ts",
120
118
  "bin/build-keycloak-theme/generateFtl/generateFtl.js",
121
119
  "bin/build-keycloak-theme/generateFtl/generateFtl.js.map",
@@ -121,13 +121,14 @@ export function main() {
121
121
  "",
122
122
  `πŸ‘‰ $ ./${pathRelative(reactProjectDirPath, pathJoin(keycloakThemeBuildingDirPath, containerLaunchScriptBasename))} πŸ‘ˆ`,
123
123
  "",
124
- "To test your theme: ",
124
+ "Once your container is up and running: ",
125
125
  "- Log into the admin console πŸ‘‰ http://localhost:8080 username: admin, password: admin πŸ‘ˆ",
126
126
  '- Create a realm named "myrealm"',
127
127
  '- Create a client with id "myclient" and root url: "https://www.keycloak.org/app/"',
128
128
  `- Select Login Theme: ${themeName} (don't forget to save at the bottom of the page)`,
129
- `- Go to πŸ‘‰ https://www.keycloak.org/app/ πŸ‘ˆ Click "Save" then "Sign in"`,
130
- `You should see your login page, More details: https://www.keycloak.org/getting-started/getting-started-docker`,
129
+ `- Go to πŸ‘‰ https://www.keycloak.org/app/ πŸ‘ˆ Click "Save" then "Sign in". You should see your login page`,
130
+ "",
131
+ "Video demoing this process: https://youtu.be/N3wlBoH4hKg",
131
132
  "",
132
133
  ].join("\n"),
133
134
  );