keycloakify 2.3.0 → 2.5.2
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 +21 -0
- package/README.md +156 -127
- package/bin/KeycloakVersion.js.map +1 -1
- package/bin/build-keycloak-theme/build-keycloak-theme.js +57 -54
- package/bin/build-keycloak-theme/build-keycloak-theme.js.map +1 -1
- package/bin/build-keycloak-theme/ftlValuesGlobalName.js.map +1 -1
- package/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.js +4 -11
- package/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.js.map +1 -1
- package/bin/build-keycloak-theme/generateFtl/common.ftl +72 -57
- package/bin/build-keycloak-theme/generateFtl/generateFtl.d.ts +1 -1
- package/bin/build-keycloak-theme/generateFtl/generateFtl.js +47 -44
- package/bin/build-keycloak-theme/generateFtl/generateFtl.js.map +1 -1
- package/bin/build-keycloak-theme/generateJavaStackFiles.js +12 -8
- package/bin/build-keycloak-theme/generateJavaStackFiles.js.map +1 -1
- package/bin/build-keycloak-theme/generateKeycloakThemeResources.js +20 -21
- package/bin/build-keycloak-theme/generateKeycloakThemeResources.js.map +1 -1
- package/bin/build-keycloak-theme/index.js.map +1 -1
- package/bin/build-keycloak-theme/replaceImportFromStatic.js +18 -30
- package/bin/build-keycloak-theme/replaceImportFromStatic.js.map +1 -1
- package/bin/download-builtin-keycloak-theme.js +2 -2
- package/bin/download-builtin-keycloak-theme.js.map +1 -1
- package/bin/generate-i18n-messages.js +9 -11
- package/bin/generate-i18n-messages.js.map +1 -1
- package/bin/link_in_test_app.js +6 -22
- package/bin/link_in_test_app.js.map +1 -1
- package/bin/tools/crawl.js.map +1 -1
- package/bin/tools/downloadAndUnzip.js +4 -5
- package/bin/tools/downloadAndUnzip.js.map +1 -1
- package/bin/tools/grant-exec-perms.js +4 -3
- package/bin/tools/grant-exec-perms.js.map +1 -1
- package/bin/tools/isInside.js.map +1 -1
- package/bin/tools/rm.js +1 -1
- package/bin/tools/rm.js.map +1 -1
- package/bin/tools/transformCodebase.js +7 -3
- package/bin/tools/transformCodebase.js.map +1 -1
- package/lib/components/Error.js +1 -2
- package/lib/components/Error.js.map +1 -1
- package/lib/components/Info.js +1 -15
- package/lib/components/Info.js.map +1 -1
- package/lib/components/KcApp.js +23 -10
- package/lib/components/KcApp.js.map +1 -1
- package/lib/components/KcProps.d.ts +4 -2
- package/lib/components/KcProps.js +10 -8
- package/lib/components/KcProps.js.map +1 -1
- package/lib/components/Login.js +20 -18
- package/lib/components/Login.js.map +1 -1
- package/lib/components/LoginIdpLinkConfirm.js.map +1 -1
- package/lib/components/LoginOtp.js +14 -15
- package/lib/components/LoginOtp.js.map +1 -1
- package/lib/components/LoginResetPassword.js +5 -7
- package/lib/components/LoginResetPassword.js.map +1 -1
- package/lib/components/LoginUpdateProfile.js +1 -5
- package/lib/components/LoginUpdateProfile.js.map +1 -1
- package/lib/components/LoginVerifyEmail.js.map +1 -1
- package/lib/components/Register.js +1 -4
- package/lib/components/Register.js.map +1 -1
- package/lib/components/RegisterUserProfile.d.ts +6 -0
- package/lib/components/RegisterUserProfile.js +78 -0
- package/lib/components/RegisterUserProfile.js.map +1 -0
- package/lib/components/Template.js +28 -43
- package/lib/components/Template.js.map +1 -1
- package/lib/components/Terms.js.map +1 -1
- package/lib/getKcContext/KcContextBase.d.ts +78 -18
- package/lib/getKcContext/KcContextBase.js +2 -3
- package/lib/getKcContext/KcContextBase.js.map +1 -1
- package/lib/getKcContext/getKcContext.d.ts +1 -3
- package/lib/getKcContext/getKcContext.js +5 -9
- package/lib/getKcContext/getKcContext.js.map +1 -1
- package/lib/getKcContext/kcContextMocks/kcContextMocks.d.ts +1 -0
- package/lib/getKcContext/kcContextMocks/kcContextMocks.js +187 -55
- package/lib/getKcContext/kcContextMocks/kcContextMocks.js.map +1 -1
- package/lib/getKcContext/kcContextMocks/urlResourcesPath.js.map +1 -1
- package/lib/i18n/KcLanguageTag.d.ts +25 -2
- package/lib/i18n/KcLanguageTag.js +27 -27
- package/lib/i18n/KcLanguageTag.js.map +1 -1
- package/lib/i18n/generated_kcMessages/11.0.3/account.js +27 -27
- package/lib/i18n/generated_kcMessages/11.0.3/account.js.map +1 -1
- package/lib/i18n/generated_kcMessages/11.0.3/admin.js +23 -23
- package/lib/i18n/generated_kcMessages/11.0.3/admin.js.map +1 -1
- package/lib/i18n/generated_kcMessages/11.0.3/email.js +97 -97
- package/lib/i18n/generated_kcMessages/11.0.3/email.js.map +1 -1
- package/lib/i18n/generated_kcMessages/11.0.3/login.js +30 -30
- package/lib/i18n/generated_kcMessages/11.0.3/login.js.map +1 -1
- package/lib/i18n/generated_kcMessages/15.0.2/account.js +29 -29
- package/lib/i18n/generated_kcMessages/15.0.2/account.js.map +1 -1
- package/lib/i18n/generated_kcMessages/15.0.2/admin.js +23 -23
- package/lib/i18n/generated_kcMessages/15.0.2/admin.js.map +1 -1
- package/lib/i18n/generated_kcMessages/15.0.2/email.js +111 -111
- package/lib/i18n/generated_kcMessages/15.0.2/email.js.map +1 -1
- package/lib/i18n/generated_kcMessages/15.0.2/login.js +32 -32
- package/lib/i18n/generated_kcMessages/15.0.2/login.js.map +1 -1
- package/lib/i18n/kcMessages/login.js +1 -1
- package/lib/i18n/kcMessages/login.js.map +1 -1
- package/lib/i18n/useKcLanguageTag.js +1 -3
- package/lib/i18n/useKcLanguageTag.js.map +1 -1
- package/lib/i18n/useKcMessage.d.ts +2 -1
- package/lib/i18n/useKcMessage.js +8 -6
- package/lib/i18n/useKcMessage.js.map +1 -1
- package/lib/keycloakJsAdapter.d.ts +6 -6
- package/lib/keycloakJsAdapter.js +10 -12
- package/lib/keycloakJsAdapter.js.map +1 -1
- package/lib/tools/ReactComponent.d.ts +2 -0
- package/lib/tools/ReactComponent.js +3 -0
- package/lib/tools/ReactComponent.js.map +1 -0
- package/lib/tools/allPropertiesValuesToUndefined.js +1 -2
- package/lib/tools/allPropertiesValuesToUndefined.js.map +1 -1
- package/lib/tools/appendHead.js +16 -12
- package/lib/tools/appendHead.js.map +1 -1
- package/lib/tools/assert.js.map +1 -1
- package/lib/tools/deepAssign.js +3 -4
- package/lib/tools/deepAssign.js.map +1 -1
- package/lib/tools/deepClone.js.map +1 -1
- package/package.json +26 -6
- package/src/bin/KeycloakVersion.ts +0 -2
- package/src/bin/build-keycloak-theme/build-keycloak-theme.ts +70 -77
- package/src/bin/build-keycloak-theme/ftlValuesGlobalName.ts +1 -2
- package/src/bin/build-keycloak-theme/generateDebugFiles/generateDebugFiles.ts +26 -37
- package/src/bin/build-keycloak-theme/generateDebugFiles/index.ts +1 -1
- package/src/bin/build-keycloak-theme/generateFtl/common.ftl +72 -57
- package/src/bin/build-keycloak-theme/generateFtl/generateFtl.ts +75 -95
- package/src/bin/build-keycloak-theme/generateFtl/index.ts +1 -1
- package/src/bin/build-keycloak-theme/generateJavaStackFiles.ts +38 -56
- package/src/bin/build-keycloak-theme/generateKeycloakThemeResources.ts +47 -85
- package/src/bin/build-keycloak-theme/index.ts +2 -4
- package/src/bin/build-keycloak-theme/replaceImportFromStatic.ts +34 -78
- package/src/bin/download-builtin-keycloak-theme.ts +5 -19
- package/src/bin/generate-i18n-messages.ts +13 -25
- package/src/bin/link_in_test_app.ts +9 -38
- package/src/bin/tools/crawl.ts +2 -12
- package/src/bin/tools/downloadAndUnzip.ts +6 -22
- package/src/bin/tools/getProjectRoot.ts +1 -1
- package/src/bin/tools/grant-exec-perms.ts +8 -7
- package/src/bin/tools/isInside.ts +2 -9
- package/src/bin/tools/rm.ts +21 -32
- package/src/bin/tools/transformCodebase.ts +20 -43
- package/src/lib/components/Error.tsx +3 -7
- package/src/lib/components/Info.tsx +23 -47
- package/src/lib/components/KcApp.tsx +25 -13
- package/src/lib/components/KcProps.ts +94 -92
- package/src/lib/components/Login.tsx +126 -116
- package/src/lib/components/LoginIdpLinkConfirm.tsx +38 -53
- package/src/lib/components/LoginOtp.tsx +39 -76
- package/src/lib/components/LoginResetPassword.tsx +9 -26
- package/src/lib/components/LoginUpdateProfile.tsx +104 -117
- package/src/lib/components/LoginVerifyEmail.tsx +3 -12
- package/src/lib/components/Register.tsx +76 -46
- package/src/lib/components/RegisterUserProfile.tsx +201 -0
- package/src/lib/components/Template.tsx +109 -161
- package/src/lib/components/Terms.tsx +4 -13
- package/src/lib/getKcContext/KcContextBase.ts +104 -53
- package/src/lib/getKcContext/getKcContext.ts +47 -78
- package/src/lib/getKcContext/index.ts +2 -2
- package/src/lib/getKcContext/kcContextMocks/index.ts +1 -1
- package/src/lib/getKcContext/kcContextMocks/kcContextMocks.ts +362 -241
- package/src/lib/getKcContext/kcContextMocks/urlResourcesPath.ts +1 -2
- package/src/lib/i18n/KcLanguageTag.ts +34 -45
- package/src/lib/i18n/generated_kcMessages/11.0.3/account.ts +3086 -3059
- package/src/lib/i18n/generated_kcMessages/11.0.3/admin.ts +248 -239
- package/src/lib/i18n/generated_kcMessages/11.0.3/email.ts +848 -633
- package/src/lib/i18n/generated_kcMessages/11.0.3/login.ts +4466 -4359
- package/src/lib/i18n/generated_kcMessages/15.0.2/account.ts +4247 -4202
- package/src/lib/i18n/generated_kcMessages/15.0.2/admin.ts +273 -264
- package/src/lib/i18n/generated_kcMessages/15.0.2/email.ts +997 -749
- package/src/lib/i18n/generated_kcMessages/15.0.2/login.ts +5352 -5212
- package/src/lib/i18n/kcMessages/login.ts +4 -9
- package/src/lib/i18n/useKcLanguageTag.ts +2 -16
- package/src/lib/i18n/useKcMessage.tsx +17 -20
- package/src/lib/index.ts +0 -1
- package/src/lib/keycloakJsAdapter.ts +23 -53
- package/src/lib/tools/AndByDiscriminatingKey.ts +16 -30
- package/src/lib/tools/DeepPartial.ts +1 -2
- package/src/lib/tools/ReactComponent.ts +4 -0
- package/src/lib/tools/allPropertiesValuesToUndefined.ts +1 -6
- package/src/lib/tools/appendHead.ts +28 -25
- package/src/lib/tools/assert.ts +1 -2
- package/src/lib/tools/deepAssign.ts +28 -46
- package/src/lib/tools/deepClone.ts +2 -3
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
import type { KcContextBase } from "../KcContextBase";
|
1
|
+
import "minimal-polyfills/Object.fromEntries";
|
2
|
+
import type { KcContextBase, Attribute } from "../KcContextBase";
|
3
3
|
import { getEvtKcLanguage } from "../../i18n/useKcLanguageTag";
|
4
4
|
import { getKcLanguageTagLabel } from "../../i18n/KcLanguageTag";
|
5
5
|
//NOTE: Aside because we want to be able to import them from node
|
@@ -10,252 +10,373 @@ import { join as pathJoin } from "path";
|
|
10
10
|
const PUBLIC_URL = process.env["PUBLIC_URL"] ?? "/";
|
11
11
|
|
12
12
|
export const kcContextCommonMock: KcContextBase.Common = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
13
|
+
"url": {
|
14
|
+
"loginAction": "#",
|
15
|
+
"resourcesPath": pathJoin(PUBLIC_URL, resourcesPath),
|
16
|
+
"resourcesCommonPath": pathJoin(PUBLIC_URL, resourcesCommonPath),
|
17
|
+
"loginRestartFlowUrl": "/auth/realms/myrealm/login-actions/restart?client_id=account&tab_id=HoAx28ja4xg",
|
18
|
+
"loginUrl": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg",
|
19
|
+
},
|
20
|
+
"realm": {
|
21
|
+
"displayName": "myrealm",
|
22
|
+
"displayNameHtml": "myrealm",
|
23
|
+
"internationalizationEnabled": true,
|
24
|
+
"registrationEmailAsUsername": false,
|
25
|
+
},
|
26
|
+
"messagesPerField": {
|
27
|
+
"printIfExists": (...[, x]) => x,
|
28
|
+
"existsError": () => true,
|
29
|
+
"get": key => `Fake error for ${key}`,
|
30
|
+
"exists": () => true,
|
31
|
+
},
|
32
|
+
"locale": {
|
33
|
+
"supported": [
|
34
|
+
{
|
35
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=de",
|
36
|
+
"languageTag": "de",
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=no",
|
40
|
+
"languageTag": "no",
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ru",
|
44
|
+
"languageTag": "ru",
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sv",
|
48
|
+
"languageTag": "sv",
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pt-BR",
|
52
|
+
"languageTag": "pt-BR",
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=lt",
|
56
|
+
"languageTag": "lt",
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=en",
|
60
|
+
"languageTag": "en",
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=it",
|
64
|
+
"languageTag": "it",
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=fr",
|
68
|
+
"languageTag": "fr",
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=zh-CN",
|
72
|
+
"languageTag": "zh-CN",
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=es",
|
76
|
+
"languageTag": "es",
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=cs",
|
80
|
+
"languageTag": "cs",
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ja",
|
84
|
+
"languageTag": "ja",
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=sk",
|
88
|
+
"languageTag": "sk",
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=pl",
|
92
|
+
"languageTag": "pl",
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=ca",
|
96
|
+
"languageTag": "ca",
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=nl",
|
100
|
+
"languageTag": "nl",
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"url": "/auth/realms/myrealm/login-actions/authenticate?client_id=account&tab_id=HoAx28ja4xg&execution=ee6c2834-46a4-4a20-a1b6-f6d6f6451b36&kc_locale=tr",
|
104
|
+
"languageTag": "tr",
|
105
|
+
},
|
106
|
+
],
|
107
|
+
//"current": null as any
|
108
|
+
"current": "English",
|
109
|
+
},
|
110
|
+
"auth": {
|
111
|
+
"showUsername": false,
|
112
|
+
"showResetCredentials": false,
|
113
|
+
"showTryAnotherWayLink": false,
|
114
|
+
},
|
115
|
+
"client": {
|
116
|
+
"clientId": "myApp",
|
117
|
+
},
|
118
|
+
"scripts": [],
|
119
|
+
"message": {
|
120
|
+
"type": "success",
|
121
|
+
"summary": "This is a test message",
|
122
|
+
},
|
123
|
+
"isAppInitiatedAction": false,
|
118
124
|
};
|
119
125
|
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
{
|
125
|
-
"get": () => getKcLanguageTagLabel(getEvtKcLanguage().state),
|
126
|
-
"enumerable": true
|
127
|
-
}
|
128
|
-
);
|
126
|
+
Object.defineProperty(kcContextCommonMock.locale!, "current", {
|
127
|
+
"get": () => getKcLanguageTagLabel(getEvtKcLanguage().state),
|
128
|
+
"enumerable": true,
|
129
|
+
});
|
129
130
|
|
130
131
|
const loginUrl = {
|
131
|
-
|
132
|
-
|
133
|
-
|
132
|
+
...kcContextCommonMock.url,
|
133
|
+
"loginResetCredentialsUrl": "/auth/realms/myrealm/login-actions/reset-credentials?client_id=account&tab_id=HoAx28ja4xg",
|
134
|
+
"registrationUrl": "/auth/realms/myrealm/login-actions/registration?client_id=account&tab_id=HoAx28ja4xg",
|
134
135
|
};
|
135
136
|
|
136
137
|
export const kcContextMocks: KcContextBase[] = [
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
"passwordRequired": true,
|
176
|
-
"recaptchaRequired": false,
|
177
|
-
"social": {
|
178
|
-
"displayInfo": true
|
179
|
-
},
|
180
|
-
|
181
|
-
}),
|
182
|
-
id<KcContextBase.Info>({
|
183
|
-
...kcContextCommonMock,
|
184
|
-
"pageId": "info.ftl",
|
185
|
-
"messageHeader": "<Message header>",
|
186
|
-
"requiredActions": undefined,
|
187
|
-
"skipLink": false,
|
188
|
-
"actionUri": "#",
|
189
|
-
"client": {
|
190
|
-
"clientId": "myApp",
|
191
|
-
"baseUrl": "#"
|
192
|
-
}
|
193
|
-
|
194
|
-
}),
|
195
|
-
id<KcContextBase.Error>({
|
196
|
-
...kcContextCommonMock,
|
197
|
-
"pageId": "error.ftl",
|
198
|
-
"client": {
|
199
|
-
"clientId": "myApp",
|
200
|
-
"baseUrl": "#"
|
201
|
-
},
|
202
|
-
"message": {
|
203
|
-
"type": "error",
|
204
|
-
"summary": "This is the error message"
|
205
|
-
}
|
206
|
-
}),
|
207
|
-
id<KcContextBase.LoginResetPassword>({
|
208
|
-
...kcContextCommonMock,
|
209
|
-
"pageId": "login-reset-password.ftl",
|
210
|
-
"realm": {
|
211
|
-
...kcContextCommonMock.realm,
|
212
|
-
"loginWithEmailAllowed": false
|
213
|
-
}
|
214
|
-
|
215
|
-
}),
|
216
|
-
id<KcContextBase.LoginVerifyEmail>({
|
217
|
-
...kcContextCommonMock,
|
218
|
-
"pageId": "login-verify-email.ftl"
|
219
|
-
}),
|
220
|
-
id<KcContextBase.Terms>({
|
221
|
-
...kcContextCommonMock,
|
222
|
-
"pageId": "terms.ftl"
|
138
|
+
id<KcContextBase.Login>({
|
139
|
+
...kcContextCommonMock,
|
140
|
+
"pageId": "login.ftl",
|
141
|
+
"url": loginUrl,
|
142
|
+
"realm": {
|
143
|
+
...kcContextCommonMock.realm,
|
144
|
+
"loginWithEmailAllowed": true,
|
145
|
+
"rememberMe": true,
|
146
|
+
"password": true,
|
147
|
+
"resetPasswordAllowed": true,
|
148
|
+
"registrationAllowed": true,
|
149
|
+
},
|
150
|
+
"auth": kcContextCommonMock.auth!,
|
151
|
+
"social": {
|
152
|
+
"displayInfo": true,
|
153
|
+
},
|
154
|
+
"usernameEditDisabled": false,
|
155
|
+
"login": {
|
156
|
+
"rememberMe": false,
|
157
|
+
},
|
158
|
+
"registrationDisabled": false,
|
159
|
+
}),
|
160
|
+
...(() => {
|
161
|
+
const registerCommon: KcContextBase.RegisterCommon = {
|
162
|
+
...kcContextCommonMock,
|
163
|
+
"url": {
|
164
|
+
...loginUrl,
|
165
|
+
"registrationAction":
|
166
|
+
"http://localhost:8080/auth/realms/myrealm/login-actions/registration?session_code=gwZdUeO7pbYpFTRxiIxRg_QtzMbtFTKrNu6XW_f8asM&execution=12146ce0-b139-4bbd-b25b-0eccfee6577e&client_id=account&tab_id=uS8lYfebLa0",
|
167
|
+
},
|
168
|
+
"scripts": [],
|
169
|
+
"isAppInitiatedAction": false,
|
170
|
+
"passwordRequired": true,
|
171
|
+
"recaptchaRequired": false,
|
172
|
+
"social": {
|
173
|
+
"displayInfo": true,
|
174
|
+
},
|
175
|
+
};
|
223
176
|
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
177
|
+
return [
|
178
|
+
id<KcContextBase.Register>({
|
179
|
+
"pageId": "register.ftl",
|
180
|
+
...registerCommon,
|
181
|
+
"register": {
|
182
|
+
"formData": {},
|
183
|
+
},
|
184
|
+
}),
|
185
|
+
id<KcContextBase.RegisterUserProfile>({
|
186
|
+
"pageId": "register-user-profile.ftl",
|
187
|
+
...registerCommon,
|
188
|
+
"profile": {
|
189
|
+
"context": "REGISTRATION_PROFILE" as const,
|
190
|
+
...(() => {
|
191
|
+
const attributes: Attribute[] = [
|
192
|
+
{
|
193
|
+
"validators": {
|
194
|
+
"username-prohibited-characters": {
|
195
|
+
"ignore.empty.value": true,
|
196
|
+
},
|
197
|
+
"up-username-has-value": {},
|
198
|
+
"length": {
|
199
|
+
"ignore.empty.value": true,
|
200
|
+
"min": "3",
|
201
|
+
"max": "255",
|
202
|
+
},
|
203
|
+
"up-duplicate-username": {},
|
204
|
+
"up-username-mutation": {},
|
205
|
+
},
|
206
|
+
"displayName": "${username}",
|
207
|
+
"annotations": {},
|
208
|
+
"required": true,
|
209
|
+
"groupAnnotations": {},
|
210
|
+
"autocomplete": "username",
|
211
|
+
"readOnly": false,
|
212
|
+
"name": "username",
|
213
|
+
},
|
214
|
+
{
|
215
|
+
"validators": {
|
216
|
+
"up-email-exists-as-username": {},
|
217
|
+
"length": {
|
218
|
+
"max": "255",
|
219
|
+
"ignore.empty.value": true,
|
220
|
+
},
|
221
|
+
"up-blank-attribute-value": {
|
222
|
+
"error-message": "missingEmailMessage",
|
223
|
+
"fail-on-null": false,
|
224
|
+
},
|
225
|
+
"up-duplicate-email": {},
|
226
|
+
"email": {
|
227
|
+
"ignore.empty.value": true,
|
228
|
+
},
|
229
|
+
},
|
230
|
+
"displayName": "${email}",
|
231
|
+
"annotations": {},
|
232
|
+
"required": true,
|
233
|
+
"groupAnnotations": {},
|
234
|
+
"autocomplete": "email",
|
235
|
+
"readOnly": false,
|
236
|
+
"name": "email",
|
237
|
+
},
|
238
|
+
{
|
239
|
+
"validators": {
|
240
|
+
"length": {
|
241
|
+
"max": "255",
|
242
|
+
"ignore.empty.value": true,
|
243
|
+
},
|
244
|
+
"person-name-prohibited-characters": {
|
245
|
+
"ignore.empty.value": true,
|
246
|
+
},
|
247
|
+
"up-immutable-attribute": {},
|
248
|
+
"up-attribute-required-by-metadata-value": {},
|
249
|
+
},
|
250
|
+
"displayName": "${firstName}",
|
251
|
+
"annotations": {},
|
252
|
+
"required": true,
|
253
|
+
"groupAnnotations": {},
|
254
|
+
"readOnly": false,
|
255
|
+
"name": "firstName",
|
256
|
+
},
|
257
|
+
{
|
258
|
+
"validators": {
|
259
|
+
"length": {
|
260
|
+
"max": "255",
|
261
|
+
"ignore.empty.value": true,
|
262
|
+
},
|
263
|
+
"person-name-prohibited-characters": {
|
264
|
+
"ignore.empty.value": true,
|
265
|
+
},
|
266
|
+
"up-immutable-attribute": {},
|
267
|
+
"up-attribute-required-by-metadata-value": {},
|
268
|
+
},
|
269
|
+
"displayName": "${lastName}",
|
270
|
+
"annotations": {},
|
271
|
+
"required": true,
|
272
|
+
"groupAnnotations": {},
|
273
|
+
"readOnly": false,
|
274
|
+
"name": "lastName",
|
275
|
+
},
|
276
|
+
{
|
277
|
+
"validators": {
|
278
|
+
"length": {
|
279
|
+
"ignore.empty.value": true,
|
280
|
+
"min": "3",
|
281
|
+
"max": "9",
|
282
|
+
},
|
283
|
+
"up-immutable-attribute": {},
|
284
|
+
"up-attribute-required-by-metadata-value": {},
|
285
|
+
"email": {
|
286
|
+
"ignore.empty.value": true,
|
287
|
+
},
|
288
|
+
},
|
289
|
+
"displayName": "${foo}",
|
290
|
+
"annotations": {
|
291
|
+
"this_is_second_key": "this_is_second_value",
|
292
|
+
"this_is_first_key": "this_is_first_value",
|
293
|
+
},
|
294
|
+
"required": true,
|
295
|
+
"groupAnnotations": {},
|
296
|
+
"readOnly": false,
|
297
|
+
"name": "foo",
|
298
|
+
},
|
299
|
+
];
|
240
300
|
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
301
|
+
return {
|
302
|
+
attributes,
|
303
|
+
"attributesByName": Object.fromEntries(attributes.map(attribute => [attribute.name, attribute])) as any,
|
304
|
+
} as any;
|
305
|
+
})(),
|
306
|
+
},
|
307
|
+
}),
|
308
|
+
];
|
309
|
+
})(),
|
310
|
+
id<KcContextBase.Info>({
|
311
|
+
...kcContextCommonMock,
|
312
|
+
"pageId": "info.ftl",
|
313
|
+
"messageHeader": "<Message header>",
|
314
|
+
"requiredActions": undefined,
|
315
|
+
"skipLink": false,
|
316
|
+
"actionUri": "#",
|
317
|
+
"client": {
|
318
|
+
"clientId": "myApp",
|
319
|
+
"baseUrl": "#",
|
320
|
+
},
|
321
|
+
}),
|
322
|
+
id<KcContextBase.Error>({
|
323
|
+
...kcContextCommonMock,
|
324
|
+
"pageId": "error.ftl",
|
325
|
+
"client": {
|
326
|
+
"clientId": "myApp",
|
327
|
+
"baseUrl": "#",
|
328
|
+
},
|
329
|
+
"message": {
|
330
|
+
"type": "error",
|
331
|
+
"summary": "This is the error message",
|
332
|
+
},
|
333
|
+
}),
|
334
|
+
id<KcContextBase.LoginResetPassword>({
|
335
|
+
...kcContextCommonMock,
|
336
|
+
"pageId": "login-reset-password.ftl",
|
337
|
+
"realm": {
|
338
|
+
...kcContextCommonMock.realm,
|
339
|
+
"loginWithEmailAllowed": false,
|
340
|
+
},
|
341
|
+
}),
|
342
|
+
id<KcContextBase.LoginVerifyEmail>({
|
343
|
+
...kcContextCommonMock,
|
344
|
+
"pageId": "login-verify-email.ftl",
|
345
|
+
}),
|
346
|
+
id<KcContextBase.Terms>({
|
347
|
+
...kcContextCommonMock,
|
348
|
+
"pageId": "terms.ftl",
|
349
|
+
}),
|
350
|
+
id<KcContextBase.LoginOtp>({
|
351
|
+
...kcContextCommonMock,
|
352
|
+
"pageId": "login-otp.ftl",
|
353
|
+
"otpLogin": {
|
354
|
+
"userOtpCredentials": [
|
355
|
+
{
|
356
|
+
"id": "id1",
|
357
|
+
"userLabel": "label1",
|
358
|
+
},
|
359
|
+
{
|
360
|
+
"id": "id2",
|
361
|
+
"userLabel": "label2",
|
362
|
+
},
|
363
|
+
],
|
364
|
+
},
|
365
|
+
}),
|
366
|
+
id<KcContextBase.LoginUpdateProfile>({
|
367
|
+
...kcContextCommonMock,
|
368
|
+
"pageId": "login-update-profile.ftl",
|
369
|
+
"user": {
|
370
|
+
"editUsernameAllowed": true,
|
371
|
+
"username": "anUsername",
|
372
|
+
"email": "foo@example.com",
|
373
|
+
"firstName": "aFirstName",
|
374
|
+
"lastName": "aLastName",
|
375
|
+
},
|
376
|
+
}),
|
377
|
+
id<KcContextBase.LoginIdpLinkConfirm>({
|
378
|
+
...kcContextCommonMock,
|
379
|
+
"pageId": "login-idp-link-confirm.ftl",
|
380
|
+
"idpAlias": "FranceConnect",
|
381
|
+
}),
|
261
382
|
];
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
1
|
import { join as pathJoin } from "path";
|
3
2
|
|
4
3
|
export const subDirOfPublicDirBasename = "keycloak_static";
|
5
4
|
export const resourcesPath = pathJoin(subDirOfPublicDirBasename, "/resources");
|
6
|
-
export const resourcesCommonPath = pathJoin(subDirOfPublicDirBasename, "/resources_common");
|
5
|
+
export const resourcesCommonPath = pathJoin(subDirOfPublicDirBasename, "/resources_common");
|