Add componentId to LDAP provider test connection/authorization (#2038)

* add componentId to test calls and fix help ids

* rm ID default
This commit is contained in:
mfrances17 2022-02-17 09:43:52 -05:00 committed by GitHub
parent 6427a15d1b
commit e8e64798ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 59 additions and 56 deletions

View file

@ -95,8 +95,8 @@ export default function CustomProviderSettings() {
label={t("consoleDisplayName")} label={t("consoleDisplayName")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:consoleDisplayNameHelp" helpText="user-federation-help:consoleDisplayNameHelp"
fieldLabelId="users-federation:consoleDisplayName" fieldLabelId="user-federation:consoleDisplayName"
/> />
} }
helperTextInvalid={t("validateName")} helperTextInvalid={t("validateName")}

View file

@ -64,8 +64,8 @@ export const KerberosSettingsRequired = ({
label={t("consoleDisplayName")} label={t("consoleDisplayName")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:consoleDisplayNameHelp" helpText="user-federation-help:consoleDisplayNameHelp"
fieldLabelId="users-federation:consoleDisplayName" fieldLabelId="user-federation:consoleDisplayName"
/> />
} }
fieldId="kc-console-display-name" fieldId="kc-console-display-name"
@ -119,8 +119,8 @@ export const KerberosSettingsRequired = ({
label={t("kerberosRealm")} label={t("kerberosRealm")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:kerberosRealmHelp" helpText="user-federation-help:kerberosRealmHelp"
fieldLabelId="users-federation:kc-kerberos-realm" fieldLabelId="user-federation:kc-kerberos-realm"
/> />
} }
fieldId="kc-kerberos-realm" fieldId="kc-kerberos-realm"
@ -150,8 +150,8 @@ export const KerberosSettingsRequired = ({
label={t("serverPrincipal")} label={t("serverPrincipal")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:serverPrincipalHelp" helpText="user-federation-help:serverPrincipalHelp"
fieldLabelId="users-federation:serverPrincipal" fieldLabelId="user-federation:serverPrincipal"
/> />
} }
fieldId="kc-server-principal" fieldId="kc-server-principal"
@ -181,8 +181,8 @@ export const KerberosSettingsRequired = ({
label={t("keyTab")} label={t("keyTab")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:keyTabHelp" helpText="user-federation-help:keyTabHelp"
fieldLabelId="users-federation:keyTab" fieldLabelId="user-federation:keyTab"
/> />
} }
fieldId="kc-key-tab" fieldId="kc-key-tab"
@ -210,8 +210,8 @@ export const KerberosSettingsRequired = ({
label={t("debug")} label={t("debug")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:debugHelp" helpText="user-federation-help:debugHelp"
fieldLabelId="users-federation:debug" fieldLabelId="user-federation:debug"
/> />
} }
fieldId="kc-debug" fieldId="kc-debug"
@ -238,8 +238,8 @@ export const KerberosSettingsRequired = ({
label={t("allowPasswordAuthentication")} label={t("allowPasswordAuthentication")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:allowPasswordAuthenticationHelp" helpText="user-federation-help:allowPasswordAuthenticationHelp"
fieldLabelId="users-federation:allowPasswordAuthentication" fieldLabelId="user-federation:allowPasswordAuthentication"
/> />
} }
fieldId="kc-allow-password-authentication" fieldId="kc-allow-password-authentication"
@ -266,8 +266,8 @@ export const KerberosSettingsRequired = ({
label={t("editMode")} label={t("editMode")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:editModeKerberosHelp" helpText="user-federation-help:editModeKerberosHelp"
fieldLabelId="users-federation:editMode" fieldLabelId="user-federation:editMode"
/> />
} }
isRequired isRequired
@ -306,8 +306,8 @@ export const KerberosSettingsRequired = ({
label={t("updateFirstLogin")} label={t("updateFirstLogin")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:updateFirstLoginHelp" helpText="user-federation-help:updateFirstLoginHelp"
fieldLabelId="users-federation:updateFirstLogin" fieldLabelId="user-federation:updateFirstLogin"
/> />
} }
fieldId="kc-update-first-login" fieldId="kc-update-first-login"

View file

@ -35,8 +35,8 @@ export const LdapSettingsAdvanced = ({
label={t("enableLdapv3Password")} label={t("enableLdapv3Password")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:enableLdapv3PasswordHelp" helpText="user-federation-help:enableLdapv3PasswordHelp"
fieldLabelId="users-federation:enableLdapv3Password" fieldLabelId="user-federation:enableLdapv3Password"
/> />
} }
fieldId="kc-enable-ldapv3-password" fieldId="kc-enable-ldapv3-password"
@ -63,8 +63,8 @@ export const LdapSettingsAdvanced = ({
label={t("validatePasswordPolicy")} label={t("validatePasswordPolicy")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:validatePasswordPolicyHelp" helpText="user-federation-help:validatePasswordPolicyHelp"
fieldLabelId="users-federation:validatePasswordPolicy" fieldLabelId="user-federation:validatePasswordPolicy"
/> />
} }
fieldId="kc-validate-password-policy" fieldId="kc-validate-password-policy"
@ -91,8 +91,8 @@ export const LdapSettingsAdvanced = ({
label={t("trustEmail")} label={t("trustEmail")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:trustEmailHelp" helpText="user-federation-help:trustEmailHelp"
fieldLabelId="users-federation:trustEmail" fieldLabelId="user-federation:trustEmail"
/> />
} }
fieldId="kc-trust-email" fieldId="kc-trust-email"

View file

@ -50,6 +50,8 @@ const convertFormToSettings = (form: UseFormMethods) => {
settings[key] = Array.isArray(value) ? value[0] : ""; settings[key] = Array.isArray(value) ? value[0] : "";
}); });
settings["componentId"] = get(form.getValues(), "id");
return settings; return settings;
}; };
@ -105,8 +107,8 @@ export const LdapSettingsConnection = ({
label={t("connectionURL")} label={t("connectionURL")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:consoleDisplayConnectionUrlHelp" helpText="user-federation-help:consoleDisplayConnectionUrlHelp"
fieldLabelId="users-federation:connectionURL" fieldLabelId="user-federation:connectionURL"
/> />
} }
fieldId="kc-console-connection-url" fieldId="kc-console-connection-url"
@ -135,8 +137,8 @@ export const LdapSettingsConnection = ({
label={t("enableStartTls")} label={t("enableStartTls")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:enableStartTlsHelp" helpText="user-federation-help:enableStartTlsHelp"
fieldLabelId="users-federation:enableStartTls" fieldLabelId="user-federation:enableStartTls"
/> />
} }
fieldId="kc-enable-start-tls" fieldId="kc-enable-start-tls"
@ -163,8 +165,8 @@ export const LdapSettingsConnection = ({
label={t("useTruststoreSpi")} label={t("useTruststoreSpi")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:useTruststoreSpiHelp" helpText="user-federation-help:useTruststoreSpiHelp"
fieldLabelId="users-federation:useTruststoreSpi" fieldLabelId="user-federation:useTruststoreSpi"
/> />
} }
fieldId="kc-use-truststore-spi" fieldId="kc-use-truststore-spi"
@ -197,8 +199,8 @@ export const LdapSettingsConnection = ({
label={t("connectionPooling")} label={t("connectionPooling")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:connectionPoolingHelp" helpText="user-federation-help:connectionPoolingHelp"
fieldLabelId="users-federation:connectionPooling" fieldLabelId="user-federation:connectionPooling"
/> />
} }
fieldId="kc-connection-pooling" fieldId="kc-connection-pooling"
@ -224,8 +226,8 @@ export const LdapSettingsConnection = ({
label={t("connectionTimeout")} label={t("connectionTimeout")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:connectionTimeoutHelp" helpText="user-federation-help:connectionTimeoutHelp"
fieldLabelId="users-federation:consoleTimeout" fieldLabelId="user-federation:consoleTimeout"
/> />
} }
fieldId="kc-console-connection-timeout" fieldId="kc-console-connection-timeout"
@ -251,8 +253,8 @@ export const LdapSettingsConnection = ({
label={t("bindType")} label={t("bindType")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:bindTypeHelp" helpText="user-federation-help:bindTypeHelp"
fieldLabelId="users-federation:bindType" fieldLabelId="user-federation:bindType"
/> />
} }
fieldId="kc-bind-type" fieldId="kc-bind-type"
@ -291,8 +293,8 @@ export const LdapSettingsConnection = ({
label={t("bindDn")} label={t("bindDn")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:bindDnHelp" helpText="user-federation-help:bindDnHelp"
fieldLabelId="users-federation:bindDn" fieldLabelId="user-federation:bindDn"
/> />
} }
fieldId="kc-console-bind-dn" fieldId="kc-console-bind-dn"
@ -316,8 +318,8 @@ export const LdapSettingsConnection = ({
label={t("bindCredentials")} label={t("bindCredentials")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:bindCredentialsHelp" helpText="user-federation-help:bindCredentialsHelp"
fieldLabelId="users-federation:bindCredentials" fieldLabelId="user-federation:bindCredentials"
/> />
} }
fieldId="kc-console-bind-credentials" fieldId="kc-console-bind-credentials"

View file

@ -107,14 +107,15 @@ export const LdapSettingsGeneral = ({
label={t("consoleDisplayName")} label={t("consoleDisplayName")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:consoleDisplayNameHelp" helpText="user-federation-help:consoleDisplayNameHelp"
fieldLabelId="users-federation:consoleDisplayName" fieldLabelId="user-federation:consoleDisplayName"
/> />
} }
fieldId="kc-console-display-name" fieldId="kc-console-display-name"
isRequired isRequired
> >
{/* These hidden fields are required so data object written back matches data retrieved */} {/* These hidden fields are required so data object written back matches data retrieved */}
<TextInput hidden type="text" id="kc-console-id" name="id" />
<TextInput <TextInput
hidden hidden
type="text" type="text"
@ -161,8 +162,8 @@ export const LdapSettingsGeneral = ({
label={t("vendor")} label={t("vendor")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:vendorHelp" helpText="user-federation-help:vendorHelp"
fieldLabelId="users-federation:vendor" fieldLabelId="user-federation:vendor"
/> />
} }
fieldId="kc-vendor" fieldId="kc-vendor"

View file

@ -41,8 +41,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("allowKerberosAuthentication")} label={t("allowKerberosAuthentication")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:allowKerberosAuthenticationHelp" helpText="user-federation-help:allowKerberosAuthenticationHelp"
fieldLabelId="users-federation:allowKerberosAuthentication" fieldLabelId="user-federation:allowKerberosAuthentication"
/> />
} }
fieldId="kc-allow-kerberos-authentication" fieldId="kc-allow-kerberos-authentication"
@ -71,8 +71,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("kerberosRealm")} label={t("kerberosRealm")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:kerberosRealmHelp" helpText="user-federation-help:kerberosRealmHelp"
fieldLabelId="users-federation:kerberosRealm" fieldLabelId="user-federation:kerberosRealm"
/> />
} }
fieldId="kc-kerberos-realm" fieldId="kc-kerberos-realm"
@ -102,8 +102,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("serverPrincipal")} label={t("serverPrincipal")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:serverPrincipalHelp" helpText="user-federation-help:serverPrincipalHelp"
fieldLabelId="users-federation:serverPrincipal" fieldLabelId="user-federation:serverPrincipal"
/> />
} }
fieldId="kc-server-principal" fieldId="kc-server-principal"
@ -133,8 +133,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("keyTab")} label={t("keyTab")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:keyTabHelp" helpText="user-federation-help:keyTabHelp"
fieldLabelId="users-federation:keyTab" fieldLabelId="user-federation:keyTab"
/> />
} }
fieldId="kc-key-tab" fieldId="kc-key-tab"
@ -164,8 +164,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("debug")} label={t("debug")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:debugHelp" helpText="user-federation-help:debugHelp"
fieldLabelId="users-federation:debug" fieldLabelId="user-federation:debug"
/> />
} }
fieldId="kc-debug" fieldId="kc-debug"
@ -194,8 +194,8 @@ export const LdapSettingsKerberosIntegration = ({
label={t("useKerberosForPasswordAuthentication")} label={t("useKerberosForPasswordAuthentication")}
labelIcon={ labelIcon={
<HelpItem <HelpItem
helpText="users-federation-help:useKerberosForPasswordAuthenticationHelp" helpText="user-federation-help:useKerberosForPasswordAuthenticationHelp"
fieldLabelId="users-federation:useKerberosForPasswordAuthentication" fieldLabelId="user-federation:useKerberosForPasswordAuthentication"
/> />
} }
fieldId="kc-use-kerberos-password-authentication" fieldId="kc-use-kerberos-password-authentication"