Skip to content

Commit 010bf10

Browse files
committed
Bump verions to 26.3.4
1 parent 410fcbb commit 010bf10

File tree

103 files changed

+15314
-2444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+15314
-2444
lines changed

dist/keycloak-theme/admin/authentication/FlowDetails.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,10 @@ export default function FlowDetails() {
300300
>
301301
{t("editInfo")}
302302
</DropdownItem>,
303+
]
304+
: []),
305+
...(!builtIn && !usedBy
306+
? [
303307
<DropdownItem
304308
data-testid="delete-flow"
305309
key="delete"

dist/keycloak-theme/admin/authentication/components/RequiredActionConfigModal.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
import RequiredActionConfigInfoRepresentation from "@keycloak/keycloak-admin-client/lib/defs/requiredActionConfigInfoRepresentation";
66
import RequiredActionConfigRepresentation from "@keycloak/keycloak-admin-client/lib/defs/requiredActionConfigRepresentation";
77
import type RequiredActionProviderRepresentation from "@keycloak/keycloak-admin-client/lib/defs/requiredActionProviderRepresentation";
8-
import { useAlerts, useFetch } from "../../../shared/keycloak-ui-shared";
8+
import {
9+
isUserProfileError,
10+
setUserProfileServerError,
11+
useAlerts,
12+
useFetch,
13+
} from "../../../shared/keycloak-ui-shared";
914
import {
1015
ActionGroup,
1116
AlertVariant,
@@ -94,7 +99,19 @@ export const RequiredActionConfigModal = ({
9499
addAlert(t("configSaveSuccess"), AlertVariant.success);
95100
onClose();
96101
} catch (error) {
97-
addError("configSaveError", error);
102+
if (isUserProfileError(error)) {
103+
setUserProfileServerError(
104+
error,
105+
(name: string | number, error: unknown) => {
106+
// TODO: Does not set set the error message to the field, yet.
107+
// Still, this will do all front end replacement and translation of keys.
108+
addError("configSaveError", (error as any).message);
109+
},
110+
t,
111+
);
112+
} else {
113+
addError("configSaveError", error);
114+
}
98115
}
99116
};
100117

dist/keycloak-theme/admin/authentication/policies/OtpPolicy.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,19 @@ export const OtpPolicy = ({ realm, realmUpdated }: OtpPolicyProps) => {
5050
const { adminClient } = useAdminClient();
5151

5252
const { t } = useTranslation();
53-
const form = useForm<FormFields>({ mode: "onChange" });
53+
const form = useForm<FormFields>({
54+
mode: "onChange",
55+
defaultValues: {
56+
otpPolicyType: realm.otpPolicyType ?? POLICY_TYPES[0],
57+
otpPolicyAlgorithm:
58+
realm.otpPolicyAlgorithm ?? `Hmac${OTP_HASH_ALGORITHMS[0]}`,
59+
otpPolicyDigits: realm.otpPolicyDigits ?? NUMBER_OF_DIGITS[0],
60+
otpPolicyLookAheadWindow: realm.otpPolicyLookAheadWindow ?? 1,
61+
otpPolicyPeriod: realm.otpPolicyPeriod ?? 30,
62+
otpPolicyInitialCounter: realm.otpPolicyInitialCounter ?? 30,
63+
otpPolicyCodeReusable: realm.otpPolicyCodeReusable ?? false,
64+
},
65+
});
5466
const {
5567
control,
5668
reset,
@@ -61,11 +73,7 @@ export const OtpPolicy = ({ realm, realmUpdated }: OtpPolicyProps) => {
6173
const { addAlert, addError } = useAlerts();
6274
const localeSort = useLocaleSort();
6375

64-
const otpType = useWatch({
65-
name: "otpPolicyType",
66-
control,
67-
defaultValue: POLICY_TYPES[0],
68-
});
76+
const otpType = useWatch({ name: "otpPolicyType", control });
6977

7078
const setupForm = (formValues: FormFields) => reset(formValues);
7179

@@ -112,16 +120,16 @@ export const OtpPolicy = ({ realm, realmUpdated }: OtpPolicyProps) => {
112120
data-testid="otpPolicyType"
113121
defaultValue={POLICY_TYPES[0]}
114122
control={control}
115-
render={({ field }) => (
123+
render={({ field: { value, onChange } }) => (
116124
<>
117125
{POLICY_TYPES.map((type) => (
118126
<Radio
119127
key={type}
120128
id={type}
121129
data-testid={type}
122-
isChecked={field.value === type}
130+
isChecked={value === type}
123131
name="otpPolicyType"
124-
onChange={() => field.onChange(type)}
132+
onChange={() => onChange(type)}
125133
label={t(`policyType.${type}`)}
126134
className="keycloak__otp_policies_authentication__policy-type"
127135
/>

dist/keycloak-theme/admin/authentication/policies/PasswordPolicy.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export const PasswordPolicy = ({
101101
const { passwordPolicies } = useServerInfo();
102102

103103
const { addAlert, addError } = useAlerts();
104-
const { realm: realmName } = useRealm();
104+
const { realm: realmName, refresh } = useRealm();
105105

106106
const [rows, setRows] = useState<PasswordPolicyTypeRepresentation[]>([]);
107107
const onSelect = (row: PasswordPolicyTypeRepresentation) => {
@@ -139,6 +139,7 @@ export const PasswordPolicy = ({
139139
await adminClient.realms.update({ realm: realmName }, updatedRealm);
140140
realmUpdated(updatedRealm);
141141
setupForm(updatedRealm);
142+
refresh();
142143
addAlert(t("updatePasswordPolicySuccess"), AlertVariant.success);
143144
} catch (error: any) {
144145
addError("updatePasswordPolicyError", error);

dist/keycloak-theme/admin/authentication/policies/Policies.tsx

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
// @ts-nocheck
44

5-
import type RealmRepresentation from "@keycloak/keycloak-admin-client/lib/defs/realmRepresentation";
6-
import { useFetch } from "../../../shared/keycloak-ui-shared";
75
import { Tab, Tabs, TabTitleText } from "../../../shared/@patternfly/react-core";
86
import { useState } from "react";
97
import { useTranslation } from "react-i18next";
10-
import { useAdminClient } from "../../admin-client";
118
import { KeycloakSpinner } from "../../../shared/keycloak-ui-shared";
129
import { useRealm } from "../../context/realm-context/RealmContext";
1310
import { CibaPolicy } from "./CibaPolicy";
@@ -16,26 +13,9 @@ import { PasswordPolicy } from "./PasswordPolicy";
1613
import { WebauthnPolicy } from "./WebauthnPolicy";
1714

1815
export const Policies = () => {
19-
const { adminClient } = useAdminClient();
20-
2116
const { t } = useTranslation();
2217
const [subTab, setSubTab] = useState(1);
23-
const { realm: realmName } = useRealm();
24-
const [realm, setRealm] = useState<RealmRepresentation>();
25-
26-
useFetch(
27-
async () => {
28-
const realm = await adminClient.realms.findOne({ realm: realmName });
29-
if (!realm) {
30-
throw new Error(t("notFound"));
31-
}
32-
return realm;
33-
},
34-
(realm) => {
35-
setRealm(realm);
36-
},
37-
[],
38-
);
18+
const { realmRepresentation: realm, refresh } = useRealm();
3919

4020
if (!realm) {
4121
return <KeycloakSpinner />;
@@ -54,38 +34,38 @@ export const Policies = () => {
5434
eventKey={1}
5535
title={<TabTitleText>{t("passwordPolicy")}</TabTitleText>}
5636
>
57-
<PasswordPolicy realm={realm} realmUpdated={setRealm} />
37+
<PasswordPolicy realm={realm} realmUpdated={refresh} />
5838
</Tab>
5939
<Tab
6040
id="otpPolicy"
6141
data-testid="otpPolicy"
6242
eventKey={2}
6343
title={<TabTitleText>{t("otpPolicy")}</TabTitleText>}
6444
>
65-
<OtpPolicy realm={realm} realmUpdated={setRealm} />
45+
<OtpPolicy realm={realm} realmUpdated={refresh} />
6646
</Tab>
6747
<Tab
6848
id="webauthnPolicy"
6949
data-testid="webauthnPolicy"
7050
eventKey={3}
7151
title={<TabTitleText>{t("webauthnPolicy")}</TabTitleText>}
7252
>
73-
<WebauthnPolicy realm={realm} realmUpdated={setRealm} />
53+
<WebauthnPolicy realm={realm} realmUpdated={refresh} />
7454
</Tab>
7555
<Tab
7656
id="webauthnPasswordlessPolicy"
7757
data-testid="webauthnPasswordlessPolicy"
7858
eventKey={4}
7959
title={<TabTitleText>{t("webauthnPasswordlessPolicy")}</TabTitleText>}
8060
>
81-
<WebauthnPolicy realm={realm} realmUpdated={setRealm} isPasswordLess />
61+
<WebauthnPolicy realm={realm} realmUpdated={refresh} isPasswordLess />
8262
</Tab>
8363
<Tab
8464
data-testid="tab-ciba-policy"
8565
eventKey={5}
8666
title={<TabTitleText>{t("cibaPolicy")}</TabTitleText>}
8767
>
88-
<CibaPolicy realm={realm} realmUpdated={setRealm} />
68+
<CibaPolicy realm={realm} realmUpdated={refresh} />
8969
</Tab>
9070
</Tabs>
9171
);

dist/keycloak-theme/admin/authentication/policies/WebauthnPolicy.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { MultiLineInput } from "../../components/multi-line-input/MultiLineInput
3131
import { TimeSelectorControl } from "../../components/time-selector/TimeSelectorControl";
3232
import { useRealm } from "../../context/realm-context/RealmContext";
3333
import { convertFormValuesToObject, convertToFormValues } from "../../util";
34+
import useIsFeatureEnabled, { Feature } from "../../utils/useIsFeatureEnabled";
3435

3536
import { useAdminClient } from "../../admin-client";
3637
import "./webauthn-policy.css";
@@ -145,6 +146,8 @@ export const WebauthnPolicy = ({
145146
}
146147
};
147148

149+
const isFeatureEnabled = useIsFeatureEnabled();
150+
148151
return (
149152
<PageSection variant="light">
150153
{enabled && (
@@ -265,6 +268,15 @@ export const WebauthnPolicy = ({
265268
addButtonLabel="addOrigins"
266269
/>
267270
</FormGroup>
271+
{isPasswordLess && isFeatureEnabled(Feature.Passkeys) && (
272+
<SwitchControl
273+
name={`${namePrefix}PasskeysEnabled`}
274+
label={t("webAuthnPolicyPasskeysEnabled")}
275+
labelIcon={t("webAuthnPolicyPasskeysEnabledHelp")}
276+
labelOn={t("on")}
277+
labelOff={t("off")}
278+
/>
279+
)}
268280
</FormProvider>
269281

270282
<ActionGroup>

dist/keycloak-theme/admin/clients/ClientDetails.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ export default function ClientDetails() {
219219
const form = useForm<FormFields>();
220220
const { clientId } = useParams<ClientParams>();
221221
const [key, setKey] = useState(0);
222+
const refresh = () => setKey(key + 1);
222223

223224
const isAdminPermissionsClient = useIsAdminPermissionsClient(clientId);
224225

@@ -469,6 +470,7 @@ export default function ClientDetails() {
469470
<Keys
470471
clientId={clientId}
471472
save={save}
473+
refresh={refresh}
472474
hasConfigureAccess={client.access?.configure}
473475
/>
474476
)}
@@ -491,7 +493,7 @@ export default function ClientDetails() {
491493
key={key}
492494
client={client}
493495
save={save}
494-
refresh={() => setKey(key + 1)}
496+
refresh={refresh}
495497
/>
496498
</Tab>
497499
)}

dist/keycloak-theme/admin/clients/add/CapabilityConfig.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
// @ts-nocheck
44

55
import type ClientRepresentation from "@keycloak/keycloak-admin-client/lib/defs/clientRepresentation";
6+
import { HelpItem, SelectControl } from "../../../shared/keycloak-ui-shared";
67
import {
78
Checkbox,
89
FormGroup,
910
Grid,
1011
GridItem,
1112
InputGroup,
12-
Switch,
1313
InputGroupItem,
14+
Switch,
1415
} from "../../../shared/@patternfly/react-core";
1516
import { Controller, useFormContext } from "react-hook-form";
1617
import { useTranslation } from "react-i18next";
17-
import { HelpItem } from "../../../shared/keycloak-ui-shared";
1818
import { DefaultSwitchControl } from "../../components/SwitchControl";
1919
import { FormAccess } from "../../components/form/FormAccess";
2020
import { convertAttributeNameToForm } from "../../util";
@@ -342,6 +342,20 @@ export const CapabilityConfig = ({
342342
</GridItem>
343343
</Grid>
344344
</FormGroup>
345+
<SelectControl
346+
id="keyForCodeExchange"
347+
label={t("keyForCodeExchange")}
348+
labelIcon={t("keyForCodeExchangeHelp")}
349+
controller={{ defaultValue: "" }}
350+
name={convertAttributeNameToForm<FormFields>(
351+
"attributes.pkce.code.challenge.method",
352+
)}
353+
options={[
354+
{ key: "", value: t("choose") },
355+
{ key: "S256", value: "S256" },
356+
{ key: "plain", value: "plain" },
357+
]}
358+
/>
345359
</>
346360
)}
347361
{protocol === "saml" && (

dist/keycloak-theme/admin/clients/advanced/AdvancedSettings.tsx

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@
33
// @ts-nocheck
44

55
import { HelpItem, TextControl } from "../../../shared/keycloak-ui-shared";
6-
import {
7-
ActionGroup,
8-
Button,
9-
FormGroup,
10-
MenuToggle,
11-
Select,
12-
SelectList,
13-
SelectOption,
14-
} from "../../../shared/@patternfly/react-core";
15-
import { useState } from "react";
6+
import { ActionGroup, Button, FormGroup } from "../../../shared/@patternfly/react-core";
167
import { Controller, useFormContext } from "react-hook-form";
178
import { useTranslation } from "react-i18next";
189
import { DefaultSwitchControl } from "../../components/SwitchControl";
@@ -40,7 +31,6 @@ export const AdvancedSettings = ({
4031
hasConfigureAccess,
4132
}: AdvancedSettingsProps) => {
4233
const { t } = useTranslation();
43-
const [open, setOpen] = useState(false);
4434

4535
const { realmRepresentation: realm } = useRealm();
4636

@@ -148,54 +138,6 @@ export const AdvancedSettings = ({
148138
stringify
149139
/>
150140
)}
151-
<FormGroup
152-
label={t("keyForCodeExchange")}
153-
fieldId="keyForCodeExchange"
154-
hasNoPaddingTop
155-
labelIcon={
156-
<HelpItem
157-
helpText={t("keyForCodeExchangeHelp")}
158-
fieldLabelId="keyForCodeExchange"
159-
/>
160-
}
161-
>
162-
<Controller
163-
name={convertAttributeNameToForm<FormFields>(
164-
"attributes.pkce.code.challenge.method",
165-
)}
166-
defaultValue=""
167-
control={control}
168-
render={({ field }) => (
169-
<Select
170-
toggle={(ref) => (
171-
<MenuToggle
172-
id="keyForCodeExchange"
173-
ref={ref}
174-
onClick={() => setOpen(!open)}
175-
isExpanded={open}
176-
>
177-
{[field.value || t("choose")]}
178-
</MenuToggle>
179-
)}
180-
isOpen={open}
181-
onOpenChange={(isOpen) => setOpen(isOpen)}
182-
onSelect={(_, value) => {
183-
field.onChange(value);
184-
setOpen(false);
185-
}}
186-
selected={field.value}
187-
>
188-
<SelectList>
189-
{["", "S256", "plain"].map((v) => (
190-
<SelectOption key={v} value={v}>
191-
{v || t("choose")}
192-
</SelectOption>
193-
))}
194-
</SelectList>
195-
</Select>
196-
)}
197-
/>
198-
</FormGroup>
199141
<DefaultSwitchControl
200142
name={convertAttributeNameToForm<FormFields>(
201143
"attributes.require.pushed.authorization.requests",

0 commit comments

Comments
 (0)