Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
5140389502 | |||
fc6328131f | |||
9de0083ca6 | |||
f5231b840d | |||
afb6596c4b | |||
dde9afef92 | |||
6595e9c3cb | |||
c0e3b5fe06 | |||
6b8f3bbc51 | |||
9a5a021e64 | |||
14c05fec8c | |||
eaf7a455cd | |||
55bb21f3ee | |||
f123bc0912 | |||
572eb7b1c0 | |||
2befaff8a8 | |||
437a9ce2d3 | |||
1b967b250a | |||
e221f39e07 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -47,5 +47,5 @@ jspm_packages
|
|||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
/keycloak_theme_email
|
/keycloak_email
|
||||||
/build_keycloak
|
/build_keycloak
|
23
CHANGELOG.md
23
CHANGELOG.md
@ -1,3 +1,26 @@
|
|||||||
|
## **5.4.0** (2022-05-23)
|
||||||
|
|
||||||
|
- #109
|
||||||
|
|
||||||
|
### **5.3.2** (2022-05-04)
|
||||||
|
|
||||||
|
- Merge pull request #101 from Romcol/bugfix/99
|
||||||
|
|
||||||
|
Issue #99 - Make replace less greedy in remplaceImportFromStatic
|
||||||
|
- [IMP] Issue #99 - Make replace less greedy in remplaceImportFromStatic
|
||||||
|
|
||||||
|
### **5.3.1** (2022-04-29)
|
||||||
|
|
||||||
|
- Comment out missleading informations
|
||||||
|
|
||||||
|
## **5.3.0** (2022-04-28)
|
||||||
|
|
||||||
|
- Rename keycloak_theme_email to keycloak_email (it's shorter)
|
||||||
|
|
||||||
|
## **5.2.0** (2022-04-27)
|
||||||
|
|
||||||
|
- Export KcApp
|
||||||
|
|
||||||
## **5.1.0** (2022-04-27)
|
## **5.1.0** (2022-04-27)
|
||||||
|
|
||||||
- Export kcLanguageTags
|
- Export kcLanguageTags
|
||||||
|
@ -38,6 +38,15 @@
|
|||||||
|
|
||||||
# Changelog highlights
|
# Changelog highlights
|
||||||
|
|
||||||
|
## v5.3.0
|
||||||
|
|
||||||
|
Rename `keycloak_theme_email` to `keycloak_email`.
|
||||||
|
If you already had a `keycloak_theme_email` you should rename it `keycloak_email`.
|
||||||
|
|
||||||
|
## v5.0.0
|
||||||
|
|
||||||
|
New i18n system. Import of terms and services have changed. [See example](https://github.com/garronej/keycloakify-demo-app/blob/a5b6a50f24bc25e082931f5ad9ebf47492acd12a/src/index.tsx#L46-L63).
|
||||||
|
|
||||||
## v4.10.0
|
## v4.10.0
|
||||||
|
|
||||||
Add `login-idp-link-email.ftl` page [See PR](https://github.com/InseeFrLab/keycloakify/pull/92).
|
Add `login-idp-link-email.ftl` page [See PR](https://github.com/InseeFrLab/keycloakify/pull/92).
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "keycloakify",
|
"name": "keycloakify",
|
||||||
"version": "5.1.0",
|
"version": "5.4.0",
|
||||||
"description": "Keycloak theme generator for Reacts app",
|
"description": "Keycloak theme generator for Reacts app",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -22,7 +22,7 @@
|
|||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"build-keycloak-theme": "dist/bin/build-keycloak-theme/index.js",
|
"build-keycloak-theme": "dist/bin/build-keycloak-theme/index.js",
|
||||||
"create-keycloak-theme-email-directory": "dist/bin/create-keycloak-theme-email-directory.js",
|
"create-keycloak-email-directory": "dist/bin/create-keycloak-email-directory.js",
|
||||||
"download-builtin-keycloak-theme": "dist/bin/download-builtin-keycloak-theme.js"
|
"download-builtin-keycloak-theme": "dist/bin/download-builtin-keycloak-theme.js"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
@ -19,7 +19,7 @@ const doUseExternalAssets = process.argv[2]?.toLowerCase() === "--external-asset
|
|||||||
const parsedPackageJson: ParsedPackageJson = require(pathJoin(reactProjectDirPath, "package.json"));
|
const parsedPackageJson: ParsedPackageJson = require(pathJoin(reactProjectDirPath, "package.json"));
|
||||||
|
|
||||||
export const keycloakThemeBuildingDirPath = pathJoin(reactProjectDirPath, "build_keycloak");
|
export const keycloakThemeBuildingDirPath = pathJoin(reactProjectDirPath, "build_keycloak");
|
||||||
export const keycloakThemeEmailDirPath = pathJoin(keycloakThemeBuildingDirPath, "..", "keycloak_theme_email");
|
export const keycloakThemeEmailDirPath = pathJoin(keycloakThemeBuildingDirPath, "..", "keycloak_email");
|
||||||
|
|
||||||
function sanitizeThemeName(name: string) {
|
function sanitizeThemeName(name: string) {
|
||||||
return name
|
return name
|
||||||
@ -106,7 +106,8 @@ export function main() {
|
|||||||
`✅ Your keycloak theme has been generated and bundled into ./${pathRelative(reactProjectDirPath, jarFilePath)} 🚀`,
|
`✅ Your keycloak theme has been generated and bundled into ./${pathRelative(reactProjectDirPath, jarFilePath)} 🚀`,
|
||||||
`It is to be placed in "/opt/keycloak/providers" in the container running a quay.io/keycloak/keycloak Docker image.`,
|
`It is to be placed in "/opt/keycloak/providers" in the container running a quay.io/keycloak/keycloak Docker image.`,
|
||||||
"",
|
"",
|
||||||
"Using Helm (https://github.com/codecentric/helm-charts), edit to reflect:",
|
//TODO: Restore when we find a good Helm chart for Keycloak.
|
||||||
|
//"Using Helm (https://github.com/codecentric/helm-charts), edit to reflect:",
|
||||||
"",
|
"",
|
||||||
"value.yaml: ",
|
"value.yaml: ",
|
||||||
" extraInitContainers: |",
|
" extraInitContainers: |",
|
||||||
|
@ -124,9 +124,11 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
) || (
|
) || (
|
||||||
<#-- https://github.com/InseeFrLab/keycloakify/pull/65#issuecomment-991896344 (reports with saml-post-form.ftl) -->
|
<#-- https://github.com/InseeFrLab/keycloakify/pull/65#issuecomment-991896344 (reports with saml-post-form.ftl) -->
|
||||||
<#-- https://github.com/InseeFrLab/keycloakify/issues/91#issue-1212319466 (reports with error.ftl and Kc18) -->
|
<#-- https://github.com/InseeFrLab/keycloakify/issues/91#issue-1212319466 (reports with error.ftl and Kc18) -->
|
||||||
|
<#-- https://github.com/InseeFrLab/keycloakify/issues/109#issuecomment-1134610163 -->
|
||||||
key == "loginAction" &&
|
key == "loginAction" &&
|
||||||
are_same_path(path, ["url"]) &&
|
are_same_path(path, ["url"]) &&
|
||||||
["saml-post-form.ftl", "error.ftl"]?seq_contains(pageId)
|
["saml-post-form.ftl", "error.ftl", "info.ftl"]?seq_contains(pageId) &&
|
||||||
|
!(auth?has_content && auth.showTryAnotherWayLink())
|
||||||
) || (
|
) || (
|
||||||
["contextData", "idpConfig", "idp", "authenticationSession"]?seq_contains(key) &&
|
["contextData", "idpConfig", "idp", "authenticationSession"]?seq_contains(key) &&
|
||||||
are_same_path(path, ["brokerContext"]) &&
|
are_same_path(path, ["brokerContext"]) &&
|
||||||
@ -153,6 +155,33 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
|
|||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
|
<#if key == "showUsername" && are_same_path(path, ["auth"])>
|
||||||
|
<#attempt>
|
||||||
|
<#return auth.showUsername()?c>
|
||||||
|
<#recover>
|
||||||
|
<#local out_seq += ["/*Couldn't evaluate auth.showUsername()*/"]>
|
||||||
|
<#continue>
|
||||||
|
</#attempt>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#if key == "showResetCredentials" && are_same_path(path, ["auth"])>
|
||||||
|
<#attempt>
|
||||||
|
<#return auth.showResetCredentials()?c>
|
||||||
|
<#recover>
|
||||||
|
<#local out_seq += ["/*Couldn't evaluate auth.showResetCredentials()*/"]>
|
||||||
|
<#continue>
|
||||||
|
</#attempt>
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<#if key == "showTryAnotherWayLink" && are_same_path(path, ["auth"])>
|
||||||
|
<#attempt>
|
||||||
|
<#return auth.showTryAnotherWayLink()?c>
|
||||||
|
<#recover>
|
||||||
|
<#local out_seq += ["/*Couldn't evaluate auth.showTryAnotherWayLink()*/"]>
|
||||||
|
<#continue>
|
||||||
|
</#attempt>
|
||||||
|
</#if>
|
||||||
|
|
||||||
<#attempt>
|
<#attempt>
|
||||||
<#if !object[key]??>
|
<#if !object[key]??>
|
||||||
<#continue>
|
<#continue>
|
||||||
|
@ -88,7 +88,7 @@ export function generateKeycloakThemeResources(params: {
|
|||||||
console.log(
|
console.log(
|
||||||
[
|
[
|
||||||
`Not bundling email template because ${pathBasename(keycloakThemeEmailDirPath)} does not exist`,
|
`Not bundling email template because ${pathBasename(keycloakThemeEmailDirPath)} does not exist`,
|
||||||
`To start customizing the email template, run: 👉 npx create-keycloak-theme-email-directory 👈`,
|
`To start customizing the email template, run: 👉 npx create-keycloak-email-directory 👈`,
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
);
|
);
|
||||||
doBundleEmailTemplate = false;
|
doBundleEmailTemplate = false;
|
||||||
|
@ -17,12 +17,12 @@ export function replaceImportsFromStaticInJsCode(params: { jsCode: string; urlOr
|
|||||||
const { jsCode, urlOrigin } = params;
|
const { jsCode, urlOrigin } = params;
|
||||||
|
|
||||||
const fixedJsCode = jsCode
|
const fixedJsCode = jsCode
|
||||||
.replace(/(\w+\.\w+)\+"static\//g, (...[, group]) =>
|
.replace(/([a-zA-Z]+\.[a-zA-Z]+)\+"static\//g, (...[, group]) =>
|
||||||
urlOrigin === undefined
|
urlOrigin === undefined
|
||||||
? `window.${ftlValuesGlobalName}.url.resourcesPath + "/build/static/`
|
? `window.${ftlValuesGlobalName}.url.resourcesPath + "/build/static/`
|
||||||
: `("${ftlValuesGlobalName}" in window ? "${urlOrigin}" : "") + ${group} + "static/`,
|
: `("${ftlValuesGlobalName}" in window ? "${urlOrigin}" : "") + ${group} + "static/`,
|
||||||
)
|
)
|
||||||
.replace(/".chunk.css",(\w)+=(\w+\.\w+)\+(\w+),/, (...[, group1, group2, group3]) =>
|
.replace(/".chunk.css",([a-zA-Z])+=([a-zA-Z]+\.[a-zA-Z]+)\+([a-zA-Z]+),/, (...[, group1, group2, group3]) =>
|
||||||
urlOrigin === undefined
|
urlOrigin === undefined
|
||||||
? `".chunk.css",${group1} = window.${ftlValuesGlobalName}.url.resourcesPath + "/build/" + ${group3},`
|
? `".chunk.css",${group1} = window.${ftlValuesGlobalName}.url.resourcesPath + "/build/" + ${group3},`
|
||||||
: `".chunk.css",${group1} = ("${ftlValuesGlobalName}" in window ? "${urlOrigin}" : "") + ${group2} + ${group3},`,
|
: `".chunk.css",${group1} = ("${ftlValuesGlobalName}" in window ? "${urlOrigin}" : "") + ${group2} + ${group3},`,
|
||||||
|
@ -52,9 +52,9 @@ export declare namespace KcContextBase {
|
|||||||
currentLanguageTag: KcLanguageTag;
|
currentLanguageTag: KcLanguageTag;
|
||||||
};
|
};
|
||||||
auth?: {
|
auth?: {
|
||||||
showUsername: boolean;
|
showUsername?: boolean;
|
||||||
showResetCredentials: boolean;
|
showResetCredentials?: boolean;
|
||||||
showTryAnotherWayLink: boolean;
|
showTryAnotherWayLink?: boolean;
|
||||||
attemptedUsername?: string;
|
attemptedUsername?: string;
|
||||||
};
|
};
|
||||||
scripts: string[];
|
scripts: string[];
|
||||||
|
@ -4,6 +4,7 @@ export * from "./i18n";
|
|||||||
|
|
||||||
export { useDownloadTerms } from "./components/Terms";
|
export { useDownloadTerms } from "./components/Terms";
|
||||||
|
|
||||||
|
export * from "./components/KcApp";
|
||||||
export * from "./components/KcProps";
|
export * from "./components/KcProps";
|
||||||
export * from "./keycloakJsAdapter";
|
export * from "./keycloakJsAdapter";
|
||||||
export * from "./useFormValidationSlice";
|
export * from "./useFormValidationSlice";
|
||||||
|
@ -8,7 +8,7 @@ generateKeycloakThemeResources({
|
|||||||
"themeName": "keycloakify-demo-app",
|
"themeName": "keycloakify-demo-app",
|
||||||
"reactAppBuildDirPath": pathJoin(sampleReactProjectDirPath, "build"),
|
"reactAppBuildDirPath": pathJoin(sampleReactProjectDirPath, "build"),
|
||||||
"keycloakThemeBuildingDirPath": pathJoin(sampleReactProjectDirPath, "build_keycloak_theme"),
|
"keycloakThemeBuildingDirPath": pathJoin(sampleReactProjectDirPath, "build_keycloak_theme"),
|
||||||
"keycloakThemeEmailDirPath": pathJoin(sampleReactProjectDirPath, "keycloak_theme_email"),
|
"keycloakThemeEmailDirPath": pathJoin(sampleReactProjectDirPath, "keycloak_email"),
|
||||||
"urlPathname": "/keycloakify-demo-app/",
|
"urlPathname": "/keycloakify-demo-app/",
|
||||||
"urlOrigin": undefined,
|
"urlOrigin": undefined,
|
||||||
"extraPagesId": ["my-custom-page.ftl"],
|
"extraPagesId": ["my-custom-page.ftl"],
|
||||||
|
Reference in New Issue
Block a user