diff --git a/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts b/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts index 3999ce8f..89c42ef7 100644 --- a/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts +++ b/src/bin/keycloakify/buildJars/getKeycloakVersionRangeForJar.ts @@ -52,9 +52,9 @@ export function getKeycloakVersionRangeForJar(params: { case "0.6": switch (keycloakThemeAdditionalInfoExtensionVersion) { case null: - return undefined; + return "26-and-above" as const; case "1.1.5": - return "25-and-above" as const; + return "25" as const; } } assert>(false); @@ -75,9 +75,9 @@ export function getKeycloakVersionRangeForJar(params: { } switch (keycloakThemeAdditionalInfoExtensionVersion) { case null: - return "21-and-below"; + return "all-other-versions"; case "1.1.5": - return "22-and-above"; + return "22-to-25"; } assert>( false diff --git a/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl b/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl index 083f6251..c96d3330 100644 --- a/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl +++ b/src/bin/keycloakify/generateFtl/kcContextDeclarationTemplate.ftl @@ -236,6 +236,9 @@ function decodeHtmlEntities(htmlStr){ "identityFederationEnabled", "userManagedAccessAllowed" ]?seq_contains(key) + ) || ( + ["flowContext", "session", "realm"]?seq_contains(key) && + areSamePath(path, ["social"]) ) > <#-- <#local outSeq += ["/*" + path?join(".") + "." + key + " excluded*/"]> --> diff --git a/src/bin/shared/KeycloakVersionRange.ts b/src/bin/shared/KeycloakVersionRange.ts index 2827d34e..860f42f0 100644 --- a/src/bin/shared/KeycloakVersionRange.ts +++ b/src/bin/shared/KeycloakVersionRange.ts @@ -3,7 +3,7 @@ export type KeycloakVersionRange = | KeycloakVersionRange.WithoutAccountV1Theme; export namespace KeycloakVersionRange { - export type WithoutAccountV1Theme = "21-and-below" | "22-and-above"; + export type WithoutAccountV1Theme = "22-to-25" | "all-other-versions"; - export type WithAccountV1Theme = "21-and-below" | "23" | "24" | "25-and-above"; + export type WithAccountV1Theme = "21-and-below" | "23" | "24" | "25" | "26-and-above"; } diff --git a/src/bin/shared/buildContext.ts b/src/bin/shared/buildContext.ts index 15d9773a..1b841d47 100644 --- a/src/bin/shared/buildContext.ts +++ b/src/bin/shared/buildContext.ts @@ -25,6 +25,7 @@ import { type ThemeType } from "./constants"; import { id } from "tsafe/id"; import chalk from "chalk"; import { getProxyFetchOptions, type ProxyFetchOptions } from "../tools/fetchProxyOptions"; +import { is } from "tsafe/is"; export type BuildContext = { themeVersion: string; @@ -277,7 +278,8 @@ export function getBuildContext(params: { "21-and-below": z.union([z.boolean(), z.string()]), "23": z.union([z.boolean(), z.string()]), "24": z.union([z.boolean(), z.string()]), - "25-and-above": z.union([z.boolean(), z.string()]) + "25": z.union([z.boolean(), z.string()]), + "26-and-above": z.union([z.boolean(), z.string()]) }) .optional() }); @@ -298,8 +300,8 @@ export function getBuildContext(params: { ]), keycloakVersionTargets: z .object({ - "21-and-below": z.union([z.boolean(), z.string()]), - "22-and-above": z.union([z.boolean(), z.string()]) + "22-to-25": z.union([z.boolean(), z.string()]), + "all-other-versions": z.union([z.boolean(), z.string()]) }) .optional() }); @@ -749,7 +751,11 @@ export function getBuildContext(params: { return "24" as const; } - return "25-and-above" as const; + if (buildForKeycloakMajorVersionNumber === 25) { + return "25" as const; + } + + return "26-and-above" as const; })(); assert< @@ -762,11 +768,14 @@ export function getBuildContext(params: { return keycloakVersionRange; } else { const keycloakVersionRange = (() => { - if (buildForKeycloakMajorVersionNumber <= 21) { - return "21-and-below" as const; + if ( + buildForKeycloakMajorVersionNumber <= 21 || + buildForKeycloakMajorVersionNumber >= 26 + ) { + return "all-other-versions" as const; } - return "22-and-above" as const; + return "22-to-25" as const; })(); assert< @@ -784,6 +793,12 @@ export function getBuildContext(params: { use_custom_jar_basename: { const { keycloakVersionTargets } = buildOptions; + assert( + is>( + keycloakVersionTargets + ) + ); + if (keycloakVersionTargets === undefined) { break use_custom_jar_basename; } @@ -828,7 +843,8 @@ export function getBuildContext(params: { "21-and-below", "23", "24", - "25-and-above" + "25", + "26-and-above" ] as const) { assert< Equals< @@ -844,8 +860,8 @@ export function getBuildContext(params: { } } else { for (const keycloakVersionRange of [ - "21-and-below", - "22-and-above" + "22-to-25", + "all-other-versions" ] as const) { assert< Equals< @@ -871,7 +887,17 @@ export function getBuildContext(params: { const jarTargets: BuildContext["jarTargets"] = []; for (const [keycloakVersionRange, jarNameOrBoolean] of objectEntries( - buildOptions.keycloakVersionTargets + (() => { + const { keycloakVersionTargets } = buildOptions; + + assert( + is>( + keycloakVersionTargets + ) + ); + + return keycloakVersionTargets; + })() )) { if (jarNameOrBoolean === false) { continue;