]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20232 Move SAML group attribute to common configuration for SAML
authorguillaume-peoch-sonarsource <guillaume.peoch@sonarsource.com>
Tue, 22 Aug 2023 15:15:51 +0000 (17:15 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 24 Aug 2023 20:03:09 +0000 (20:03 +0000)
server/sonar-auth-saml/src/main/java/org/sonar/auth/saml/SamlSettings.java
server/sonar-web/src/main/js/apps/settings/components/authentication/SamlAuthenticationTab.tsx
server/sonar-web/src/main/js/apps/settings/components/authentication/__tests__/Authentication-it.tsx

index 3da572ea2af1690e348a4ea93851f0eb26325bbd..2a06c235f854eb093c8cb4a708c347534245feab 100644 (file)
@@ -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)
index edb9349490d9b0f97c0f031f2c0465943a12c439..0deaa73e7aa7fad90f7a6647ddab8425de61905a 100644 (file)
@@ -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>
                 ) : (
index b61e05b3f8693b04380cfb3cf18e62444c3222d4..2a09f47090b36d4fa4d15649f5ee1c0d5ad0d046 100644 (file)
@@ -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();