Added missing field (#2369)
This commit is contained in:
parent
1c82de5672
commit
be2d7e268e
3 changed files with 62 additions and 26 deletions
|
@ -1,41 +1,74 @@
|
||||||
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("subject")}
|
<FormGroup
|
||||||
fieldId="kc-subject"
|
label={t("allowRegexComparison")}
|
||||||
labelIcon={
|
labelIcon={
|
||||||
<HelpItem
|
<HelpItem
|
||||||
helpText="clients-help:subject"
|
helpText="clients-help:allowRegexComparison"
|
||||||
fieldLabelId="clients:subject"
|
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>
|
||||||
helperTextInvalid={t("common:required")}
|
<FormGroup
|
||||||
validated={
|
label={t("subject")}
|
||||||
errors.attributes?.["x509.subjectdn"]
|
fieldId="kc-subject"
|
||||||
? ValidatedOptions.error
|
labelIcon={
|
||||||
: ValidatedOptions.default
|
<HelpItem
|
||||||
}
|
helpText="clients-help:subject"
|
||||||
isRequired
|
fieldLabelId="clients:subject"
|
||||||
>
|
/>
|
||||||
<TextInput
|
}
|
||||||
ref={register({ required: true })}
|
helperTextInvalid={t("common:required")}
|
||||||
type="text"
|
|
||||||
id="kc-subject"
|
|
||||||
name="attributes.x509.subjectdn"
|
|
||||||
validated={
|
validated={
|
||||||
errors.attributes?.["x509.subjectdn"]
|
errors.attributes?.["x509.subjectdn"]
|
||||||
? ValidatedOptions.error
|
? ValidatedOptions.error
|
||||||
: ValidatedOptions.default
|
: ValidatedOptions.default
|
||||||
}
|
}
|
||||||
/>
|
isRequired
|
||||||
</FormGroup>
|
>
|
||||||
|
<TextInput
|
||||||
|
ref={register({ required: true })}
|
||||||
|
type="text"
|
||||||
|
id="kc-subject"
|
||||||
|
name="attributes.x509.subjectdn"
|
||||||
|
validated={
|
||||||
|
errors.attributes?.["x509.subjectdn"]
|
||||||
|
? ValidatedOptions.error
|
||||||
|
: ValidatedOptions.default
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in a new issue