Skip to content

Commit

Permalink
Merge branch 'devel' into CB-5886-fixed-import-float
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgeniaBzzz authored Nov 18, 2024
2 parents 766423b + 0144742 commit c2af2a6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ You can see a live demo of CloudBeaver here: https://demo.cloudbeaver.io

## Changelog

### 24.2.5. 2024-11-18
- Updated user storage mechanism: New user logins are now stored in lowercase to prevent duplicate entries (e.g., "ADMIN" and "admin"). Note: This update does not affect previously created user logins;
- A new setting in Global Preferences was added to restrict data import for non-admin users.

### 24.2.4. 2024-11-04
- General:
- Data export: Added the ability to export JSON values as embedded JSON;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public synchronized void finishConfiguration(
}

if (isConfigurationMode()) {
finishSecurityServiceConfiguration(adminName, adminPassword, authInfoList);
finishSecurityServiceConfiguration(adminName.toLowerCase(), adminPassword, authInfoList);
}

// Save runtime configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public class CBAbstractWebSocket extends Session.Listener.AbstractAutoDemanding {
private static final Log log = Log.getLog(CBAbstractWebSocket.class);
protected static final Gson gson = WSUtils.gson;
protected static final Gson gson = WSUtils.clientGson;

public void handleEvent(WSEvent event) {
if (!isOpen()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,16 +851,21 @@ public void setUserCredentials(
}
List<String[]> transformedCredentials;
WebAuthProviderDescriptor authProvider = getAuthProvider(authProviderId);
if (authProvider.isCaseInsensitive() && !isSubjectExists(userId) && isSubjectExists(userId.toLowerCase())) {
log.warn("User with id '" + userId + "' not found, credentials will be set for the user: " + userId.toLowerCase());
userId = userId.toLowerCase();
}
try {
SMAuthCredentialsProfile credProfile = getCredentialProfileByParameters(authProvider, credentials.keySet());
String finalUserId = userId;
transformedCredentials = credentials.entrySet().stream().map(cred -> {
String propertyName = cred.getKey();
AuthPropertyDescriptor property = credProfile.getCredentialParameter(propertyName);
if (property == null) {
return null;
}
String encodedValue = CommonUtils.toString(cred.getValue());
encodedValue = property.getEncryption().encrypt(userId, encodedValue);
encodedValue = property.getEncryption().encrypt(finalUserId, encodedValue);
return new String[]{propertyName, encodedValue};
}).toList();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.cloudbeaver.service.security.db;

import org.jkiss.dbeaver.model.security.user.SMTeam;
import org.jkiss.utils.CommonUtils;

import java.util.List;

Expand All @@ -26,7 +27,7 @@ class CBDatabaseInitialData {
private List<SMTeam> teams;

public String getAdminName() {
return adminName;
return CommonUtils.isEmpty(adminName) ? null : adminName.toLowerCase();
}

public String getAdminPassword() {
Expand Down

0 comments on commit c2af2a6

Please sign in to comment.