@keycloakify/login-ui 250004.0.33
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/KcContext/getKcContextMock.d.ts +1 -0
- package/KcContext/getKcContextMock.js +1 -0
- package/KcContext/index.d.ts +2 -0
- package/KcContext/index.js +2 -0
- package/KcContext/useKcContext.d.ts +10 -0
- package/KcContext/useKcContext.js +17 -0
- package/README.md +12 -0
- package/core/KcContext/KcContext.d.ts +605 -0
- package/core/KcContext/KcContext.js +43 -0
- package/core/KcContext/getKcContextMock.d.ts +23 -0
- package/core/KcContext/getKcContextMock.js +27 -0
- package/core/KcContext/kcContextMocks.d.ts +4 -0
- package/core/KcContext/kcContextMocks.js +345 -0
- package/core/getKcClsx.d.ts +11 -0
- package/core/getKcClsx.js +54 -0
- package/core/i18n/GenericI18n.d.ts +63 -0
- package/core/i18n/GenericI18n.js +1 -0
- package/core/i18n/getI18n.d.ts +45 -0
- package/core/i18n/getI18n.js +246 -0
- package/core/i18n/i18nBuilder.d.ts +18 -0
- package/core/i18n/i18nBuilder.js +26 -0
- package/core/i18n/messages_defaultSet/ar.d.ts +447 -0
- package/core/i18n/messages_defaultSet/ar.js +451 -0
- package/core/i18n/messages_defaultSet/ca.d.ts +443 -0
- package/core/i18n/messages_defaultSet/ca.js +447 -0
- package/core/i18n/messages_defaultSet/cs.d.ts +445 -0
- package/core/i18n/messages_defaultSet/cs.js +449 -0
- package/core/i18n/messages_defaultSet/da.d.ts +317 -0
- package/core/i18n/messages_defaultSet/da.js +321 -0
- package/core/i18n/messages_defaultSet/de.d.ts +459 -0
- package/core/i18n/messages_defaultSet/de.js +463 -0
- package/core/i18n/messages_defaultSet/el.d.ts +438 -0
- package/core/i18n/messages_defaultSet/el.js +442 -0
- package/core/i18n/messages_defaultSet/en.d.ts +470 -0
- package/core/i18n/messages_defaultSet/en.js +474 -0
- package/core/i18n/messages_defaultSet/es.d.ts +452 -0
- package/core/i18n/messages_defaultSet/es.js +456 -0
- package/core/i18n/messages_defaultSet/fa.d.ts +438 -0
- package/core/i18n/messages_defaultSet/fa.js +442 -0
- package/core/i18n/messages_defaultSet/fi.d.ts +377 -0
- package/core/i18n/messages_defaultSet/fi.js +381 -0
- package/core/i18n/messages_defaultSet/fr.d.ts +393 -0
- package/core/i18n/messages_defaultSet/fr.js +397 -0
- package/core/i18n/messages_defaultSet/hu.d.ts +443 -0
- package/core/i18n/messages_defaultSet/hu.js +447 -0
- package/core/i18n/messages_defaultSet/index.d.ts +3086 -0
- package/core/i18n/messages_defaultSet/index.js +72 -0
- package/core/i18n/messages_defaultSet/it.d.ts +318 -0
- package/core/i18n/messages_defaultSet/it.js +322 -0
- package/core/i18n/messages_defaultSet/ja.d.ts +323 -0
- package/core/i18n/messages_defaultSet/ja.js +327 -0
- package/core/i18n/messages_defaultSet/ka.d.ts +468 -0
- package/core/i18n/messages_defaultSet/ka.js +472 -0
- package/core/i18n/messages_defaultSet/lt.d.ts +203 -0
- package/core/i18n/messages_defaultSet/lt.js +207 -0
- package/core/i18n/messages_defaultSet/lv.d.ts +214 -0
- package/core/i18n/messages_defaultSet/lv.js +218 -0
- package/core/i18n/messages_defaultSet/nl.d.ts +285 -0
- package/core/i18n/messages_defaultSet/nl.js +289 -0
- package/core/i18n/messages_defaultSet/no.d.ts +202 -0
- package/core/i18n/messages_defaultSet/no.js +206 -0
- package/core/i18n/messages_defaultSet/pl.d.ts +292 -0
- package/core/i18n/messages_defaultSet/pl.js +296 -0
- package/core/i18n/messages_defaultSet/pt-BR.d.ts +347 -0
- package/core/i18n/messages_defaultSet/pt-BR.js +351 -0
- package/core/i18n/messages_defaultSet/pt.d.ts +448 -0
- package/core/i18n/messages_defaultSet/pt.js +452 -0
- package/core/i18n/messages_defaultSet/ru.d.ts +220 -0
- package/core/i18n/messages_defaultSet/ru.js +224 -0
- package/core/i18n/messages_defaultSet/sk.d.ts +448 -0
- package/core/i18n/messages_defaultSet/sk.js +452 -0
- package/core/i18n/messages_defaultSet/sv.d.ts +201 -0
- package/core/i18n/messages_defaultSet/sv.js +205 -0
- package/core/i18n/messages_defaultSet/th.d.ts +443 -0
- package/core/i18n/messages_defaultSet/th.js +447 -0
- package/core/i18n/messages_defaultSet/tr.d.ts +270 -0
- package/core/i18n/messages_defaultSet/tr.js +274 -0
- package/core/i18n/messages_defaultSet/types.d.ts +3 -0
- package/core/i18n/messages_defaultSet/types.js +32 -0
- package/core/i18n/messages_defaultSet/uk.d.ts +442 -0
- package/core/i18n/messages_defaultSet/uk.js +446 -0
- package/core/i18n/messages_defaultSet/zh-CN.d.ts +447 -0
- package/core/i18n/messages_defaultSet/zh-CN.js +451 -0
- package/core/i18n/messages_defaultSet/zh-TW.d.ts +453 -0
- package/core/i18n/messages_defaultSet/zh-TW.js +457 -0
- package/core/kcClsx.d.ts +8 -0
- package/core/kcClsx.js +128 -0
- package/core/kcSanitize/HtmlPolicyBuilder.d.ts +27 -0
- package/core/kcSanitize/HtmlPolicyBuilder.js +207 -0
- package/core/kcSanitize/KcSanitizer.d.ts +11 -0
- package/core/kcSanitize/KcSanitizer.js +45 -0
- package/core/kcSanitize/KcSanitizerPolicy.d.ts +23 -0
- package/core/kcSanitize/KcSanitizerPolicy.js +148 -0
- package/core/kcSanitize/index.d.ts +1 -0
- package/core/kcSanitize/index.js +4 -0
- package/core/userProfileApi/index.d.ts +1 -0
- package/core/userProfileApi/index.js +1 -0
- package/core/userProfileApi/kcNumberUnFormat.d.ts +2 -0
- package/core/userProfileApi/kcNumberUnFormat.js +83 -0
- package/core/userProfileApi/userProfileApi.d.ts +83 -0
- package/core/userProfileApi/userProfileApi.js +1119 -0
- package/i18n/GenericI18n.d.ts +72 -0
- package/i18n/GenericI18n.js +4 -0
- package/i18n/i18nBuilder.d.ts +18 -0
- package/i18n/i18nBuilder.js +26 -0
- package/i18n/index.d.ts +3 -0
- package/i18n/index.js +1 -0
- package/i18n/useI18n.d.ts +28 -0
- package/i18n/useI18n.js +86 -0
- package/import.meta.env.BASE_URL.d.ts +5 -0
- package/import.meta.env.BASE_URL.js +41 -0
- package/kcSanitize.d.ts +1 -0
- package/kcSanitize.js +1 -0
- package/keycloak-theme/login/KcContext.ts +15 -0
- package/keycloak-theme/login/KcPage.tsx +47 -0
- package/keycloak-theme/login/components/LogoutOtherSessions.tsx +27 -0
- package/keycloak-theme/login/components/PasswordWrapper.tsx +38 -0
- package/keycloak-theme/login/components/Template/Template.tsx +235 -0
- package/keycloak-theme/login/components/Template/index.ts +1 -0
- package/keycloak-theme/login/components/Template/useInitializeTemplate.ts +60 -0
- package/keycloak-theme/login/components/UserProfileFormFields/AddRemoveButtonsMultiValuedAttribute.tsx +65 -0
- package/keycloak-theme/login/components/UserProfileFormFields/DO_MAKE_USER_CONFIRM_PASSWORD.ts +2 -0
- package/keycloak-theme/login/components/UserProfileFormFields/FieldErrors.tsx +37 -0
- package/keycloak-theme/login/components/UserProfileFormFields/GroupLabel.tsx +78 -0
- package/keycloak-theme/login/components/UserProfileFormFields/InputFieldByType.tsx +52 -0
- package/keycloak-theme/login/components/UserProfileFormFields/InputLabel.tsx +19 -0
- package/keycloak-theme/login/components/UserProfileFormFields/InputTag.tsx +130 -0
- package/keycloak-theme/login/components/UserProfileFormFields/InputTagSelects.tsx +118 -0
- package/keycloak-theme/login/components/UserProfileFormFields/SelectTag.tsx +86 -0
- package/keycloak-theme/login/components/UserProfileFormFields/TextareaTag.tsx +53 -0
- package/keycloak-theme/login/components/UserProfileFormFields/UserProfileFormFields.tsx +132 -0
- package/keycloak-theme/login/components/UserProfileFormFields/index.ts +1 -0
- package/keycloak-theme/login/i18n.ts +7 -0
- package/keycloak-theme/login/mocks/getKcContextMock.ts +18 -0
- package/keycloak-theme/login/pages/PageIndex.tsx +133 -0
- package/keycloak-theme/login/pages/code/Page.tsx +47 -0
- package/keycloak-theme/login/pages/code/index.ts +3 -0
- package/keycloak-theme/login/pages/delete-account-confirm/Page.tsx +59 -0
- package/keycloak-theme/login/pages/delete-account-confirm/index.ts +3 -0
- package/keycloak-theme/login/pages/delete-credential/Page.tsx +40 -0
- package/keycloak-theme/login/pages/delete-credential/index.ts +3 -0
- package/keycloak-theme/login/pages/error/Page.tsx +32 -0
- package/keycloak-theme/login/pages/error/index.ts +3 -0
- package/keycloak-theme/login/pages/frontchannel-logout/Page.tsx +40 -0
- package/keycloak-theme/login/pages/frontchannel-logout/index.ts +3 -0
- package/keycloak-theme/login/pages/idp-review-user-profile/Page.tsx +53 -0
- package/keycloak-theme/login/pages/idp-review-user-profile/index.ts +3 -0
- package/keycloak-theme/login/pages/info/Page.tsx +80 -0
- package/keycloak-theme/login/pages/info/index.ts +3 -0
- package/keycloak-theme/login/pages/login/Form.tsx +164 -0
- package/keycloak-theme/login/pages/login/Info.tsx +25 -0
- package/keycloak-theme/login/pages/login/Page.tsx +32 -0
- package/keycloak-theme/login/pages/login/SocialProviders.tsx +64 -0
- package/keycloak-theme/login/pages/login/index.ts +3 -0
- package/keycloak-theme/login/pages/login-config-totp/Page.tsx +219 -0
- package/keycloak-theme/login/pages/login-config-totp/index.ts +3 -0
- package/keycloak-theme/login/pages/login-idp-link-confirm/Page.tsx +51 -0
- package/keycloak-theme/login/pages/login-idp-link-confirm/index.ts +3 -0
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/Page.tsx +41 -0
- package/keycloak-theme/login/pages/login-idp-link-confirm-override/index.ts +3 -0
- package/keycloak-theme/login/pages/login-idp-link-email/Page.tsx +32 -0
- package/keycloak-theme/login/pages/login-idp-link-email/index.ts +3 -0
- package/keycloak-theme/login/pages/login-oauth-grant/Page.tsx +120 -0
- package/keycloak-theme/login/pages/login-oauth-grant/index.ts +3 -0
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/Page.tsx +64 -0
- package/keycloak-theme/login/pages/login-oauth2-device-verify-user-code/index.ts +3 -0
- package/keycloak-theme/login/pages/login-otp/Page.tsx +125 -0
- package/keycloak-theme/login/pages/login-otp/index.ts +3 -0
- package/keycloak-theme/login/pages/login-page-expired/Page.tsx +28 -0
- package/keycloak-theme/login/pages/login-page-expired/index.ts +3 -0
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/Page.tsx +233 -0
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/index.ts +3 -0
- package/keycloak-theme/login/pages/login-passkeys-conditional-authenticate/useScript.tsx +64 -0
- package/keycloak-theme/login/pages/login-password/Page.tsx +103 -0
- package/keycloak-theme/login/pages/login-password/index.ts +3 -0
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/Page.tsx +167 -0
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/index.ts +3 -0
- package/keycloak-theme/login/pages/login-recovery-authn-code-config/useScript.tsx +145 -0
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/Page.tsx +84 -0
- package/keycloak-theme/login/pages/login-recovery-authn-code-input/index.ts +3 -0
- package/keycloak-theme/login/pages/login-reset-otp/Page.tsx +82 -0
- package/keycloak-theme/login/pages/login-reset-otp/index.ts +3 -0
- package/keycloak-theme/login/pages/login-reset-password/Form.tsx +78 -0
- package/keycloak-theme/login/pages/login-reset-password/Page.tsx +27 -0
- package/keycloak-theme/login/pages/login-reset-password/index.ts +3 -0
- package/keycloak-theme/login/pages/login-update-password/Page.tsx +132 -0
- package/keycloak-theme/login/pages/login-update-password/index.ts +3 -0
- package/keycloak-theme/login/pages/login-update-profile/Page.tsx +70 -0
- package/keycloak-theme/login/pages/login-update-profile/index.ts +3 -0
- package/keycloak-theme/login/pages/login-username/Page.tsx +176 -0
- package/keycloak-theme/login/pages/login-username/index.ts +3 -0
- package/keycloak-theme/login/pages/login-verify-email/Page.tsx +31 -0
- package/keycloak-theme/login/pages/login-verify-email/index.ts +3 -0
- package/keycloak-theme/login/pages/login-x509-info/Page.tsx +97 -0
- package/keycloak-theme/login/pages/login-x509-info/index.ts +3 -0
- package/keycloak-theme/login/pages/logout-confirm/Page.tsx +54 -0
- package/keycloak-theme/login/pages/logout-confirm/index.ts +3 -0
- package/keycloak-theme/login/pages/register/Form.tsx +102 -0
- package/keycloak-theme/login/pages/register/Page.tsx +26 -0
- package/keycloak-theme/login/pages/register/TermsAcceptance.tsx +54 -0
- package/keycloak-theme/login/pages/register/index.ts +3 -0
- package/keycloak-theme/login/pages/saml-post-form/Page.tsx +50 -0
- package/keycloak-theme/login/pages/saml-post-form/index.ts +3 -0
- package/keycloak-theme/login/pages/select-authenticator/Page.tsx +59 -0
- package/keycloak-theme/login/pages/select-authenticator/index.ts +3 -0
- package/keycloak-theme/login/pages/terms/Page.tsx +45 -0
- package/keycloak-theme/login/pages/terms/index.ts +3 -0
- package/keycloak-theme/login/pages/update-email/Page.tsx +74 -0
- package/keycloak-theme/login/pages/update-email/index.ts +3 -0
- package/keycloak-theme/login/pages/webauthn-authenticate/Page.tsx +190 -0
- package/keycloak-theme/login/pages/webauthn-authenticate/index.ts +3 -0
- package/keycloak-theme/login/pages/webauthn-authenticate/useScript.tsx +56 -0
- package/keycloak-theme/login/pages/webauthn-error/Page.tsx +74 -0
- package/keycloak-theme/login/pages/webauthn-error/index.ts +3 -0
- package/keycloak-theme/login/pages/webauthn-register/Page.tsx +83 -0
- package/keycloak-theme/login/pages/webauthn-register/index.ts +3 -0
- package/keycloak-theme/login/pages/webauthn-register/useScript.tsx +64 -0
- package/keycloak-theme/login/styleLevelCustomization.tsx +17 -0
- package/keycloak-theme/public/login/css/login.css +629 -0
- package/keycloak-theme/public/login/img/feedback-error-arrow-down.png +0 -0
- package/keycloak-theme/public/login/img/feedback-error-sign.png +0 -0
- package/keycloak-theme/public/login/img/feedback-success-arrow-down.png +0 -0
- package/keycloak-theme/public/login/img/feedback-success-sign.png +0 -0
- package/keycloak-theme/public/login/img/feedback-warning-arrow-down.png +0 -0
- package/keycloak-theme/public/login/img/feedback-warning-sign.png +0 -0
- package/keycloak-theme/public/login/img/keycloak-bg.png +0 -0
- package/keycloak-theme/public/login/img/keycloak-logo-text.png +0 -0
- package/keycloak-theme/public/login/img/keycloak-logo.png +0 -0
- package/keycloak-theme/public/login/js/authChecker.js +49 -0
- package/keycloak-theme/public/login/js/common.js +48 -0
- package/keycloak-theme/public/login/js/kcMultivalued.js +106 -0
- package/keycloak-theme/public/login/js/kcNumberFormat.js +21 -0
- package/keycloak-theme/public/login/js/kcNumberUnFormat.js +19 -0
- package/keycloak-theme/public/login/js/menu-button-links.js +315 -0
- package/keycloak-theme/public/login/js/passkeysConditionalAuth.js +79 -0
- package/keycloak-theme/public/login/js/passwordVisibility.js +15 -0
- package/keycloak-theme/public/login/js/userProfile.js +71 -0
- package/keycloak-theme/public/login/js/webauthnAuthenticate.js +82 -0
- package/keycloak-theme/public/login/js/webauthnRegister.js +140 -0
- package/keycloak-theme/public/login/resources-common/img/favicon.ico +0 -0
- package/keycloak-theme/public/login/resources-common/lib/pficon/pficon.css +22 -0
- package/keycloak-theme/public/login/resources-common/lib/pficon/pficon.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/@patternfly/patternfly/assets/fonts/RedHatDisplay/RedHatDisplay-Bold.woff +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/@patternfly/patternfly/assets/fonts/RedHatDisplay/RedHatDisplay-Bold.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/@patternfly/patternfly/assets/fonts/overpass-webfont/overpass-bold.woff +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/@patternfly/patternfly/assets/fonts/overpass-webfont/overpass-bold.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/@patternfly/patternfly/patternfly.min.css +2 -0
- package/keycloak-theme/public/login/resources-common/node_modules/jquery/dist/jquery.min.js +2 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/css/patternfly-additions.min.css +5 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/css/patternfly.min.css +8 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.ttf +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Bold-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Light-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Regular-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-Semibold-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/OpenSans-SemiboldItalic-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.ttf +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/PatternFlyIcons-webfont.woff +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/fonts/fontawesome-webfont.woff2 +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/patternfly/dist/img/bg-login.jpg +0 -0
- package/keycloak-theme/public/login/resources-common/node_modules/rfc4648/lib/rfc4648.js +178 -0
- package/package.json +19 -0
- package/src/KcContext/getKcContextMock.ts +1 -0
- package/src/KcContext/index.ts +10 -0
- package/src/KcContext/useKcContext.tsx +23 -0
- package/src/core/KcContext/KcContext.ts +819 -0
- package/src/core/KcContext/getKcContextMock.ts +63 -0
- package/src/core/KcContext/kcContextMocks.ts +623 -0
- package/src/core/getKcClsx.ts +87 -0
- package/src/core/i18n/GenericI18n.ts +64 -0
- package/src/core/i18n/getI18n.tsx +427 -0
- package/src/core/i18n/i18nBuilder.ts +101 -0
- package/src/core/i18n/messages_defaultSet/ar.ts +485 -0
- package/src/core/i18n/messages_defaultSet/ca.ts +517 -0
- package/src/core/i18n/messages_defaultSet/cs.ts +494 -0
- package/src/core/i18n/messages_defaultSet/da.ts +356 -0
- package/src/core/i18n/messages_defaultSet/de.ts +543 -0
- package/src/core/i18n/messages_defaultSet/el.ts +512 -0
- package/src/core/i18n/messages_defaultSet/en.ts +528 -0
- package/src/core/i18n/messages_defaultSet/es.ts +525 -0
- package/src/core/i18n/messages_defaultSet/fa.ts +480 -0
- package/src/core/i18n/messages_defaultSet/fi.ts +426 -0
- package/src/core/i18n/messages_defaultSet/fr.ts +458 -0
- package/src/core/i18n/messages_defaultSet/hu.ts +512 -0
- package/src/core/i18n/messages_defaultSet/index.ts +73 -0
- package/src/core/i18n/messages_defaultSet/it.ts +366 -0
- package/src/core/i18n/messages_defaultSet/ja.ts +369 -0
- package/src/core/i18n/messages_defaultSet/ka.ts +537 -0
- package/src/core/i18n/messages_defaultSet/lt.ts +233 -0
- package/src/core/i18n/messages_defaultSet/lv.ts +229 -0
- package/src/core/i18n/messages_defaultSet/nl.ts +324 -0
- package/src/core/i18n/messages_defaultSet/no.ts +228 -0
- package/src/core/i18n/messages_defaultSet/pl.ts +328 -0
- package/src/core/i18n/messages_defaultSet/pt-BR.ts +398 -0
- package/src/core/i18n/messages_defaultSet/pt.ts +519 -0
- package/src/core/i18n/messages_defaultSet/ru.ts +259 -0
- package/src/core/i18n/messages_defaultSet/sk.ts +503 -0
- package/src/core/i18n/messages_defaultSet/sv.ts +229 -0
- package/src/core/i18n/messages_defaultSet/th.ts +491 -0
- package/src/core/i18n/messages_defaultSet/tr.ts +306 -0
- package/src/core/i18n/messages_defaultSet/types.ts +36 -0
- package/src/core/i18n/messages_defaultSet/uk.ts +517 -0
- package/src/core/i18n/messages_defaultSet/zh-CN.ts +462 -0
- package/src/core/i18n/messages_defaultSet/zh-TW.ts +471 -0
- package/src/core/kcClsx.ts +258 -0
- package/src/core/kcSanitize/HtmlPolicyBuilder.ts +242 -0
- package/src/core/kcSanitize/KcSanitizer.ts +60 -0
- package/src/core/kcSanitize/KcSanitizerPolicy.ts +274 -0
- package/src/core/kcSanitize/index.ts +5 -0
- package/src/core/userProfileApi/index.ts +1 -0
- package/src/core/userProfileApi/kcNumberUnFormat.ts +109 -0
- package/src/core/userProfileApi/userProfileApi.ts +1564 -0
- package/src/i18n/GenericI18n.tsx +82 -0
- package/src/i18n/i18nBuilder.ts +101 -0
- package/src/i18n/index.ts +3 -0
- package/src/i18n/useI18n.tsx +179 -0
- package/src/import.meta.env.BASE_URL.ts +52 -0
- package/src/kcSanitize.ts +1 -0
- package/src/tools/Array.prototype.every.ts +68 -0
- package/src/tools/DeepPartial.ts +3 -0
- package/src/tools/JSX.ts +5 -0
- package/src/tools/Object.fromEntries.ts +21 -0
- package/src/tools/ValueOf.ts +2 -0
- package/src/tools/clsx.ts +8 -0
- package/src/tools/clsx_withTransform.ts +55 -0
- package/src/tools/deepAssign.ts +74 -0
- package/src/tools/emailRegExp.ts +2 -0
- package/src/tools/extractLastParenthesisContent.ts +43 -0
- package/src/tools/structuredCloneButFunctions.ts +24 -0
- package/src/tools/useConst.ts +10 -0
- package/src/tools/useExclusiveAppInstanceEffect.ts +50 -0
- package/src/tools/useInsertLinkTags.ts +55 -0
- package/src/tools/useInsertScriptTags.ts +89 -0
- package/src/tools/useIsPasswordRevealed.ts +45 -0
- package/src/tools/useOnFirstMount.ts +26 -0
- package/src/tools/useSetClassname.ts +24 -0
- package/src/tools/vendor/dompurify.ts +3 -0
- package/src/tools/waitForElementMountedOnDom.ts +28 -0
- package/src/useKcClsx.tsx +33 -0
- package/src/useUserProfileForm.tsx +171 -0
- package/tools/Array.prototype.every.d.ts +0 -0
- package/tools/Array.prototype.every.js +59 -0
- package/tools/DeepPartial.d.ts +3 -0
- package/tools/DeepPartial.js +1 -0
- package/tools/JSX.d.ts +5 -0
- package/tools/JSX.js +1 -0
- package/tools/Object.fromEntries.d.ts +1 -0
- package/tools/Object.fromEntries.js +16 -0
- package/tools/ValueOf.d.ts +2 -0
- package/tools/ValueOf.js +1 -0
- package/tools/clsx.d.ts +3 -0
- package/tools/clsx.js +5 -0
- package/tools/clsx_withTransform.d.ts +5 -0
- package/tools/clsx_withTransform.js +42 -0
- package/tools/deepAssign.d.ts +5 -0
- package/tools/deepAssign.js +56 -0
- package/tools/emailRegExp.d.ts +1 -0
- package/tools/emailRegExp.js +1 -0
- package/tools/extractLastParenthesisContent.d.ts +6 -0
- package/tools/extractLastParenthesisContent.js +35 -0
- package/tools/structuredCloneButFunctions.d.ts +7 -0
- package/tools/structuredCloneButFunctions.js +18 -0
- package/tools/useConst.d.ts +5 -0
- package/tools/useConst.js +9 -0
- package/tools/useExclusiveAppInstanceEffect.d.ts +14 -0
- package/tools/useExclusiveAppInstanceEffect.js +29 -0
- package/tools/useInsertLinkTags.d.ts +12 -0
- package/tools/useInsertLinkTags.js +37 -0
- package/tools/useInsertScriptTags.d.ts +19 -0
- package/tools/useInsertScriptTags.js +60 -0
- package/tools/useIsPasswordRevealed.d.ts +10 -0
- package/tools/useIsPasswordRevealed.js +32 -0
- package/tools/useOnFirstMount.d.ts +5 -0
- package/tools/useOnFirstMount.js +19 -0
- package/tools/useSetClassname.d.ts +4 -0
- package/tools/useSetClassname.js +15 -0
- package/tools/vendor/dompurify.d.ts +2 -0
- package/tools/vendor/dompurify.js +2 -0
- package/tools/waitForElementMountedOnDom.d.ts +3 -0
- package/tools/waitForElementMountedOnDom.js +20 -0
- package/useKcClsx.d.ts +12 -0
- package/useKcClsx.js +20 -0
- package/useUserProfileForm.d.ts +65 -0
- package/useUserProfileForm.js +55 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ExtendKcContext, KcContext as KcContextBase, PageId as PageId_builtin } from "./KcContext";
|
|
2
|
+
import type { DeepPartial } from "../../tools/DeepPartial";
|
|
3
|
+
import { deepAssign } from "../../tools/deepAssign";
|
|
4
|
+
import { structuredCloneButFunctions } from "../../tools/structuredCloneButFunctions";
|
|
5
|
+
import { kcContextMocks, kcContextCommonMock } from "./kcContextMocks";
|
|
6
|
+
import { exclude } from "tsafe/exclude";
|
|
7
|
+
|
|
8
|
+
export function createGetKcContextMock<
|
|
9
|
+
KcContextExtension extends { properties?: Record<string, string | undefined> },
|
|
10
|
+
KcContextExtensionPerPage extends Record<`${string}.ftl`, Record<string, unknown>>
|
|
11
|
+
>(params: {
|
|
12
|
+
kcContextExtension: KcContextExtension;
|
|
13
|
+
kcContextExtensionPerPage: KcContextExtensionPerPage;
|
|
14
|
+
overrides?: DeepPartial<KcContextExtension & KcContextBase.Common>;
|
|
15
|
+
overridesPerPage?: {
|
|
16
|
+
[PageId in PageId_builtin | keyof KcContextExtensionPerPage]?: DeepPartial<
|
|
17
|
+
Extract<ExtendKcContext<KcContextExtension, KcContextExtensionPerPage>, { pageId: PageId }>
|
|
18
|
+
>;
|
|
19
|
+
};
|
|
20
|
+
}) {
|
|
21
|
+
const {
|
|
22
|
+
kcContextExtension,
|
|
23
|
+
kcContextExtensionPerPage,
|
|
24
|
+
overrides: overrides_global,
|
|
25
|
+
overridesPerPage: overridesPerPage_global
|
|
26
|
+
} = params;
|
|
27
|
+
|
|
28
|
+
type KcContext = ExtendKcContext<KcContextExtension, KcContextExtensionPerPage>;
|
|
29
|
+
|
|
30
|
+
function getKcContextMock<PageId extends PageId_builtin | keyof KcContextExtensionPerPage>(params: {
|
|
31
|
+
pageId: PageId;
|
|
32
|
+
overrides?: DeepPartial<Extract<KcContext, { pageId: PageId }>>;
|
|
33
|
+
}): Extract<KcContext, { pageId: PageId }> {
|
|
34
|
+
const { pageId, overrides } = params;
|
|
35
|
+
|
|
36
|
+
const kcContextMock = structuredCloneButFunctions(
|
|
37
|
+
kcContextMocks.find(kcContextMock => kcContextMock.pageId === pageId) ?? {
|
|
38
|
+
...kcContextCommonMock,
|
|
39
|
+
pageId
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
[
|
|
44
|
+
kcContextExtension,
|
|
45
|
+
kcContextExtensionPerPage[pageId],
|
|
46
|
+
overrides_global,
|
|
47
|
+
overridesPerPage_global?.[pageId],
|
|
48
|
+
overrides
|
|
49
|
+
]
|
|
50
|
+
.filter(exclude(undefined))
|
|
51
|
+
.forEach(overrides =>
|
|
52
|
+
deepAssign({
|
|
53
|
+
target: kcContextMock,
|
|
54
|
+
source: overrides
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// @ts-expect-error: We know what we are doing
|
|
59
|
+
return kcContextMock;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { getKcContextMock };
|
|
63
|
+
}
|
|
@@ -0,0 +1,623 @@
|
|
|
1
|
+
import "../../tools/Object.fromEntries";
|
|
2
|
+
import type { KcContext, Attribute } from "./KcContext";
|
|
3
|
+
import { id } from "tsafe/id";
|
|
4
|
+
import { assert, type Equals } from "tsafe/assert";
|
|
5
|
+
import type { LanguageTag } from "../i18n/messages_defaultSet/types";
|
|
6
|
+
|
|
7
|
+
const attributesByName = Object.fromEntries(
|
|
8
|
+
id<Attribute[]>([
|
|
9
|
+
{
|
|
10
|
+
validators: {
|
|
11
|
+
length: {
|
|
12
|
+
"ignore.empty.value": true,
|
|
13
|
+
min: "3",
|
|
14
|
+
max: "255"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
displayName: "${username}",
|
|
18
|
+
annotations: {},
|
|
19
|
+
required: true,
|
|
20
|
+
autocomplete: "username",
|
|
21
|
+
readOnly: false,
|
|
22
|
+
name: "username"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
validators: {
|
|
26
|
+
length: {
|
|
27
|
+
max: "255",
|
|
28
|
+
"ignore.empty.value": true
|
|
29
|
+
},
|
|
30
|
+
email: {
|
|
31
|
+
"ignore.empty.value": true
|
|
32
|
+
},
|
|
33
|
+
pattern: {
|
|
34
|
+
"ignore.empty.value": true,
|
|
35
|
+
pattern: "gmail\\.com$"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
displayName: "${email}",
|
|
39
|
+
annotations: {},
|
|
40
|
+
required: true,
|
|
41
|
+
autocomplete: "email",
|
|
42
|
+
readOnly: false,
|
|
43
|
+
name: "email"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
validators: {
|
|
47
|
+
length: {
|
|
48
|
+
max: "255",
|
|
49
|
+
"ignore.empty.value": true
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
displayName: "${firstName}",
|
|
53
|
+
annotations: {},
|
|
54
|
+
required: true,
|
|
55
|
+
readOnly: false,
|
|
56
|
+
name: "firstName"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
validators: {
|
|
60
|
+
length: {
|
|
61
|
+
max: "255",
|
|
62
|
+
"ignore.empty.value": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
displayName: "${lastName}",
|
|
66
|
+
annotations: {},
|
|
67
|
+
required: true,
|
|
68
|
+
readOnly: false,
|
|
69
|
+
name: "lastName"
|
|
70
|
+
}
|
|
71
|
+
]).map(attribute => [attribute.name, attribute])
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const kcContextCommonMock: KcContext.Common = {
|
|
75
|
+
themeVersion: "0.0.0",
|
|
76
|
+
keycloakifyVersion: "0.0.0",
|
|
77
|
+
themeType: "login",
|
|
78
|
+
themeName: "my-theme-name",
|
|
79
|
+
url: {
|
|
80
|
+
loginAction: "#",
|
|
81
|
+
loginRestartFlowUrl: "#",
|
|
82
|
+
loginUrl: "#",
|
|
83
|
+
ssoLoginInOtherTabsUrl: "#"
|
|
84
|
+
},
|
|
85
|
+
realm: {
|
|
86
|
+
name: "myrealm",
|
|
87
|
+
displayName: "myrealm",
|
|
88
|
+
displayNameHtml: "myrealm",
|
|
89
|
+
internationalizationEnabled: true,
|
|
90
|
+
registrationEmailAsUsername: false
|
|
91
|
+
},
|
|
92
|
+
messagesPerField: {
|
|
93
|
+
get: () => "",
|
|
94
|
+
existsError: () => false,
|
|
95
|
+
printIfExists: function <T>(fieldName: string, text: T) {
|
|
96
|
+
return this.get(fieldName) !== "" ? text : undefined;
|
|
97
|
+
},
|
|
98
|
+
exists: function (fieldName) {
|
|
99
|
+
return this.get(fieldName) !== "";
|
|
100
|
+
},
|
|
101
|
+
getFirstError: function (...fieldNames) {
|
|
102
|
+
for (const fieldName of fieldNames) {
|
|
103
|
+
if (this.existsError(fieldName)) {
|
|
104
|
+
return this.get(fieldName);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return "";
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
locale: {
|
|
111
|
+
supported: (
|
|
112
|
+
[
|
|
113
|
+
/* spell-checker: disable */
|
|
114
|
+
["de", "Deutsch"],
|
|
115
|
+
["no", "Norsk"],
|
|
116
|
+
["ru", "Русский"],
|
|
117
|
+
["sv", "Svenska"],
|
|
118
|
+
["pt-BR", "Português (Brasil)"],
|
|
119
|
+
["lt", "Lietuvių"],
|
|
120
|
+
["en", "English"],
|
|
121
|
+
["it", "Italiano"],
|
|
122
|
+
["fr", "Français"],
|
|
123
|
+
["zh-CN", "中文简体"],
|
|
124
|
+
["es", "Español"],
|
|
125
|
+
["cs", "Čeština"],
|
|
126
|
+
["ja", "日本語"],
|
|
127
|
+
["sk", "Slovenčina"],
|
|
128
|
+
["pl", "Polski"],
|
|
129
|
+
["ca", "Català"],
|
|
130
|
+
["nl", "Nederlands"],
|
|
131
|
+
["tr", "Türkçe"],
|
|
132
|
+
["ar", "العربية"],
|
|
133
|
+
["da", "Dansk"],
|
|
134
|
+
["el", "Ελληνικά"],
|
|
135
|
+
["fa", "فارسی"],
|
|
136
|
+
["fi", "Suomi"],
|
|
137
|
+
["hu", "Magyar"],
|
|
138
|
+
["ka", "ქართული"],
|
|
139
|
+
["lv", "Latviešu"],
|
|
140
|
+
["pt", "Português"],
|
|
141
|
+
["th", "ไทย"],
|
|
142
|
+
["uk", "Українська"],
|
|
143
|
+
["zh-TW", "中文繁體"]
|
|
144
|
+
/* spell-checker: enable */
|
|
145
|
+
] as const
|
|
146
|
+
).map(([languageTag, label]) => {
|
|
147
|
+
{
|
|
148
|
+
type Got = typeof languageTag;
|
|
149
|
+
type Expected = LanguageTag;
|
|
150
|
+
|
|
151
|
+
type Missing = Exclude<Expected, Got>;
|
|
152
|
+
type Unexpected = Exclude<Got, Expected>;
|
|
153
|
+
|
|
154
|
+
assert<Equals<Missing, never>>();
|
|
155
|
+
assert<Equals<Unexpected, never>>();
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
languageTag,
|
|
160
|
+
label,
|
|
161
|
+
url: "https://gist.github.com/garronej/52baaca1bb925f2296ab32741e062b8e"
|
|
162
|
+
} as const;
|
|
163
|
+
}),
|
|
164
|
+
|
|
165
|
+
currentLanguageTag: "en"
|
|
166
|
+
},
|
|
167
|
+
auth: {
|
|
168
|
+
showUsername: false,
|
|
169
|
+
showResetCredentials: false,
|
|
170
|
+
showTryAnotherWayLink: false
|
|
171
|
+
},
|
|
172
|
+
client: {
|
|
173
|
+
clientId: "myApp",
|
|
174
|
+
attributes: {}
|
|
175
|
+
},
|
|
176
|
+
scripts: [],
|
|
177
|
+
isAppInitiatedAction: false,
|
|
178
|
+
properties: {},
|
|
179
|
+
"x-keycloakify": {
|
|
180
|
+
messages: {}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
const loginUrl = {
|
|
185
|
+
...kcContextCommonMock.url,
|
|
186
|
+
loginResetCredentialsUrl: "#",
|
|
187
|
+
registrationUrl: "#",
|
|
188
|
+
oauth2DeviceVerificationAction: "#",
|
|
189
|
+
oauthAction: "#"
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
export const kcContextMocks = [
|
|
193
|
+
id<KcContext.Login>({
|
|
194
|
+
...kcContextCommonMock,
|
|
195
|
+
pageId: "login.ftl",
|
|
196
|
+
url: loginUrl,
|
|
197
|
+
realm: {
|
|
198
|
+
...kcContextCommonMock.realm,
|
|
199
|
+
loginWithEmailAllowed: true,
|
|
200
|
+
rememberMe: true,
|
|
201
|
+
password: true,
|
|
202
|
+
resetPasswordAllowed: true,
|
|
203
|
+
registrationAllowed: true
|
|
204
|
+
},
|
|
205
|
+
auth: kcContextCommonMock.auth!,
|
|
206
|
+
social: {
|
|
207
|
+
displayInfo: true
|
|
208
|
+
},
|
|
209
|
+
usernameHidden: false,
|
|
210
|
+
login: {},
|
|
211
|
+
registrationDisabled: false
|
|
212
|
+
}),
|
|
213
|
+
id<KcContext.Register>({
|
|
214
|
+
...kcContextCommonMock,
|
|
215
|
+
url: {
|
|
216
|
+
...loginUrl,
|
|
217
|
+
registrationAction: "#"
|
|
218
|
+
},
|
|
219
|
+
isAppInitiatedAction: false,
|
|
220
|
+
passwordRequired: true,
|
|
221
|
+
recaptchaRequired: false,
|
|
222
|
+
pageId: "register.ftl",
|
|
223
|
+
profile: {
|
|
224
|
+
attributesByName
|
|
225
|
+
},
|
|
226
|
+
scripts: [
|
|
227
|
+
//"https://www.google.com/recaptcha/api.js"
|
|
228
|
+
]
|
|
229
|
+
}),
|
|
230
|
+
id<KcContext.Info>({
|
|
231
|
+
...kcContextCommonMock,
|
|
232
|
+
pageId: "info.ftl",
|
|
233
|
+
messageHeader: "<Message header>",
|
|
234
|
+
requiredActions: undefined,
|
|
235
|
+
skipLink: false,
|
|
236
|
+
actionUri: "#",
|
|
237
|
+
client: {
|
|
238
|
+
clientId: "myApp",
|
|
239
|
+
baseUrl: "#",
|
|
240
|
+
attributes: {}
|
|
241
|
+
},
|
|
242
|
+
message: {
|
|
243
|
+
type: "info",
|
|
244
|
+
summary:
|
|
245
|
+
"This is the info message from the Keycloak server (in real environment, this message is localized)"
|
|
246
|
+
}
|
|
247
|
+
}),
|
|
248
|
+
id<KcContext.Error>({
|
|
249
|
+
...kcContextCommonMock,
|
|
250
|
+
pageId: "error.ftl",
|
|
251
|
+
client: {
|
|
252
|
+
clientId: "myApp",
|
|
253
|
+
baseUrl: "#",
|
|
254
|
+
attributes: {}
|
|
255
|
+
},
|
|
256
|
+
message: {
|
|
257
|
+
type: "error",
|
|
258
|
+
summary:
|
|
259
|
+
"This is the error message from the Keycloak server (in real environment, this message is localized)"
|
|
260
|
+
}
|
|
261
|
+
}),
|
|
262
|
+
id<KcContext.LoginResetPassword>({
|
|
263
|
+
...kcContextCommonMock,
|
|
264
|
+
pageId: "login-reset-password.ftl",
|
|
265
|
+
realm: {
|
|
266
|
+
...kcContextCommonMock.realm,
|
|
267
|
+
loginWithEmailAllowed: false,
|
|
268
|
+
duplicateEmailsAllowed: false
|
|
269
|
+
},
|
|
270
|
+
url: loginUrl,
|
|
271
|
+
auth: {}
|
|
272
|
+
}),
|
|
273
|
+
id<KcContext.LoginVerifyEmail>({
|
|
274
|
+
...kcContextCommonMock,
|
|
275
|
+
pageId: "login-verify-email.ftl",
|
|
276
|
+
user: {
|
|
277
|
+
email: "john.doe@gmail.com"
|
|
278
|
+
}
|
|
279
|
+
}),
|
|
280
|
+
id<KcContext.Terms>({
|
|
281
|
+
...kcContextCommonMock,
|
|
282
|
+
pageId: "terms.ftl"
|
|
283
|
+
}),
|
|
284
|
+
id<KcContext.LoginOauth2DeviceVerifyUserCode>({
|
|
285
|
+
...kcContextCommonMock,
|
|
286
|
+
pageId: "login-oauth2-device-verify-user-code.ftl",
|
|
287
|
+
url: loginUrl
|
|
288
|
+
}),
|
|
289
|
+
id<KcContext.LoginOauthGrant>({
|
|
290
|
+
...kcContextCommonMock,
|
|
291
|
+
pageId: "login-oauth-grant.ftl",
|
|
292
|
+
oauth: {
|
|
293
|
+
code: "5-1N4CIzfi1aprIQjmylI-9e3spLCWW9i5d-GDcs-Sw",
|
|
294
|
+
clientScopesRequested: [
|
|
295
|
+
{ consentScreenText: "${profileScopeConsentText}" },
|
|
296
|
+
{ consentScreenText: "${rolesScopeConsentText}" },
|
|
297
|
+
{ consentScreenText: "${emailScopeConsentText}" }
|
|
298
|
+
],
|
|
299
|
+
client: "account"
|
|
300
|
+
},
|
|
301
|
+
url: loginUrl
|
|
302
|
+
}),
|
|
303
|
+
id<KcContext.LoginOtp>({
|
|
304
|
+
...kcContextCommonMock,
|
|
305
|
+
pageId: "login-otp.ftl",
|
|
306
|
+
otpLogin: {
|
|
307
|
+
userOtpCredentials: [
|
|
308
|
+
{
|
|
309
|
+
id: "id1",
|
|
310
|
+
userLabel: "label1"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
id: "id2",
|
|
314
|
+
userLabel: "label2"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
}),
|
|
319
|
+
id<KcContext.LoginUsername>({
|
|
320
|
+
...kcContextCommonMock,
|
|
321
|
+
pageId: "login-username.ftl",
|
|
322
|
+
url: loginUrl,
|
|
323
|
+
realm: {
|
|
324
|
+
...kcContextCommonMock.realm,
|
|
325
|
+
loginWithEmailAllowed: true,
|
|
326
|
+
rememberMe: true,
|
|
327
|
+
password: true,
|
|
328
|
+
resetPasswordAllowed: true,
|
|
329
|
+
registrationAllowed: true
|
|
330
|
+
},
|
|
331
|
+
social: {
|
|
332
|
+
displayInfo: true
|
|
333
|
+
},
|
|
334
|
+
usernameHidden: false,
|
|
335
|
+
login: {},
|
|
336
|
+
registrationDisabled: false
|
|
337
|
+
}),
|
|
338
|
+
id<KcContext.LoginPassword>({
|
|
339
|
+
...kcContextCommonMock,
|
|
340
|
+
pageId: "login-password.ftl",
|
|
341
|
+
url: loginUrl,
|
|
342
|
+
realm: {
|
|
343
|
+
...kcContextCommonMock.realm,
|
|
344
|
+
resetPasswordAllowed: true
|
|
345
|
+
}
|
|
346
|
+
}),
|
|
347
|
+
id<KcContext.WebauthnAuthenticate>({
|
|
348
|
+
...kcContextCommonMock,
|
|
349
|
+
pageId: "webauthn-authenticate.ftl",
|
|
350
|
+
url: loginUrl,
|
|
351
|
+
authenticators: {
|
|
352
|
+
authenticators: []
|
|
353
|
+
},
|
|
354
|
+
realm: {
|
|
355
|
+
...kcContextCommonMock.realm,
|
|
356
|
+
password: true,
|
|
357
|
+
registrationAllowed: true
|
|
358
|
+
},
|
|
359
|
+
challenge: "",
|
|
360
|
+
userVerification: "not specified",
|
|
361
|
+
rpId: "",
|
|
362
|
+
createTimeout: "0",
|
|
363
|
+
isUserIdentified: "false",
|
|
364
|
+
shouldDisplayAuthenticators: false
|
|
365
|
+
}),
|
|
366
|
+
id<KcContext.LoginUpdatePassword>({
|
|
367
|
+
...kcContextCommonMock,
|
|
368
|
+
pageId: "login-update-password.ftl"
|
|
369
|
+
}),
|
|
370
|
+
id<KcContext.LoginUpdateProfile>({
|
|
371
|
+
...kcContextCommonMock,
|
|
372
|
+
pageId: "login-update-profile.ftl",
|
|
373
|
+
profile: {
|
|
374
|
+
attributesByName
|
|
375
|
+
}
|
|
376
|
+
}),
|
|
377
|
+
id<KcContext.LoginIdpLinkConfirm>({
|
|
378
|
+
...kcContextCommonMock,
|
|
379
|
+
pageId: "login-idp-link-confirm.ftl",
|
|
380
|
+
idpAlias: "FranceConnect"
|
|
381
|
+
}),
|
|
382
|
+
id<KcContext.LoginIdpLinkEmail>({
|
|
383
|
+
...kcContextCommonMock,
|
|
384
|
+
pageId: "login-idp-link-email.ftl",
|
|
385
|
+
idpAlias: "FranceConnect",
|
|
386
|
+
brokerContext: {
|
|
387
|
+
username: "anUsername"
|
|
388
|
+
}
|
|
389
|
+
}),
|
|
390
|
+
id<KcContext.LoginConfigTotp>({
|
|
391
|
+
...kcContextCommonMock,
|
|
392
|
+
pageId: "login-config-totp.ftl",
|
|
393
|
+
totp: {
|
|
394
|
+
totpSecretEncoded: "KVVF G2BY N4YX S6LB IUYT K2LH IFYE 4SBV",
|
|
395
|
+
qrUrl: "#",
|
|
396
|
+
totpSecretQrCode:
|
|
397
|
+
"iVBORw0KGgoAAAANSUhEUgAAAPYAAAD2AQAAAADNaUdlAAACM0lEQVR4Xu3OIZJgOQwDUDFd2UxiurLAVnnbHw4YGDKtSiWOn4Gxf81//7r/+q8b4HfLGBZDK9d85NmNR+sB42sXvOYrN5P1DcgYYFTGfOlbzE8gzwy3euweGizw7cfdl34/GRhlkxjKNV+5AebPXPORX1JuB9x8ZfbyyD2y1krWAKsbMq1HnqQDaLfa77p4+MqvzEGSqvSAD/2IHW2yHaigR9tX3m8dDIYGcNf3f+gDpVBZbZU77zyJ6Rlcy+qoTMG887KAPD9hsh6a1Sv3gJUHGHUAxSMzj7zqDDe7Phmt2eG+8UsMxjRGm816MAO+8VMl1R1jGHOrZB/5Zo/WXAPgxixm9Mo96vDGrM1eOto8c4Ax4wF437mifOXlpiPzCnN7Y9l95NnEMxgMY9AAGA8fucH14Y1aVb6N/cqrmyh0BVht7k1e+bU8LK0Cg5vmVq9c5vHIjOfqxDIfeTraNVTwewa4wVe+SW5N+uP1qACeudUZbqGOfA6VZV750Noq2Xx3kpveV44ZelSV1V7KFHzkWyVrrlUwG0Pl9pWnoy3vsQoME6vKI69i5osVgwWzHT7zjmJtMcNUSVn1oYMd7ZodbgowZl45VG0uVuLPUr1yc79uaQBag/mqR34xhlWyHm1prplHboCWdZ4TeZjsK8+dI+jbz1C5hl65mcpgB5dhcj8+dGO+0Ko68+lD37JDD83dpDLzzK+TrQyaVwGj6pUboGV+7+AyN8An/pf84/7rv/4/1l4OCc/1BYMAAAAASUVORK5CYII=",
|
|
398
|
+
manualUrl: "#",
|
|
399
|
+
totpSecret: "G4nsI8lQagRMUchH8jEG",
|
|
400
|
+
otpCredentials: [],
|
|
401
|
+
supportedApplications: ["FreeOTP", "Google Authenticator"],
|
|
402
|
+
policy: {
|
|
403
|
+
algorithm: "HmacSHA1",
|
|
404
|
+
digits: 6,
|
|
405
|
+
lookAheadWindow: 1,
|
|
406
|
+
type: "totp",
|
|
407
|
+
period: 30,
|
|
408
|
+
getAlgorithmKey: () => "SHA1"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}),
|
|
412
|
+
id<KcContext.LogoutConfirm>({
|
|
413
|
+
...kcContextCommonMock,
|
|
414
|
+
pageId: "logout-confirm.ftl",
|
|
415
|
+
url: {
|
|
416
|
+
...kcContextCommonMock.url,
|
|
417
|
+
logoutConfirmAction: "Continuer?"
|
|
418
|
+
},
|
|
419
|
+
client: {
|
|
420
|
+
clientId: "myApp",
|
|
421
|
+
baseUrl: "#",
|
|
422
|
+
attributes: {}
|
|
423
|
+
},
|
|
424
|
+
logoutConfirm: { code: "123", skipLink: false }
|
|
425
|
+
}),
|
|
426
|
+
id<KcContext.IdpReviewUserProfile>({
|
|
427
|
+
...kcContextCommonMock,
|
|
428
|
+
pageId: "idp-review-user-profile.ftl",
|
|
429
|
+
profile: {
|
|
430
|
+
attributesByName
|
|
431
|
+
}
|
|
432
|
+
}),
|
|
433
|
+
id<KcContext.UpdateEmail>({
|
|
434
|
+
...kcContextCommonMock,
|
|
435
|
+
pageId: "update-email.ftl",
|
|
436
|
+
profile: {
|
|
437
|
+
attributesByName: {
|
|
438
|
+
email: attributesByName["email"]
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}),
|
|
442
|
+
id<KcContext.SelectAuthenticator>({
|
|
443
|
+
...kcContextCommonMock,
|
|
444
|
+
pageId: "select-authenticator.ftl",
|
|
445
|
+
auth: {
|
|
446
|
+
authenticationSelections: [
|
|
447
|
+
{
|
|
448
|
+
authExecId: "f607f83c-537e-42b7-99d7-c52d459afe84",
|
|
449
|
+
displayName: "otp-display-name",
|
|
450
|
+
helpText: "otp-help-text",
|
|
451
|
+
iconCssClass: "kcAuthenticatorOTPClass"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
authExecId: "5ed881b1-84cd-4e9b-b4d9-f329ea61a58c",
|
|
455
|
+
displayName: "webauthn-display-name",
|
|
456
|
+
helpText: "webauthn-help-text",
|
|
457
|
+
iconCssClass: "kcAuthenticatorWebAuthnClass"
|
|
458
|
+
}
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
}),
|
|
462
|
+
id<KcContext.SamlPostForm>({
|
|
463
|
+
...kcContextCommonMock,
|
|
464
|
+
pageId: "saml-post-form.ftl",
|
|
465
|
+
samlPost: {
|
|
466
|
+
url: "#"
|
|
467
|
+
}
|
|
468
|
+
}),
|
|
469
|
+
id<KcContext.LoginPageExpired>({
|
|
470
|
+
...kcContextCommonMock,
|
|
471
|
+
pageId: "login-page-expired.ftl"
|
|
472
|
+
}),
|
|
473
|
+
|
|
474
|
+
id<KcContext.FrontchannelLogout>({
|
|
475
|
+
...kcContextCommonMock,
|
|
476
|
+
pageId: "frontchannel-logout.ftl",
|
|
477
|
+
logout: {
|
|
478
|
+
clients: [
|
|
479
|
+
{
|
|
480
|
+
name: "myApp",
|
|
481
|
+
frontChannelLogoutUrl: "#"
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
name: "myApp2",
|
|
485
|
+
frontChannelLogoutUrl: "#"
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
}),
|
|
490
|
+
id<KcContext.WebauthnRegister>({
|
|
491
|
+
pageId: "webauthn-register.ftl",
|
|
492
|
+
...kcContextCommonMock,
|
|
493
|
+
challenge: "random-challenge-string",
|
|
494
|
+
userid: "user123",
|
|
495
|
+
username: "johndoe",
|
|
496
|
+
signatureAlgorithms: ["ES256", "RS256"],
|
|
497
|
+
rpEntityName: "Example Corp",
|
|
498
|
+
rpId: "example.com",
|
|
499
|
+
attestationConveyancePreference: "direct",
|
|
500
|
+
authenticatorAttachment: "platform",
|
|
501
|
+
requireResidentKey: "required",
|
|
502
|
+
userVerificationRequirement: "preferred",
|
|
503
|
+
createTimeout: 60000,
|
|
504
|
+
excludeCredentialIds: "credId123,credId456",
|
|
505
|
+
isSetRetry: false,
|
|
506
|
+
isAppInitiatedAction: true
|
|
507
|
+
}),
|
|
508
|
+
id<KcContext.DeleteCredential>({
|
|
509
|
+
pageId: "delete-credential.ftl",
|
|
510
|
+
...kcContextCommonMock,
|
|
511
|
+
credentialLabel: "myCredential"
|
|
512
|
+
}),
|
|
513
|
+
id<KcContext.Code>({
|
|
514
|
+
pageId: "code.ftl",
|
|
515
|
+
...kcContextCommonMock,
|
|
516
|
+
code: {
|
|
517
|
+
success: true,
|
|
518
|
+
code: "123456"
|
|
519
|
+
}
|
|
520
|
+
}),
|
|
521
|
+
id<KcContext.DeleteAccountConfirm>({
|
|
522
|
+
pageId: "delete-account-confirm.ftl",
|
|
523
|
+
...kcContextCommonMock,
|
|
524
|
+
triggered_from_aia: true
|
|
525
|
+
}),
|
|
526
|
+
id<KcContext.LoginRecoveryAuthnCodeConfig>({
|
|
527
|
+
pageId: "login-recovery-authn-code-config.ftl",
|
|
528
|
+
...kcContextCommonMock,
|
|
529
|
+
recoveryAuthnCodesConfigBean: {
|
|
530
|
+
generatedRecoveryAuthnCodesList: ["code123", "code456", "code789"],
|
|
531
|
+
generatedRecoveryAuthnCodesAsString: "code123, code456, code789",
|
|
532
|
+
generatedAt: new Date().getTime()
|
|
533
|
+
}
|
|
534
|
+
}),
|
|
535
|
+
id<KcContext.LoginRecoveryAuthnCodeInput>({
|
|
536
|
+
pageId: "login-recovery-authn-code-input.ftl",
|
|
537
|
+
...kcContextCommonMock,
|
|
538
|
+
recoveryAuthnCodesInputBean: {
|
|
539
|
+
codeNumber: 1234
|
|
540
|
+
}
|
|
541
|
+
}),
|
|
542
|
+
id<KcContext.LoginResetOtp>({
|
|
543
|
+
pageId: "login-reset-otp.ftl",
|
|
544
|
+
...kcContextCommonMock,
|
|
545
|
+
configuredOtpCredentials: {
|
|
546
|
+
userOtpCredentials: [
|
|
547
|
+
{
|
|
548
|
+
id: "otpId1",
|
|
549
|
+
userLabel: "OTP Device 1"
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
id: "otpId2",
|
|
553
|
+
userLabel: "OTP Device 2"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
id: "otpId3",
|
|
557
|
+
userLabel: "Backup OTP"
|
|
558
|
+
}
|
|
559
|
+
],
|
|
560
|
+
selectedCredentialId: "otpId2"
|
|
561
|
+
}
|
|
562
|
+
}),
|
|
563
|
+
id<KcContext.LoginX509Info>({
|
|
564
|
+
pageId: "login-x509-info.ftl",
|
|
565
|
+
...kcContextCommonMock,
|
|
566
|
+
x509: {
|
|
567
|
+
formData: {
|
|
568
|
+
subjectDN: "CN=John Doe, O=Example Corp, C=US",
|
|
569
|
+
isUserEnabled: true,
|
|
570
|
+
username: "johndoe"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}),
|
|
574
|
+
id<KcContext.WebauthnError>({
|
|
575
|
+
pageId: "webauthn-error.ftl",
|
|
576
|
+
...kcContextCommonMock,
|
|
577
|
+
isAppInitiatedAction: true
|
|
578
|
+
}),
|
|
579
|
+
id<KcContext.LoginPasskeysConditionalAuthenticate>({
|
|
580
|
+
pageId: "login-passkeys-conditional-authenticate.ftl",
|
|
581
|
+
...kcContextCommonMock,
|
|
582
|
+
url: {
|
|
583
|
+
...kcContextCommonMock.url,
|
|
584
|
+
registrationUrl: "#"
|
|
585
|
+
},
|
|
586
|
+
realm: {
|
|
587
|
+
...kcContextCommonMock.realm,
|
|
588
|
+
password: true,
|
|
589
|
+
registrationAllowed: true
|
|
590
|
+
},
|
|
591
|
+
registrationDisabled: false,
|
|
592
|
+
isUserIdentified: "false",
|
|
593
|
+
challenge: "",
|
|
594
|
+
userVerification: "not specified",
|
|
595
|
+
rpId: "",
|
|
596
|
+
createTimeout: 0,
|
|
597
|
+
authenticators: {
|
|
598
|
+
authenticators: []
|
|
599
|
+
},
|
|
600
|
+
shouldDisplayAuthenticators: false,
|
|
601
|
+
login: {}
|
|
602
|
+
}),
|
|
603
|
+
id<KcContext.LoginIdpLinkConfirmOverride>({
|
|
604
|
+
pageId: "login-idp-link-confirm-override.ftl",
|
|
605
|
+
...kcContextCommonMock,
|
|
606
|
+
url: {
|
|
607
|
+
...kcContextCommonMock.url,
|
|
608
|
+
loginRestartFlowUrl: "#"
|
|
609
|
+
},
|
|
610
|
+
idpDisplayName: "Google"
|
|
611
|
+
})
|
|
612
|
+
];
|
|
613
|
+
|
|
614
|
+
{
|
|
615
|
+
type Got = (typeof kcContextMocks)[number]["pageId"];
|
|
616
|
+
type Expected = KcContext["pageId"];
|
|
617
|
+
|
|
618
|
+
type OnlyInGot = Exclude<Got, Expected>;
|
|
619
|
+
type OnlyInExpected = Exclude<Expected, Got>;
|
|
620
|
+
|
|
621
|
+
assert<Equals<OnlyInGot, never>>;
|
|
622
|
+
assert<Equals<OnlyInExpected, never>>;
|
|
623
|
+
}
|