Skip to content

Commit

Permalink
Merge branch 'devel' into dbeaver/pro#2552-delete-profile
Browse files Browse the repository at this point in the history
  • Loading branch information
serjiokov authored Mar 7, 2024
2 parents 89b831b + e13368d commit 794c102
Show file tree
Hide file tree
Showing 157 changed files with 3,411 additions and 3,010 deletions.
54 changes: 31 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,36 @@ You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io

## Changelog

### 23.3.5. 2024-02-19
- Default user group was added to the product. This group includes all users. You cannot delete users from this group;
- Added the ability to disable alias autocomplete for all users in the admin panel;
- Different bug fixes and enhancements have been made.

### 23.3.4. 2024-02-05
- Text wrap is activated by default for texts and BLOBs in the Values panel for better visibility. User can switch to the one-line mode using a button on the toolbar;
- Added the ability to edit the default preferences of the following parts: interface, tools and data viewer in the settings panel in the administrative part;
- Added ability to configure reverse proxy header name and redirect URL at logout. Admin will now be able to configure all settings;
- Update PostgreSQL driver to 42.5.2;
- Added the ability to display the OpenStreetMap layer with the default coordinate system ESPG 4326;
- ClickHouse Legacy driver has been removed to prevent potential vulnerability issues;
- Different bug fixes and enhancements have been made.

### 23.3.3. 2024-01-22
- Added password policy for the local authorization. Password parameters can be set in the configuration file;
- The 'Keep alive' option has been added to the connection settings to keep the connection active even in case of inactivity;
- Added ability to display full text for a string data type in value panel;
- The DuckDB driver has been added;
- Different bug fixes and enhancements have been made.

### 23.3.2. 2024-01-08
- Added the ability to view decoded binary-type data in the Value panel;
- Enhanced security for unauthorized access;
### 24.0.0. 2024-03-04
- Changes since 23.3.0:

- Main updates:
- Have enhanced security for unauthorised access;
- Have added a password policy for the local authorization. Password parameters can be set in the configuration file;
- Have added validation for mandatory fields in all forms to create and edit entities;
- Have added an ability to edit the default preferences of the following parts: interface, tools and data viewer in the settings panel in the administrative part;
- Performance:
- Have improved the performance of the server.
- Administration:
- Have added the ability to configure reverse proxy header name and redirect URL at logout. Now the administrator can configure all settings. The delimiter symbol for the reverse proxy team headers is configurable;
- Preferences:
- Have added the ability in the admin panel to customise copying in the Tables and Values panel for all users except the administrator;
- Have added the ability to disable alias autocomplete for all users.
- Access Management:
- A default user group was added to the product. This group includes all users which could not be deleted.
- Connections:
- The 'Keep alive' option has been added to the connection settings to keep the connection active even in case of inactivity.
- Data Editor:
- Have added the ability to view decoded binary-type data in the Value panel;
- Text wrap is activated by default for texts and BLOBs in the Values panel for better visibility. The user can switch to the one-line mode using a button on the toolbar;
- Have added the ability to display full text for a string data type in the Value panel;
- Have added the ability to display the OpenStreetMap layer with the coordinate system ESPG 4326.
- Resource management:
- Read-only scripts now have a padlock icon.
- Databases:
- The DuckDB driver has been added;
- Updated PostgreSQL driver to 42.5.2;
- ClickHouse Legacy driver has been removed to prevent potential vulnerability issues;
- Updated MariaDB driver to version 3.3.2.
- Different bug fixes and enhancements have been made.
2 changes: 1 addition & 1 deletion deploy/build-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ echo "Copy static content"

cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web

echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
echo "Cloudbeaver is ready. Run run-server.sh in cloudbeaver folder to start the server."
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ public WebDataSourceRegistryProxy(DataSourceRegistry dataSourceRegistry, DataSou
this.dataSourceFilter = filter;
}

@NotNull
@Override
public DBPProject getProject() {
return dataSourceRegistry.getProject();
}

@Nullable
@Override
public DBPDataSourceContainer getDataSource(String id) {
public DBPDataSourceContainer getDataSource(@NotNull String id) {
DBPDataSourceContainer dataSource = dataSourceRegistry.getDataSource(id);
if (dataSource == null || dataSourceFilter != null && !dataSourceFilter.filter(dataSource)) {
return null;
Expand All @@ -68,7 +69,7 @@ public DBPDataSourceContainer getDataSource(String id) {

@Nullable
@Override
public DBPDataSourceContainer getDataSource(DBPDataSource dataSource) {
public DBPDataSourceContainer getDataSource(@NotNull DBPDataSource dataSource) {
if (dataSourceFilter != null && !dataSourceFilter.filter(dataSource.getContainer())) {
return null;
}
Expand Down Expand Up @@ -107,13 +108,13 @@ public List<DBPDataSourceContainer> getDataSources() {

@NotNull
@Override
public DBPDataSourceContainer createDataSource(DBPDriver driver, DBPConnectionConfiguration connConfig) {
public DBPDataSourceContainer createDataSource(@NotNull DBPDriver driver, @NotNull DBPConnectionConfiguration connConfig) {
return dataSourceRegistry.createDataSource(driver, connConfig);
}

@NotNull
@Override
public DBPDataSourceContainer createDataSource(DBPDataSourceContainer source) {
public DBPDataSourceContainer createDataSource(@NotNull DBPDataSourceContainer source) {
return dataSourceRegistry.createDataSource(source);
}

Expand Down Expand Up @@ -164,18 +165,20 @@ public List<? extends DBPDataSourceFolder> getRootFolders() {
return dataSourceRegistry.getRootFolders();
}

@Nullable
@Override
public DBPDataSourceFolder getFolder(String path) {
public DBPDataSourceFolder getFolder(@NotNull String path) {
return dataSourceRegistry.getFolder(path);
}

@NotNull
@Override
public DBPDataSourceFolder addFolder(DBPDataSourceFolder parent, String name) {
public DBPDataSourceFolder addFolder(@Nullable DBPDataSourceFolder parent, @NotNull String name) {
return dataSourceRegistry.addFolder(parent, name);
}

@Override
public void removeFolder(DBPDataSourceFolder folder, boolean dropContents) {
public void removeFolder(@NotNull DBPDataSourceFolder folder, boolean dropContents) {
dataSourceRegistry.removeFolder(folder, dropContents);
}

Expand All @@ -197,18 +200,18 @@ public List<DBSObjectFilter> getSavedFilters() {
}

@Override
public void updateSavedFilter(DBSObjectFilter filter) {
public void updateSavedFilter(@NotNull DBSObjectFilter filter) {
dataSourceRegistry.updateSavedFilter(filter);
}

@Override
public void removeSavedFilter(String filterName) {
public void removeSavedFilter(@NotNull String filterName) {
dataSourceRegistry.removeSavedFilter(filterName);
}

@Nullable
@Override
public DBWNetworkProfile getNetworkProfile(String source, String name) {
public DBWNetworkProfile getNetworkProfile(@Nullable String source, @NotNull String name) {
return dataSourceRegistry.getNetworkProfile(source, name);
}

Expand All @@ -219,18 +222,18 @@ public List<DBWNetworkProfile> getNetworkProfiles() {
}

@Override
public void updateNetworkProfile(DBWNetworkProfile profile) {
public void updateNetworkProfile(@NotNull DBWNetworkProfile profile) {
dataSourceRegistry.updateNetworkProfile(profile);
}

@Override
public void removeNetworkProfile(DBWNetworkProfile profile) {
public void removeNetworkProfile(@NotNull DBWNetworkProfile profile) {
dataSourceRegistry.removeNetworkProfile(profile);
}

@Nullable
@Override
public DBAAuthProfile getAuthProfile(String id) {
public DBAAuthProfile getAuthProfile(@NotNull String id) {
return dataSourceRegistry.getAuthProfile(id);
}

Expand All @@ -247,7 +250,7 @@ public List<DBAAuthProfile> getApplicableAuthProfiles(@Nullable DBPDriver driver
}

@Override
public void updateAuthProfile(DBAAuthProfile profile) {
public void updateAuthProfile(@NotNull DBAAuthProfile profile) {
dataSourceRegistry.updateAuthProfile(profile);
}

Expand Down Expand Up @@ -276,6 +279,7 @@ public void refreshConfig(@Nullable Collection<String> dataSourceIds) {
dataSourceRegistry.refreshConfig(dataSourceIds);
}

@Nullable
@Override
public Throwable getLastError() {
return dataSourceRegistry.getLastError();
Expand All @@ -292,7 +296,7 @@ public void checkForErrors() throws DBException {
}

@Override
public void notifyDataSourceListeners(DBPEvent event) {
public void notifyDataSourceListeners(@NotNull DBPEvent event) {
dataSourceRegistry.notifyDataSourceListeners(event);
}

Expand All @@ -312,6 +316,7 @@ public void setAuthCredentialsProvider(DBACredentialsProvider authCredentialsPro
dataSourceRegistry.setAuthCredentialsProvider(authCredentialsProvider);
}

@NotNull
@Override
public Set<DBPDataSourceFolder> getTemporaryFolders() {
return dataSourceRegistry.getTemporaryFolders();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.cloudbeaver;

import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.app.DBPDataSourceRegistry;
Expand All @@ -40,6 +41,7 @@ public WebProjectImpl(
super(workspace, resourceController, sessionContext, project, dataSourceFilter);
}

@Nullable
@Override
public Object getProjectProperty(String propName) {
try {
Expand All @@ -51,7 +53,7 @@ public Object getProjectProperty(String propName) {
}

@Override
public void setProjectProperty(String propName, Object propValue) {
public void setProjectProperty(@NotNull String propName, @Nullable Object propValue) {
try {
getResourceController().setProjectProperty(getId(), propName, propValue);
} catch (DBException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ public synchronized boolean updateSMSession(SMAuthInfo smAuthInfo) throws DBExce
public synchronized void refreshUserData() {
try {
userContext.refreshPermissions();
userContext.refreshAccessibleProjects();
if (userContext.isAuthorizedInSecurityManager()) {
userContext.refreshAccessibleProjects();
}
} catch (DBException e) {
addSessionError(e);
log.error("Error refreshing accessible projects", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.cloudbeaver.model.WebServerMessage;
import io.cloudbeaver.model.app.WebAuthApplication;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.auth.SMSessionPrincipal;

Expand All @@ -43,6 +44,7 @@ public void addSessionMessage(WebServerMessage message) {

}

@Nullable
@Override
public SMSessionPrincipal getSessionPrincipal() {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public WebSession(
refreshSessionAuth();
}

@Nullable
@Override
public SMSessionPrincipal getSessionPrincipal() {
synchronized (authTokens) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ public List<WebProjectImpl> getProjects() {
return accessibleProjects;
}

@Nullable
@Override
public DBPProject getActiveProject() {
return activeProject;
}

@Nullable
@Override
public WebProjectImpl getProject(@NotNull String projectName) {
for (WebProjectImpl project : accessibleProjects) {
Expand Down Expand Up @@ -148,12 +150,12 @@ void clearProjects() {
}

@Override
public boolean hasRealmPermission(String permission) {
public boolean hasRealmPermission(@NotNull String permission) {
return false;
}

@Override
public boolean supportsRealmFeature(String feature) {
public boolean supportsRealmFeature(@NotNull String feature) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ public String[] getApplicableAuthModels() {

@Property
public String[] getApplicableNetworkHandlers() {
if (driver.isEmbedded()) {
return new String[0];
if (!driver.isEmbedded() || CommonUtils.toBoolean(driver.getDriverParameter(DBConstants.DRIVER_PARAM_ENABLE_NETWORK_PARAMETERS))) {
return NetworkHandlerRegistry.getInstance().getDescriptors(driver).stream()
.filter(h -> !h.isDesktopHandler())
.map(NetworkHandlerDescriptor::getId).toArray(String[]::new);
}
return NetworkHandlerRegistry.getInstance().getDescriptors(driver).stream()
.filter(h -> !h.isDesktopHandler())
.map(NetworkHandlerDescriptor::getId).toArray(String[]::new);
return new String[0];
}

@Property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.jkiss.dbeaver.model.app.DBPPlatform;
import org.jkiss.dbeaver.model.auth.AuthInfo;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
Expand Down Expand Up @@ -260,6 +261,7 @@ protected void startServer() {
log.error(e);
return;
}
refreshDisabledDriversConfig();

configurationMode = CommonUtils.isEmpty(serverName);

Expand Down Expand Up @@ -541,7 +543,6 @@ protected Path loadServerConfiguration() throws DBException {
log.debug("Runtime configuration [" + runtimeConfigFile.getAbsolutePath() + "]");
parseConfiguration(runtimeConfigFile);
}

return path;
}

Expand Down Expand Up @@ -1338,4 +1339,16 @@ protected void sendConfigChangedEvent(SMCredentialsProvider credentialsProvider)
}
eventController.addEvent(new WSServerConfigurationChangedEvent(sessionId, null));
}

private void refreshDisabledDriversConfig() {
CBAppConfig config = getAppConfiguration();
Set<String> disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers()));
for (DBPDriver driver : CBPlatform.getInstance().getApplicableDrivers()) {
if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) {
continue;
}
disabledDrivers.add(driver.getFullId());
}
config.setDisabledDrivers(disabledDrivers.toArray(new String[0]));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,6 @@ protected synchronized void initialize() {

refreshApplicableDrivers();

refreshDisabledDriversConfig();

new WebSessionMonitorJob(this)
.scheduleMonitor();

Expand Down Expand Up @@ -223,7 +221,7 @@ public DBACertificateStorage getCertificateStorage() {
}

@NotNull
public Path getTempFolder(DBRProgressMonitor monitor, String name) {
public Path getTempFolder(@NotNull DBRProgressMonitor monitor, @NotNull String name) {
if (tempFolder == null) {
// Make temp folder
monitor.subTask("Create temp folder");
Expand Down Expand Up @@ -293,18 +291,6 @@ public void refreshApplicableDrivers() {
log.info("Available drivers: " + applicableDrivers.stream().map(DBPDriver::getFullName).collect(Collectors.joining(",")));
}

private void refreshDisabledDriversConfig() {
CBAppConfig config = application.getAppConfiguration();
Set<String> disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers()));
for (DBPDriver driver : applicableDrivers) {
if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) {
continue;
}
disabledDrivers.add(driver.getFullId());
}
config.setDisabledDrivers(disabledDrivers.toArray(new String[0]));
}

@NotNull
@Override
public DBFileController createFileController() {
Expand Down
Loading

0 comments on commit 794c102

Please sign in to comment.