diff options
author | guillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com> | 2023-08-22 17:15:51 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-08-24 20:03:09 +0000 |
commit | 2d65b0c191d723fdd35523c3fe8ffb362d11ddb9 (patch) | |
tree | cd0c8475473d80265a5427720d785b61247deedf | |
parent | 2cdb77cb6170cce91df7616cae25f8b6b67d04a4 (diff) | |
download | sonarqube-2d65b0c191d723fdd35523c3fe8ffb362d11ddb9.tar.gz sonarqube-2d65b0c191d723fdd35523c3fe8ffb362d11ddb9.zip |
SONAR-20232 Move SAML group attribute to common configuration for SAML
3 files changed, 3 insertions, 27 deletions
diff --git a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlSettings.java b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlSettings.java index 3da572ea2af..2a06c235f85 100644 --- a/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlSettings.java +++ b/server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlSettings.java @@ -189,7 +189,7 @@ public class SamlSettings { PropertyDefinition.builder(GROUP_NAME_ATTRIBUTE) .name("SAML group attribute") .description("Attribute defining the user groups in SAML, used to synchronize group memberships. If you leave this field empty, " + - "group memberships are managed locally by SonarQube administrators.") + "group memberships will not be synced when users log in.") .category(CATEGORY) .subCategory(SUBCATEGORY) .index(10) diff --git a/server/sonar-web/src/main/js/apps/settings/components/authentication/SamlAuthenticationTab.tsx b/server/sonar-web/src/main/js/apps/settings/components/authentication/SamlAuthenticationTab.tsx index edb9349490d..0deaa73e7aa 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/authentication/SamlAuthenticationTab.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/authentication/SamlAuthenticationTab.tsx @@ -36,12 +36,9 @@ import { } from '../../../../queries/identity-provider'; import { useSaveValueMutation } from '../../../../queries/settings'; import { ExtendedSettingDefinition } from '../../../../types/settings'; -import { getPropertyName } from '../../utils'; -import DefinitionDescription from '../DefinitionDescription'; import ConfigurationForm from './ConfigurationForm'; import useSamlConfiguration, { SAML_ENABLED_FIELD, - SAML_GROUP_NAME, SAML_SCIM_DEPRECATED, } from './hook/useSamlConfiguration'; @@ -52,7 +49,7 @@ interface SamlAuthenticationProps { export const SAML = 'saml'; const CONFIG_TEST_PATH = '/saml/validation_init'; -const SAML_EXCLUDED_FIELD = [SAML_ENABLED_FIELD, SAML_GROUP_NAME, SAML_SCIM_DEPRECATED]; +const SAML_EXCLUDED_FIELD = [SAML_ENABLED_FIELD, SAML_SCIM_DEPRECATED]; export default function SamlAuthenticationTab(props: SamlAuthenticationProps) { const { definitions } = props; @@ -253,22 +250,6 @@ export default function SamlAuthenticationTab(props: SamlAuthenticationProps) { <p> {translate('settings.authentication.saml.form.provisioning_at_login.sub')} </p> - {groupValue && ( - <div className="settings-definition"> - <DefinitionDescription definition={groupValue.definition} /> - <div className="settings-definition-right"> - <input - id={groupValue.definition.key} - maxLength={4000} - name={groupValue.definition.key} - onChange={(e) => setNewGroupSetting(e.currentTarget.value)} - type="text" - value={String(groupValue.newValue ?? groupValue.value ?? '')} - aria-label={getPropertyName(groupValue.definition)} - /> - </div> - </div> - )} </RadioCard> </div> ) : ( diff --git a/server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx b/server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx index b61e05b3f86..2a09f47090b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx @@ -92,7 +92,6 @@ const ui = { saveConfigButton: byRole('button', { name: 'settings.almintegration.form.save' }), confirmProvisioningButton: byRole('button', { name: 'yes' }), saveScim: byRole('button', { name: 'save' }), - groupAttribute: byRole('textbox', { name: 'property.sonar.auth.saml.group.name.name' }), enableConfigButton: byRole('button', { name: 'settings.authentication.form.enable' }), disableConfigButton: byRole('button', { name: 'settings.authentication.form.disable' }), editConfigButton: byRole('button', { name: 'settings.authentication.form.edit' }), @@ -309,11 +308,7 @@ describe('SAML tab', () => { await user.click(await saml.enableConfigButton.find()); expect(await saml.jitProvisioningButton.find()).toBeChecked(); - - await user.type(saml.groupAttribute.get(), 'group'); - expect(saml.saveScim.get()).toBeEnabled(); - await user.click(saml.saveScim.get()); - await waitFor(() => expect(saml.saveScim.query()).toBeDisabled()); + expect(saml.saveScim.get()).toBeDisabled(); await user.click(saml.scimProvisioningButton.get()); expect(saml.saveScim.get()).toBeEnabled(); |