Compare commits

...

8 Commits
main ... v10

Author SHA1 Message Date
Joseph Garrone
dee3f6a132 Fix CI 2024-10-05 06:28:04 +02:00
Joseph Garrone
324eec0cdd Fix tag name 2024-10-05 06:26:35 +02:00
Joseph Garrone
3d8bd5e292 Bump version 2024-10-05 06:06:45 +02:00
Joseph Garrone
c473a5e80a Keycloak v26 support for Keycloakify 10 2024-10-05 06:06:30 +02:00
Joseph Garrone
645503119b Bump version 2024-09-30 11:47:15 +02:00
Joseph Garrone
804ef8cec6 Fix allegated vulnerability 2024-09-30 11:46:56 +02:00
Joseph Garrone
85954be93d Prevent publishing on storybook 2024-09-23 04:35:00 +02:00
Joseph Garrone
9a03f37fe3 Make it possible to publish backward compat paches 2024-09-23 04:29:24 +02:00
6 changed files with 68 additions and 37 deletions

View File

@ -3,6 +3,7 @@ on:
push: push:
branches: branches:
- main - main
- v10
pull_request: pull_request:
branches: branches:
- main - main
@ -35,21 +36,21 @@ jobs:
- run: npm run build - run: npm run build
- run: npm run test - run: npm run test
storybook: #storybook:
runs-on: ubuntu-latest # runs-on: ubuntu-latest
if: github.event_name == 'push' # if: github.event_name == 'push'
needs: test # needs: test
steps: # steps:
- uses: actions/checkout@v4 # - uses: actions/checkout@v4
- uses: actions/setup-node@v4 # - uses: actions/setup-node@v4
with: # with:
node-version: '18' # node-version: '18'
- uses: bahmutov/npm-install@v1 # - uses: bahmutov/npm-install@v1
- run: npm run build-storybook # - run: npm run build-storybook
- run: git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git # - run: git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${{github.repository}}.git
env: # env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npx -y -p gh-pages@3.1.0 gh-pages -d ./storybook-static -u "github-actions-bot <actions@github.com>" # - run: npx -y -p gh-pages@3.1.0 gh-pages -d ./storybook-static -u "github-actions-bot <actions@github.com>"
check_if_version_upgraded: check_if_version_upgraded:
name: Check if version upgrade name: Check if version upgrade
@ -95,6 +96,7 @@ jobs:
generate_release_notes: true generate_release_notes: true
draft: false draft: false
prerelease: ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }} prerelease: ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }}
make_latest: false
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -128,10 +130,7 @@ jobs:
echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets" echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
false false
fi fi
EXTRA_ARGS="" EXTRA_ARGS="--tag keycloakify_v10"
if [ "$IS_PRE_RELEASE" = "true" ]; then
EXTRA_ARGS="--tag next"
fi
npm publish $EXTRA_ARGS npm publish $EXTRA_ARGS
env: env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

View File

@ -1,6 +1,6 @@
{ {
"name": "keycloakify", "name": "keycloakify",
"version": "10.1.4", "version": "10.1.6",
"description": "Create Keycloak themes using React", "description": "Create Keycloak themes using React",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -52,9 +52,9 @@ export function getKeycloakVersionRangeForJar(params: {
case "0.6": case "0.6":
switch (keycloakThemeAdditionalInfoExtensionVersion) { switch (keycloakThemeAdditionalInfoExtensionVersion) {
case null: case null:
return undefined; return "26-and-above" as const;
case "1.1.5": case "1.1.5":
return "25-and-above" as const; return "25" as const;
} }
} }
assert<Equals<typeof keycloakAccountV1Version, never>>(false); assert<Equals<typeof keycloakAccountV1Version, never>>(false);
@ -75,9 +75,9 @@ export function getKeycloakVersionRangeForJar(params: {
} }
switch (keycloakThemeAdditionalInfoExtensionVersion) { switch (keycloakThemeAdditionalInfoExtensionVersion) {
case null: case null:
return "21-and-below"; return "all-other-versions";
case "1.1.5": case "1.1.5":
return "22-and-above"; return "22-to-25";
} }
assert<Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>>( assert<Equals<typeof keycloakThemeAdditionalInfoExtensionVersion, never>>(
false false

View File

@ -166,6 +166,9 @@ function decodeHtmlEntities(htmlStr){
) || ( ) || (
["masterAdminClient", "delegateForUpdate", "defaultRole"]?seq_contains(key) && ["masterAdminClient", "delegateForUpdate", "defaultRole"]?seq_contains(key) &&
areSamePath(path, ["realm"]) areSamePath(path, ["realm"])
) || (
"smtpConfig" == key &&
are_same_path(path, ["realm"])
) || ( ) || (
xKeycloakify.pageId == "error.ftl" && xKeycloakify.pageId == "error.ftl" &&
areSamePath(path, ["realm"]) && areSamePath(path, ["realm"]) &&
@ -233,6 +236,9 @@ function decodeHtmlEntities(htmlStr){
"identityFederationEnabled", "identityFederationEnabled",
"userManagedAccessAllowed" "userManagedAccessAllowed"
]?seq_contains(key) ]?seq_contains(key)
) || (
["flowContext", "session", "realm"]?seq_contains(key) &&
areSamePath(path, ["social"])
) )
> >
<#-- <#local outSeq += ["/*" + path?join(".") + "." + key + " excluded*/"]> --> <#-- <#local outSeq += ["/*" + path?join(".") + "." + key + " excluded*/"]> -->

View File

@ -3,7 +3,7 @@ export type KeycloakVersionRange =
| KeycloakVersionRange.WithoutAccountV1Theme; | KeycloakVersionRange.WithoutAccountV1Theme;
export namespace KeycloakVersionRange { 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";
} }

View File

@ -25,6 +25,7 @@ import { type ThemeType } from "./constants";
import { id } from "tsafe/id"; import { id } from "tsafe/id";
import chalk from "chalk"; import chalk from "chalk";
import { getProxyFetchOptions, type ProxyFetchOptions } from "../tools/fetchProxyOptions"; import { getProxyFetchOptions, type ProxyFetchOptions } from "../tools/fetchProxyOptions";
import { is } from "tsafe/is";
export type BuildContext = { export type BuildContext = {
themeVersion: string; themeVersion: string;
@ -277,7 +278,8 @@ export function getBuildContext(params: {
"21-and-below": z.union([z.boolean(), z.string()]), "21-and-below": z.union([z.boolean(), z.string()]),
"23": z.union([z.boolean(), z.string()]), "23": z.union([z.boolean(), z.string()]),
"24": 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() .optional()
}); });
@ -298,8 +300,8 @@ export function getBuildContext(params: {
]), ]),
keycloakVersionTargets: z keycloakVersionTargets: z
.object({ .object({
"21-and-below": z.union([z.boolean(), z.string()]), "22-to-25": z.union([z.boolean(), z.string()]),
"22-and-above": z.union([z.boolean(), z.string()]) "all-other-versions": z.union([z.boolean(), z.string()])
}) })
.optional() .optional()
}); });
@ -749,7 +751,11 @@ export function getBuildContext(params: {
return "24" as const; return "24" as const;
} }
return "25-and-above" as const; if (buildForKeycloakMajorVersionNumber === 25) {
return "25" as const;
}
return "26-and-above" as const;
})(); })();
assert< assert<
@ -762,11 +768,14 @@ export function getBuildContext(params: {
return keycloakVersionRange; return keycloakVersionRange;
} else { } else {
const keycloakVersionRange = (() => { const keycloakVersionRange = (() => {
if (buildForKeycloakMajorVersionNumber <= 21) { if (
return "21-and-below" as const; buildForKeycloakMajorVersionNumber <= 21 ||
buildForKeycloakMajorVersionNumber >= 26
) {
return "all-other-versions" as const;
} }
return "22-and-above" as const; return "22-to-25" as const;
})(); })();
assert< assert<
@ -784,6 +793,12 @@ export function getBuildContext(params: {
use_custom_jar_basename: { use_custom_jar_basename: {
const { keycloakVersionTargets } = buildOptions; const { keycloakVersionTargets } = buildOptions;
assert(
is<Record<KeycloakVersionRange, string | boolean>>(
keycloakVersionTargets
)
);
if (keycloakVersionTargets === undefined) { if (keycloakVersionTargets === undefined) {
break use_custom_jar_basename; break use_custom_jar_basename;
} }
@ -828,7 +843,8 @@ export function getBuildContext(params: {
"21-and-below", "21-and-below",
"23", "23",
"24", "24",
"25-and-above" "25",
"26-and-above"
] as const) { ] as const) {
assert< assert<
Equals< Equals<
@ -844,8 +860,8 @@ export function getBuildContext(params: {
} }
} else { } else {
for (const keycloakVersionRange of [ for (const keycloakVersionRange of [
"21-and-below", "22-to-25",
"22-and-above" "all-other-versions"
] as const) { ] as const) {
assert< assert<
Equals< Equals<
@ -871,7 +887,17 @@ export function getBuildContext(params: {
const jarTargets: BuildContext["jarTargets"] = []; const jarTargets: BuildContext["jarTargets"] = [];
for (const [keycloakVersionRange, jarNameOrBoolean] of objectEntries( for (const [keycloakVersionRange, jarNameOrBoolean] of objectEntries(
buildOptions.keycloakVersionTargets (() => {
const { keycloakVersionTargets } = buildOptions;
assert(
is<Record<KeycloakVersionRange, string | boolean>>(
keycloakVersionTargets
)
);
return keycloakVersionTargets;
})()
)) { )) {
if (jarNameOrBoolean === false) { if (jarNameOrBoolean === false) {
continue; continue;