import org.sonar.db.DbSession;
import org.sonar.db.audit.AuditPersister;
import org.sonar.db.audit.model.DevOpsPlatformSettingNewValue;
+import org.sonar.db.audit.model.SecretNewValue;
public class AlmSettingDao implements Dao {
}
}
- public void update(DbSession dbSession, AlmSettingDto almSettingDto) {
+ public void update(DbSession dbSession, AlmSettingDto almSettingDto, boolean updateSecret) {
long now = system2.now();
almSettingDto.setUpdatedAt(now);
getMapper(dbSession).update(almSettingDto);
if (auditPersister != null) {
+ if (updateSecret) {
+ auditPersister.updateDevOpsPlatformSecret(dbSession, new SecretNewValue("DevOpsPlatform", almSettingDto.getRawAlm()));
+ }
auditPersister.updateDevOpsPlatformSetting(dbSession, new DevOpsPlatformSettingNewValue(almSettingDto));
}
}
void updateUser(DbSession dbSession, NewValue newValue);
+ void updateUserPassword(DbSession dbSession, NewValue newValue);
+
+ void updateWebhookSecret(DbSession dbSession, NewValue newValue);
+
+ void updateDevOpsPlatformSecret(DbSession dbSession, NewValue newValue);
+
void deactivateUser(DbSession dbSession, NewValue newValue);
void addUserToGroup(DbSession dbSession, NewValue newValue);
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonar.db.audit.model;
+
+public class SecretNewValue extends NewValue {
+ private String targetKey;
+ private String targetValue;
+
+ public SecretNewValue(String targetKey, String targetValue) {
+ this.targetKey = targetKey;
+ this.targetValue = targetValue;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("{\"%s\":\"%s\"}", targetKey, targetValue);
+ }
+}
import org.sonar.db.Dao;
import org.sonar.db.DbSession;
import org.sonar.db.audit.AuditPersister;
+import org.sonar.db.audit.model.SecretNewValue;
import org.sonar.db.audit.model.WebhookNewValue;
import org.sonar.db.project.ProjectDto;
private final System2 system2;
private AuditPersister auditPersister;
-
public WebhookDao(System2 system2) {
this.system2 = system2;
}
mapper(dbSession).update(dto.setUpdatedAt(system2.now()));
if (auditPersister != null) {
+ if (dto.getSecret() != null) {
+ auditPersister.updateWebhookSecret(dbSession, new SecretNewValue("webhook_name", dto.getName()));
+ }
auditPersister.updateWebhook(dbSession, new WebhookNewValue(dto, projectKey, projectName));
}
}
almSettingDto.setKey("updated key");
system2.setNow(NOW + 1);
- underTest.update(dbSession, almSettingDto);
+ underTest.update(dbSession, almSettingDto, false);
AlmSettingDto result = underTest.selectByUuid(dbSession, A_UUID).get();
assertThat(result)
import org.sonar.db.DbTester;
import org.sonar.db.audit.AuditPersister;
import org.sonar.db.audit.model.DevOpsPlatformSettingNewValue;
+import org.sonar.db.audit.model.SecretNewValue;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
@Test
public void insertAndUpdateArePersisted() {
+ ArgumentCaptor<SecretNewValue> secretNewValueCaptor = ArgumentCaptor.forClass(SecretNewValue.class);
when(uuidFactory.create()).thenReturn(A_UUID);
AlmSettingDto almSettingDto = newGithubAlmSettingDto()
.setKey("key")
assertThat(newValue)
.extracting("devOpsPlatformSettingUuid", "key")
.containsExactly(almSettingDto.getUuid(), almSettingDto.getKey());
- assertThat(newValue).hasToString("{\"devOpsPlatformSettingUuid\": \"1\", \"key\": \"key\", \"devOpsPlatformName\": \"id1\", \"url\": \"url\", \"appId\": \"id1\", \"clientId\": \"cid1\" }");
+ assertThat(newValue)
+ .hasToString("{\"devOpsPlatformSettingUuid\": \"1\", \"key\": \"key\", \"devOpsPlatformName\": \"id1\", \"url\": \"url\", \"appId\": \"id1\", \"clientId\": \"cid1\" }");
almSettingDto.setPrivateKey("updated private key");
almSettingDto.setAppId("updated app id");
almSettingDto.setPersonalAccessToken("updated pat");
almSettingDto.setKey("updated key");
- underTest.update(dbSession, almSettingDto);
+ underTest.update(dbSession, almSettingDto, true);
+
+ verify(auditPersister).updateDevOpsPlatformSecret(eq(dbSession), secretNewValueCaptor.capture());
+ SecretNewValue secretNewValue = secretNewValueCaptor.getValue();
+ assertThat(secretNewValue).hasToString(String.format("{\"DevOpsPlatform\":\"%s\"}", almSettingDto.getRawAlm()));
verify(auditPersister).updateDevOpsPlatformSetting(eq(dbSession), newValueCaptor.capture());
newValue = newValueCaptor.getValue();
assertThat(newValue)
- .extracting("devOpsPlatformSettingUuid", "key","appId", "devOpsPlatformName", "url", "clientId")
+ .extracting("devOpsPlatformSettingUuid", "key", "appId", "devOpsPlatformName", "url", "clientId")
.containsExactly(almSettingDto.getUuid(), almSettingDto.getKey(), almSettingDto.getAppId(), almSettingDto.getAppId(), almSettingDto.getUrl(), almSettingDto.getClientId());
assertThat(newValue).hasToString("{\"devOpsPlatformSettingUuid\": \"1\", \"key\": \"updated key\", \"devOpsPlatformName\": \"updated app id\", "
- + "\"url\": \"updated url\", \"appId\": \"updated app id\", \"clientId\": \"cid1\" }");
+ + "\"url\": \"updated url\", \"appId\": \"updated app id\", \"clientId\": \"cid1\" }");
}
@Test
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
import org.sonar.db.audit.AuditPersister;
+import org.sonar.db.audit.model.SecretNewValue;
import org.sonar.db.audit.model.WebhookNewValue;
import org.sonar.db.component.ComponentDbTester;
import org.sonar.db.project.ProjectDto;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
private final ComponentDbTester componentDbTester = dbTester.components();
private final ArgumentCaptor<WebhookNewValue> newValueCaptor = ArgumentCaptor.forClass(WebhookNewValue.class);
+ private final ArgumentCaptor<SecretNewValue> secretNewValueCaptor = ArgumentCaptor.forClass(SecretNewValue.class);
@Test
public void insertGlobalWebhookIsPersisted() {
}
@Test
- public void updateGlobalWebhookIsPersisted() {
+ public void updateGlobalWebhookIsPersistedWithoutSecret() {
WebhookDto dto = webhookDbTester.insertGlobalWebhook();
dto = dto
.setName("a-fancy-webhook")
underTest.update(dbSession, dto, null, null);
+ verify(auditPersister, never()).updateWebhookSecret(eq(dbSession), any());
+
verify(auditPersister).updateWebhook(eq(dbSession), newValueCaptor.capture());
WebhookNewValue newValue = newValueCaptor.getValue();
assertThat(newValue)
assertThat(newValue).hasToString("{\"webhookUuid\": \"" + dto.getUuid() + "\", \"name\": \"a-fancy-webhook\", \"url\": \"http://www.fancy-webhook.io\" }");
}
+ @Test
+ public void updateGlobalWebhookIsPersistedWithSecret() {
+ WebhookDto dto = webhookDbTester.insertGlobalWebhook();
+ dto = dto
+ .setName("a-fancy-webhook")
+ .setUrl("http://www.fancy-webhook.io")
+ .setSecret("new secret");
+
+ underTest.update(dbSession, dto, null, null);
+
+ verify(auditPersister).updateWebhookSecret(eq(dbSession), secretNewValueCaptor.capture());
+ SecretNewValue secretNewValue = secretNewValueCaptor.getValue();
+ assertThat(secretNewValue).hasToString(String.format("{\"webhook_name\":\"%s\"}", dto.getName()));
+
+ verify(auditPersister).updateWebhook(eq(dbSession), newValueCaptor.capture());
+ WebhookNewValue newValue = newValueCaptor.getValue();
+ assertThat(newValue)
+ .extracting(WebhookNewValue::getWebhookUuid, WebhookNewValue::getName, WebhookNewValue::getUrl)
+ .containsExactly(dto.getUuid(), dto.getName(), dto.getUrl());
+ assertThat(newValue).hasToString("{\"webhookUuid\": \"" + dto.getUuid() + "\", \"name\": \"a-fancy-webhook\", \"url\": \"http://www.fancy-webhook.io\" }");
+ }
+
@Test
public void updateProjectWebhookIsPersisted() {
WebhookDto dto = webhookDbTester.insertGlobalWebhook();
import org.sonar.api.server.ServerSide;
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
+import org.sonar.db.audit.AuditPersister;
+import org.sonar.db.audit.model.SecretNewValue;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
import org.sonar.db.user.UserGroupDto;
private final UserIndexer userIndexer;
private final DefaultGroupFinder defaultGroupFinder;
private final Configuration config;
+ private final AuditPersister auditPersister;
+
private final CredentialsLocalAuthentication localAuthentication;
public UserUpdater(NewUserNotifier newUserNotifier, DbClient dbClient, UserIndexer userIndexer, DefaultGroupFinder defaultGroupFinder, Configuration config,
this.userIndexer = userIndexer;
this.defaultGroupFinder = defaultGroupFinder;
this.config = config;
+ this.auditPersister = null;
+ this.localAuthentication = localAuthentication;
+ }
+
+ public UserUpdater(NewUserNotifier newUserNotifier, DbClient dbClient, UserIndexer userIndexer, DefaultGroupFinder defaultGroupFinder, Configuration config,
+ AuditPersister auditPersister, CredentialsLocalAuthentication localAuthentication) {
+ this.newUserNotifier = newUserNotifier;
+ this.dbClient = dbClient;
+ this.userIndexer = userIndexer;
+ this.defaultGroupFinder = defaultGroupFinder;
+ this.config = config;
+ this.auditPersister = auditPersister;
this.localAuthentication = localAuthentication;
}
changed |= updateName(update, dto, messages);
changed |= updateEmail(update, dto, messages);
changed |= updateExternalIdentity(dbSession, update, dto);
- changed |= updatePassword(update, dto, messages);
+ changed |= updatePassword(dbSession, update, dto, messages);
changed |= updateScmAccounts(dbSession, update, dto, messages);
checkRequest(messages.isEmpty(), messages);
return changed;
return false;
}
- private boolean updatePassword(UpdateUser updateUser, UserDto userDto, List<String> messages) {
+ private boolean updatePassword(DbSession dbSession, UpdateUser updateUser, UserDto userDto, List<String> messages) {
String password = updateUser.password();
if (updateUser.isPasswordChanged() && validatePasswords(password, messages) && checkPasswordChangeAllowed(userDto, messages)) {
localAuthentication.storeHashPassword(userDto, password);
userDto.setResetPassword(false);
+ if (auditPersister != null) {
+ auditPersister.updateUserPassword(dbSession, new SecretNewValue("userLogin", userDto.getLogin()));
+ }
return true;
}
return false;
import org.sonar.api.impl.utils.AlwaysIncreasingSystem2;
import org.sonar.api.utils.System2;
import org.sonar.db.DbTester;
+import org.sonar.db.audit.AuditPersister;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.authentication.event.AuthenticationEvent;
private final DefaultGroupFinder defaultGroupFinder = new DefaultGroupFinder(db.getDbClient());
private final UserRegistrarImpl userIdentityAuthenticator = new UserRegistrarImpl(db.getDbClient(),
- new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), userIndexer, defaultGroupFinder, settings.asConfig(), localAuthentication),
+ new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), userIndexer, defaultGroupFinder, settings.asConfig(), mock(AuditPersister.class), localAuthentication),
defaultGroupFinder);
private final HttpServletResponse response = mock(HttpServletResponse.class);
private final JwtHttpHandler jwtHttpHandler = mock(JwtHttpHandler.class);
import org.sonar.api.server.authentication.UserIdentity;
import org.sonar.api.utils.log.LogTester;
import org.sonar.db.DbTester;
+import org.sonar.db.audit.AuditPersister;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.authentication.event.AuthenticationEvent;
import static java.util.Arrays.stream;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
import static org.sonar.db.user.UserTesting.newUserDto;
import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
private final UserIndexer userIndexer = new UserIndexer(db.getDbClient(), es.client());
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
private final DefaultGroupFinder groupFinder = new DefaultGroupFinder(db.getDbClient());
- private final UserUpdater userUpdater = new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), userIndexer, groupFinder, settings.asConfig(), localAuthentication);
+ private final AuditPersister auditPersister = mock(AuditPersister.class);
+ private final UserUpdater userUpdater = new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), userIndexer, groupFinder, settings.asConfig(), auditPersister, localAuthentication);
private final UserRegistrarImpl underTest = new UserRegistrarImpl(db.getDbClient(), userUpdater, groupFinder);
private GroupDto defaultGroup;
UserDto::isActive)
.containsExactly("old login", USER_IDENTITY.getName(), USER_IDENTITY.getEmail(), USER_IDENTITY.getProviderId(), USER_IDENTITY.getProviderLogin(),
IDENTITY_PROVIDER.getKey(), true);
+ verify(auditPersister, never()).updateUserPassword(any(), any());
}
@Test
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
+import org.sonar.db.audit.AuditPersister;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.UserDto;
import org.sonar.server.authentication.CredentialsLocalAuthentication;
private final MapSettings settings = new MapSettings().setProperty("sonar.internal.pbkdf2.iterations", "1");
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
private final UserUpdater underTest = new UserUpdater(newUserNotifier, dbClient, userIndexer,
- new DefaultGroupFinder(dbClient), settings.asConfig(), localAuthentication);
+ new DefaultGroupFinder(dbClient), settings.asConfig(), null, localAuthentication);
@Test
public void create_user() {
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
+import org.sonar.db.audit.AuditPersister;
import org.sonar.db.user.GroupDto;
import org.sonar.db.user.GroupTesting;
import org.sonar.db.user.UserDto;
import static java.lang.String.format;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.sonar.process.ProcessProperties.Property.ONBOARDING_TUTORIAL_SHOW_TO_NEW_USERS;
public class UserUpdaterReactivateTest {
private final UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
private final MapSettings settings = new MapSettings().setProperty("sonar.internal.pbkdf2.iterations", "1");
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
+ private final AuditPersister auditPersister = mock(AuditPersister.class);
private final UserUpdater underTest = new UserUpdater(newUserNotifier, dbClient, userIndexer,
new DefaultGroupFinder(dbClient),
- settings.asConfig(), localAuthentication);
+ settings.asConfig(), auditPersister, localAuthentication);
@Test
public void reactivate_user() {
assertThat(reloaded.getCryptedPassword()).isNotNull().isNotEqualTo("650d2261c98361e2f67f90ce5c65a95e7d8ea2fg");
assertThat(reloaded.getCreatedAt()).isEqualTo(user.getCreatedAt());
assertThat(reloaded.getUpdatedAt()).isGreaterThan(user.getCreatedAt());
+ verify(auditPersister, times(1)).updateUserPassword(any(), any());
}
@Test
assertThat(dto.getCryptedPassword()).isNull();
assertThat(dto.getCreatedAt()).isEqualTo(user.getCreatedAt());
assertThat(dto.getUpdatedAt()).isGreaterThan(user.getCreatedAt());
+ verify(auditPersister, never()).updateUserPassword(any(), any());
}
@Test
import org.sonar.db.DbClient;
import org.sonar.db.DbSession;
import org.sonar.db.DbTester;
+import org.sonar.db.audit.AuditPersister;
import org.sonar.db.component.ComponentDto;
import org.sonar.db.property.PropertyDto;
import org.sonar.db.property.PropertyQuery;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.assertj.core.api.Assertions.tuple;
import static org.assertj.core.data.MapEntry.entry;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
import static org.sonar.api.CoreProperties.DEFAULT_ISSUE_ASSIGNEE;
import static org.sonar.db.user.UserTesting.newExternalUser;
import static org.sonar.db.user.UserTesting.newLocalUser;
private final UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
private final MapSettings settings = new MapSettings().setProperty("sonar.internal.pbkdf2.iterations", "1");
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
+ private final AuditPersister auditPersister = mock(AuditPersister.class);
private final UserUpdater underTest = new UserUpdater(newUserNotifier, dbClient, userIndexer,
- new DefaultGroupFinder(dbClient), settings.asConfig(), localAuthentication);
+ new DefaultGroupFinder(dbClient), settings.asConfig(), auditPersister, localAuthentication);
@Test
- public void update_user() {
+ public void update_user_without_password() {
UserDto user = db.users().insertUser(newLocalUser(DEFAULT_LOGIN, "Marius", "marius@email.com")
.setScmAccounts(asList("ma", "marius33")));
createDefaultGroup();
entry("login", DEFAULT_LOGIN),
entry("name", "Marius2"),
entry("email", "marius2@mail.com"));
+ verify(auditPersister, never()).updateUserPassword(any(), any());
}
@Test
UserDto dto = dbClient.userDao().selectByLogin(session, DEFAULT_LOGIN);
assertThat(dto.getScmAccountsAsList()).containsOnly("ma2");
+ verify(auditPersister, times(1)).updateUserPassword(any(), any());
}
@Test
dbClient.almSettingDao().update(dbSession, almSettingDto
.setKey(isNotBlank(newKey) ? newKey : key)
.setPersonalAccessToken(isNotBlank(pat) ? pat : almSettingDto.getPersonalAccessToken())
- .setUrl(url));
+ .setUrl(url),
+ pat != null);
dbSession.commit();
}
}
dbClient.almSettingDao().update(dbSession, almSettingDto
.setKey(isNotBlank(newKey) ? newKey : key)
.setUrl(url)
- .setPersonalAccessToken(isNotBlank(pat) ? pat : almSettingDto.getPersonalAccessToken()));
+ .setPersonalAccessToken(isNotBlank(pat) ? pat : almSettingDto.getPersonalAccessToken()),
+ pat != null);
dbSession.commit();
}
}
.setKey(isNotBlank(newKey) ? newKey : key)
.setClientId(clientId)
.setAppId(workspace)
- .setClientSecret(isNotBlank(clientSecret) ? clientSecret : almSettingDto.getClientSecret()));
+ .setClientSecret(isNotBlank(clientSecret) ? clientSecret : almSettingDto.getClientSecret()),
+ clientSecret != null);
dbSession.commit();
}
}
.setAppId(appId)
.setPrivateKey(isNotBlank(privateKey) ? privateKey : almSettingDto.getPrivateKey())
.setClientId(clientId)
- .setClientSecret(isNotBlank(clientSecret) ? clientSecret : almSettingDto.getClientSecret()));
+ .setClientSecret(isNotBlank(clientSecret) ? clientSecret : almSettingDto.getClientSecret()),
+ clientSecret != null || privateKey != null);
dbSession.commit();
}
}
dbClient.almSettingDao().update(dbSession, almSettingDto
.setKey(isNotBlank(newKey) ? newKey : key)
.setUrl(url)
- .setPersonalAccessToken(isNotBlank(pat) ? pat : almSettingDto.getPersonalAccessToken()));
+ .setPersonalAccessToken(isNotBlank(pat) ? pat : almSettingDto.getPersonalAccessToken()),
+ pat != null);
dbSession.commit();
}
}
private final UserUpdater userUpdater = new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(),
new UserIndexer(db.getDbClient(), es.client()), new DefaultGroupFinder(db.getDbClient()),
- new MapSettings().asConfig(), localAuthentication);
+ new MapSettings().asConfig(), null, localAuthentication);
private final WsActionTester tester = new WsActionTester(new ChangePasswordAction(db.getDbClient(), userUpdater, userSessionRule, localAuthentication));
private GroupDto defaultGroup;
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
private final WsActionTester tester = new WsActionTester(new CreateAction(db.getDbClient(), new UserUpdater(mock(NewUserNotifier.class),
- db.getDbClient(), userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication), userSessionRule));
+ db.getDbClient(), userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), null, localAuthentication), userSessionRule));
@Before
public void setUp() {
private final UserIndexer userIndexer = new UserIndexer(dbClient, es.client());
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(db.getDbClient(), settings.asConfig());
private final WsActionTester ws = new WsActionTester(new UpdateAction(
- new UserUpdater(mock(NewUserNotifier.class), dbClient, userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
+ new UserUpdater(mock(NewUserNotifier.class), dbClient, userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), null, localAuthentication),
userSession, new UserJsonWriter(userSession), dbClient));
@Before
private final CredentialsLocalAuthentication localAuthentication = new CredentialsLocalAuthentication(dbClient, settings.asConfig());
private final WsActionTester underTest = new WsActionTester(new UpdateIdentityProviderAction(dbClient, identityProviderRepository,
- new UserUpdater(mock(NewUserNotifier.class), dbClient, userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), localAuthentication),
+ new UserUpdater(mock(NewUserNotifier.class), dbClient, userIndexer, new DefaultGroupFinder(db.getDbClient()), settings.asConfig(), null, localAuthentication),
userSession));
@Test
public ExpectedException expectedException = ExpectedException.none();
private final WsActionTester ws = new WsActionTester(new UpdateLoginAction(db.getDbClient(), userSession,
- new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), new UserIndexer(db.getDbClient(), es.client()), null, null, null)));
+ new UserUpdater(mock(NewUserNotifier.class), db.getDbClient(), new UserIndexer(db.getDbClient(), es.client()), null, null, null, null)));
@Test
public void update_login_from_sonarqube_account_when_user_is_local() {