Added missing field (#2369)

This commit is contained in:
Erik Jan de Wit 2022-03-30 11:23:04 +02:00 committed by GitHub
parent 1c82de5672
commit be2d7e268e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 26 deletions

View file

@ -1,13 +1,45 @@
import React from "react"; import React from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { useFormContext } from "react-hook-form"; import { Controller, useFormContext } from "react-hook-form";
import { FormGroup, TextInput, ValidatedOptions } from "@patternfly/react-core"; import {
FormGroup,
Switch,
TextInput,
ValidatedOptions,
} from "@patternfly/react-core";
import { HelpItem } from "../../components/help-enabler/HelpItem"; import { HelpItem } from "../../components/help-enabler/HelpItem";
export const X509 = () => { export const X509 = () => {
const { t } = useTranslation("clients"); const { t } = useTranslation("clients");
const { register, errors } = useFormContext(); const { register, control, errors } = useFormContext();
return ( return (
<>
<FormGroup
label={t("allowRegexComparison")}
labelIcon={
<HelpItem
helpText="clients-help:allowRegexComparison"
fieldLabelId="clients:allowRegexComparison"
/>
}
fieldId="allowRegexComparison"
hasNoPaddingTop
>
<Controller
name="attributes.x509.allow.regex.pattern.comparison"
defaultValue="false"
control={control}
render={({ onChange, value }) => (
<Switch
id="allowRegexComparison"
label={t("common:on")}
labelOff={t("common:off")}
isChecked={value === "true"}
onChange={(value) => onChange(value.toString())}
/>
)}
/>
</FormGroup>
<FormGroup <FormGroup
label={t("subject")} label={t("subject")}
fieldId="kc-subject" fieldId="kc-subject"
@ -37,5 +69,6 @@ export const X509 = () => {
} }
/> />
</FormGroup> </FormGroup>
</>
); );
}; };

View file

@ -92,6 +92,8 @@ export default {
"The registration access token provides access for clients to the client registration service.", "The registration access token provides access for clients to the client registration service.",
"signature-algorithm": "signature-algorithm":
"JWA algorithm, which the client needs to use when signing a JWT for authentication. If left blank, the client is allowed to use any algorithm.", "JWA algorithm, which the client needs to use when signing a JWT for authentication. If left blank, the client is allowed to use any algorithm.",
allowRegexComparison:
"If OFF, then the Subject DN from given client certificate must exactly match the given DN from the 'Subject DN' property as described in the RFC8705 specification. The Subject DN can be in the RFC2553 or RFC1779 format. If ON, then the Subject DN from given client certificate should match regex specified by 'Subject DN' property.",
subject: subject:
'A regular expression for validating Subject DN in the Client Certificate. Use "(.*?)(?:$)" to match all kind of expressions.', 'A regular expression for validating Subject DN in the Client Certificate. Use "(.*?)(?:$)" to match all kind of expressions.',
evaluateExplain: evaluateExplain:

View file

@ -442,6 +442,7 @@ export default {
accessTokenSuccess: "Access token regenerated", accessTokenSuccess: "Access token regenerated",
accessTokenError: "Could not regenerate access token due to: {{error}}", accessTokenError: "Could not regenerate access token due to: {{error}}",
signatureAlgorithm: "Signature algorithm", signatureAlgorithm: "Signature algorithm",
allowRegexComparison: "Allow regex pattern comparison",
subject: "Subject DN", subject: "Subject DN",
searchForClient: "Search for client", searchForClient: "Search for client",
advanced: "Advanced", advanced: "Advanced",