mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-16 14:50:15 +08:00
Compare commits
115
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
932eaf8315 | ||
|
|
db9f145609 | ||
|
|
d920227db0 | ||
|
|
874760f780 | ||
|
|
0e286f383f | ||
|
|
40385f3b1c | ||
|
|
4bc74883e0 | ||
|
|
33d1d97fb7 | ||
|
|
296e03ec74 | ||
|
|
2abdbce8ff | ||
|
|
051695451b | ||
|
|
5b7a7fc3d6 | ||
|
|
0ba013e7ad | ||
|
|
2d2f7476b4 | ||
|
|
23a0ad49b9 | ||
|
|
d21a5aac7f | ||
|
|
f9cd51db0f | ||
|
|
3687a645b6 | ||
|
|
c142996db0 | ||
|
|
36d2b46496 | ||
|
|
cb8b1cfc52 | ||
|
|
743afcaad7 | ||
|
|
52c78e1aee | ||
|
|
d0a5c1304a | ||
|
|
ff275c36b6 | ||
|
|
85d3d834d0 | ||
|
|
9a94639167 | ||
|
|
74d09ee4dc | ||
|
|
09dece1cec | ||
|
|
360aaed795 | ||
|
|
912ca3fdcd | ||
|
|
32bbfc3a37 | ||
|
|
1e05ad9eea | ||
|
|
4b516c770d | ||
|
|
48057948c2 | ||
|
|
ce7107285d | ||
|
|
4e1fed8177 | ||
|
|
a43355425f | ||
|
|
4b30d1073b | ||
|
|
269128360d | ||
|
|
07db19635e | ||
|
|
41d9ac4296 | ||
|
|
a536a93ea3 | ||
|
|
aefdca73fa | ||
|
|
5d402d0c20 | ||
|
|
fcd1924853 | ||
|
|
05c0aafb53 | ||
|
|
159b1b8bd6 | ||
|
|
f03c08bde7 | ||
|
|
1b07a66192 | ||
|
|
ce1686e0eb | ||
|
|
091160a59a | ||
|
|
47d2377b39 | ||
|
|
8a3f6455ec | ||
|
|
801139e3ff | ||
|
|
457909dd82 | ||
|
|
9f7e086369 | ||
|
|
6e8a09a49e | ||
|
|
8d11f94ad6 | ||
|
|
3b0cd66232 | ||
|
|
a60b7d4496 | ||
|
|
07a3a069fb | ||
|
|
4511208cad | ||
|
|
1ab8d15b00 | ||
|
|
ae331effde | ||
|
|
6c88030106 | ||
|
|
1aea7c19b6 | ||
|
|
4d0f1a1a43 | ||
|
|
5e53341ba1 | ||
|
|
9338539564 | ||
|
|
af1aa83d8b | ||
|
|
32671ff239 | ||
|
|
f7c33a7f7e | ||
|
|
d70e4976e5 | ||
|
|
a0e6154a08 | ||
|
|
1b6e729506 | ||
|
|
de0958add0 | ||
|
|
3adb898f5a | ||
|
|
c886ee7bcd | ||
|
|
e7ac881fab | ||
|
|
ec9b9de142 | ||
|
|
a5a9700ab9 | ||
|
|
974f003a23 | ||
|
|
2c38e75a99 | ||
|
|
c96e383018 | ||
|
|
12bc5ba5dc | ||
|
|
2719f53655 | ||
|
|
a2d336166b | ||
|
|
06da0705d2 | ||
|
|
058a341815 | ||
|
|
f5b0aae8bd | ||
|
|
789760aa9e | ||
|
|
fe77133226 | ||
|
|
8e237d1bbc | ||
|
|
0f3b8033df | ||
|
|
586d4154ab | ||
|
|
e0fe55c3bf | ||
|
|
9c406a4e1e | ||
|
|
05bf79e59c | ||
|
|
d013ece4f6 | ||
|
|
b0205e34c7 | ||
|
|
0b41ae89e8 | ||
|
|
b318c262b9 | ||
|
|
547831d060 | ||
|
|
93af9a8719 | ||
|
|
19125fed5e | ||
|
|
ea5fb47a56 | ||
|
|
89b4d1f970 | ||
|
|
0bd89236d2 | ||
|
|
abe0f6fb7d | ||
|
|
0b2b851772 | ||
|
|
dcb8e536b8 | ||
|
|
7881551821 | ||
|
|
cdc94dce5f | ||
|
|
70b67ce6f4 |
@@ -25,61 +25,55 @@ You can see a live demo of CloudBeaver here: https://demo.cloudbeaver.io
|
||||
|
||||
## Changelog
|
||||
|
||||
### 25.3.3 2026-01-19
|
||||
### 26.0.0 2026-03-02
|
||||
|
||||
- For security reasons, session expiration leads to a complete logout for a user and clears all data from the screen;
|
||||
- Added "Use local formatting" setting to Data Editor. Users can choose how to display numbers and dates: using the OS locale, a custom locale, or keeping values unformatted. This formatting applies only to displayed values. Data in the database remains unchanged;
|
||||
- Added the shortcut Ctrl/Cmd + . to cancel operations in Data Editor;
|
||||
- CloudBeaver now supports long polling as a fallback when WebSockets are unavailable or blocked, ensuring reliable communication for metadata updates and SQL execution;
|
||||
- Fixed a keyboard navigation issue for panels to keep the focus inside;
|
||||
- Clickhouse: Spatial data support was added.
|
||||
### Changes since 25.3.0:
|
||||
|
||||
### 25.3.2 2026-01-05
|
||||
|
||||
- The ability to pin columns has been added to the Data Editor, allowing users to keep key columns (e.g., IDs, names) visible while scrolling through wide tables;
|
||||
- Added a new setting in the SQL Editor to highlight spaces, tabs, and other whitespace characters to help users read, debug, and maintain their scripts. It is turned off by default and can be configured in personal preferences;
|
||||
- Redesigned the connection configuration page. Form fields and sections have been reorganized to provide more space for input and reduce visual clutter;
|
||||
- Clickhouse: driver has been updated to version 0.9.5;
|
||||
- Oracle: Added a new "Set Username to OS_USER" option in the Misc section of Oracle connection settings. When turned on, the tool automatically uses the current database username as the operating system user identifier in the session metadata.
|
||||
|
||||
### 25.3.1 2025-12-22
|
||||
|
||||
- Implemented an ability to add parameters and variables to queries in the SQL Editor. This feature allows for the reuse of queries by changing parameters at the execution stage. It is enabled by default and can be configured in personal preferences;
|
||||
- Added support for mapping users to CloudBeaver teams based on LDAP memberOf group membership;
|
||||
- Added support for previous browser versions, but not older than three years.
|
||||
|
||||
### 25.3.0 2025-12-01
|
||||
|
||||
### Changes since 25.2.0:
|
||||
|
||||
- Administration:
|
||||
- Permission configuration for connections has been simplified, providing a clearer appearance and improved performance;
|
||||
- LDAP authentication now supports case-insensitive Distinguished Names (DNs), allowing login with mixed-case DNS.
|
||||
- Security:
|
||||
- Fixed a security issue in the Spatial Viewer for the HTML content to prevent a third-party script execution;
|
||||
- Fixed the critical vulnerability (CVE-2025-61927) in the Happy DOM library. The library was updated to version 20.0.2.
|
||||
- Enforced complete logout and screen data clearance upon session expiration;
|
||||
- Fixed the high vulnerability (CVE-2026-25639) in the axios library. The library was updated to version 1.13.5.
|
||||
- Administration:
|
||||
- Added support for mapping users to CloudBeaver teams based on LDAP memberOf group membership;
|
||||
- Change the User list settings in the Administration part to show both active and inactive users by default.
|
||||
- SQL Editor:
|
||||
- A confirmation prompt has been added to the SQL Editor to prevent accidental execution of potentially dangerous queries. You can customize this behavior in Preferences > SQL Editor;
|
||||
- A search field has been added to the catalog/schema selector on the main toolbar for easy navigation;
|
||||
- Alphabetical order has been added to the autocomplete values in the SQL Editor to simplify object search;
|
||||
- Added support for temporary tables in semantic analysis.
|
||||
- Added support for parameters and variables in queries. This feature allows queries to be reused by changing parameters at execution time. Enabled by default and configurable in personal preferences;
|
||||
- Added SQL preview to the Bind parameters/variables dialog to review queries with changed values on the fly;
|
||||
- Enabled Tab key for autocompletion in the SQL Editor alongside the Enter key;
|
||||
- Added a new setting in the SQL Editor to highlight spaces, tabs, and other whitespace characters to help users read, debug, and maintain their scripts. It is turned off by default and can be configured in personal preferences;
|
||||
- Dangerous query confirmation is now shown for all DROP statements, not just for tables.
|
||||
- Data Editor:
|
||||
- The ability to review the database query after applying filters and sorting in the Data Editor, Grouping panel, and Result sets has been added. The new Show SQL button is placed on the Filter panel;
|
||||
- The value panel in the Data Editor has been redesigned to give users more space for viewing and editing data. Tab buttons for different data type visualizations are now aligned on a single level, creating a cleaner layout;
|
||||
- Added visualization for column reordering in the Data Editor;
|
||||
- Fixed an issue in the Data Editor where resizing one column in a wide table caused previously resized columns to revert to their original width. Users can resize multiple columns as intended.
|
||||
- Added ability to automatically generate INSERT, SELECT, DELETE, and UPDATE statements for the selected values;
|
||||
- Added undo and redo functionality for cell edits, row operations, and other data modifications. Retains the last 50 actions across the Data Editor, result sets, and related panels;
|
||||
- Added "Use local formatting" setting. Users can choose how to display numbers and dates: using the OS locale, a custom locale, or keeping values unformatted. This formatting applies only to displayed values. Data in the database remains unchanged;
|
||||
- Added column pinning to keep key columns (e.g., IDs, names) visible while horizontal scrolling through wide tables;
|
||||
- Added status indicator icon in the top-left corner with tooltips explaining table editability. Indicates presence of primary keys, read-only connection settings, or read-only columns;
|
||||
- Added shortcut Ctrl/Cmd + . to cancel operations in Data Editor;
|
||||
- Fixed application freeze in canceling fetch size requests for large tables.
|
||||
- Navigator tree:
|
||||
- Added the ability to duplicate connection configuration in the project navigation tree. The "Clone connection" feature is available in the context menu;
|
||||
- Added the ability for users to configure the Simple or Advanced view in the Navigation tree for all connections or for each connection separately;
|
||||
- Added the ability to show table objects, such as columns or keys, in the Navigation tree. The setting is disabled by default and can be turned on in the Navigator settings panel;
|
||||
- Added the ability to rename connections via context menu in the Navigation Tree;
|
||||
- Added Connection Info tab to display basic information about the current connection for all users.
|
||||
- General:
|
||||
- A reorder tabs option has been added to the application, allowing users to set editor tabs in custom positions;
|
||||
- Keyboard navigation has been improved across the application. Additional shortcuts are available in the main info panel (top-right corner) to help discover them faster. Relevant keyboard shortcuts are also shown in the tooltips of Data Editor buttons;
|
||||
- Boolean values have been replaced with intuitive checkboxes instead of the true/false text in the metadata editor, making editing easier and faster;
|
||||
- The database navigator now automatically hides empty subfolders in shared projects, reducing visual clutter;
|
||||
- Databases and drivers:
|
||||
- ClickHouse: query canceling support has been added;
|
||||
- DuckDB: fixed an issue where catalog selection was lost upon disconnection;
|
||||
- PostgreSQL: fixed support for GIS data types;
|
||||
- SQL Server: the driver has been updated to version 13.2.1;
|
||||
- The "Show all databases" setting has been added on the connection page for MySQL and MariaDB.
|
||||
## Contribution
|
||||
As a community-driven open-source project, we warmly welcome contributions through GitHub pull requests.
|
||||
- Added support for long polling as a fallback when WebSockets are unavailable or blocked. Ensures reliable communication for metadata updates and SQL execution;
|
||||
- Extended browser support to versions up to three years old;
|
||||
- Redesigned the connection configuration page. Reorganized form fields and sections to provide more input space and reduce visual clutter;
|
||||
- Expanded pointer target areas for icons in the Navigator, editors, and tabs according to the accessibility standards;
|
||||
- Fixed a keyboard navigation issue for panels to keep the focus inside;
|
||||
- Renamed "Database Native" authentication type to "Username/password" in the connection dialog;
|
||||
- Fixed issue where the missing pg_dump utility caused errors during initialization or deployment updates when PostgreSQL was selected as the inner database.
|
||||
- Databases:
|
||||
- ClickHouse:
|
||||
- Updated driver to version 0.9.5
|
||||
- Added spatial data support
|
||||
- Fixed an issue with displaying arrays of UUID, IPv4/IPv6, and Map types
|
||||
- Fixed JSON data type reading
|
||||
- Resolved an issue with CTE expressions
|
||||
- DuckDB:
|
||||
- Updated driver to version 1.4.4.0;
|
||||
- Added support for the dollar-quoted string syntax for the SQL Editor
|
||||
- Oracle: Added a new "Set Username to OS_USER" option in the Misc section of Oracle connection settings. Automatically uses the current database username as the operating system user identifier in session metadata when enabled;
|
||||
- PostgreSQL: Added DDL display support for PostgreSQL policies.
|
||||
|
||||
[We are happy to reward](https://dbeaver.com/help-dbeaver/) our most active contributors every major sprint.
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Model
|
||||
Bundle-SymbolicName: io.cloudbeaver.model.cli;singleton:=true
|
||||
Bundle-Version: 1.0.3.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.7.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.jkiss.dbeaver.model.cli;visibility:=reexport
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.model.cli</artifactId>
|
||||
<version>1.0.3-SNAPSHOT</version>
|
||||
<version>1.0.7-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
+8
-14
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,39 +18,33 @@ package io.cloudbeaver.model.cli;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.model.cli.*;
|
||||
import org.jkiss.dbeaver.model.cli.model.CommandLineAuthenticator;
|
||||
import org.jkiss.dbeaver.model.cli.ApplicationCommandLine;
|
||||
import org.jkiss.dbeaver.model.cli.ApplicationInstanceController;
|
||||
import org.jkiss.dbeaver.model.cli.CLIContextImpl;
|
||||
import org.jkiss.dbeaver.model.cli.CLIRunMeta;
|
||||
import picocli.CommandLine;
|
||||
|
||||
public class CloudBeaverCommandLine extends ApplicationCommandLine<ApplicationInstanceController> {
|
||||
@Nullable
|
||||
private final CommandLineAuthenticator authenticator;
|
||||
private final CloudBeaverMixin mixin;
|
||||
|
||||
public CloudBeaverCommandLine(@Nullable CommandLineAuthenticator authenticator) {
|
||||
public CloudBeaverCommandLine() {
|
||||
super();
|
||||
this.authenticator = authenticator;
|
||||
this.mixin = new CloudBeaverMixin();
|
||||
}
|
||||
|
||||
public CloudBeaverCommandLine(
|
||||
@Nullable CommandLineAuthenticator authenticator,
|
||||
@NotNull CloudBeaverMixin mixin
|
||||
) {
|
||||
super();
|
||||
this.authenticator = authenticator;
|
||||
this.mixin = mixin;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CloudBeaverTopLevelCommand createTopLevelCommand(
|
||||
@Nullable ApplicationInstanceController applicationInstanceController,
|
||||
@NotNull CommandLineContext context,
|
||||
@NotNull CLIContextImpl context,
|
||||
@NotNull CLIRunMeta runMeta
|
||||
) {
|
||||
if (authenticator != null) {
|
||||
context.setContextParameter(CLIConstants.CONTEXT_PARAM_AUTHENTICATOR, authenticator);
|
||||
}
|
||||
return new CloudBeaverTopLevelCommand(applicationInstanceController, context, runMeta);
|
||||
}
|
||||
|
||||
@@ -58,7 +52,7 @@ public class CloudBeaverCommandLine extends ApplicationCommandLine<ApplicationIn
|
||||
@Override
|
||||
protected CommandLine initCommandLine(
|
||||
@Nullable ApplicationInstanceController applicationInstanceController,
|
||||
@NotNull CommandLineContext context,
|
||||
@NotNull CLIContextImpl context,
|
||||
@NotNull CLIRunMeta runMeta
|
||||
) {
|
||||
var cmd = super.initCommandLine(applicationInstanceController, context, runMeta);
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public class CloudBeaverInstanceServer extends ApplicationInstanceServer<Applica
|
||||
|
||||
public CloudBeaverInstanceServer() throws IOException {
|
||||
super(ApplicationInstanceController.class);
|
||||
this.commandLine = new CloudBeaverCommandLine(null);
|
||||
this.commandLine = new CloudBeaverCommandLine();
|
||||
}
|
||||
|
||||
public CloudBeaverInstanceServer(@NotNull CloudBeaverCommandLine commandLine) throws IOException {
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,12 +16,14 @@
|
||||
*/
|
||||
package io.cloudbeaver.model.cli;
|
||||
|
||||
import org.jkiss.dbeaver.model.cli.model.NonExecutableOption;
|
||||
import picocli.CommandLine;
|
||||
|
||||
/**
|
||||
* CloudBeaver specific mixin options
|
||||
*/
|
||||
public class CloudBeaverMixin {
|
||||
@NonExecutableOption
|
||||
@CommandLine.Option(
|
||||
names = {"-web-config"},
|
||||
arity = "1",
|
||||
|
||||
+5
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,13 +19,15 @@ package io.cloudbeaver.model.cli;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.model.cli.ApplicationInstanceController;
|
||||
import org.jkiss.dbeaver.model.cli.CLIContextImpl;
|
||||
import org.jkiss.dbeaver.model.cli.CLIRunMeta;
|
||||
import org.jkiss.dbeaver.model.cli.CommandLineContext;
|
||||
import org.jkiss.dbeaver.model.cli.command.AbstractTopLevelCommand;
|
||||
import org.jkiss.dbeaver.model.cli.model.NonExecutableOption;
|
||||
import picocli.CommandLine;
|
||||
|
||||
@CommandLine.Command(name = "cbvr", description = "CloudBeaver commands")
|
||||
public class CloudBeaverTopLevelCommand extends AbstractTopLevelCommand {
|
||||
@NonExecutableOption
|
||||
@CommandLine.Option(
|
||||
names = {NOSPASH_OPTION},
|
||||
hidden = true,
|
||||
@@ -35,7 +37,7 @@ public class CloudBeaverTopLevelCommand extends AbstractTopLevelCommand {
|
||||
|
||||
protected CloudBeaverTopLevelCommand(
|
||||
@Nullable ApplicationInstanceController controller,
|
||||
@NotNull CommandLineContext context,
|
||||
@NotNull CLIContextImpl context,
|
||||
@NotNull CLIRunMeta meta
|
||||
|
||||
) {
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Model
|
||||
Bundle-SymbolicName: io.cloudbeaver.model;singleton:=true
|
||||
Bundle-Version: 1.0.94.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.98.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.model</artifactId>
|
||||
<version>1.0.94-SNAPSHOT</version>
|
||||
<version>1.0.98-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -146,6 +146,8 @@ public class DBWebException extends DBException implements GraphQLError {
|
||||
} else {
|
||||
return message;
|
||||
}
|
||||
} else if (cause.getMessage() == null && cause.getCause() != null) {
|
||||
return message + ":\n" + cause.getCause().getClass().getSimpleName();
|
||||
}
|
||||
if (CommonUtils.isEmpty(message)) {
|
||||
if (cause.getMessage() != null) {
|
||||
|
||||
@@ -218,6 +218,7 @@ public class WebSessionProjectImpl extends WebProjectImpl implements DBPAdaptabl
|
||||
*
|
||||
* @return connections from cache.
|
||||
*/
|
||||
@NotNull
|
||||
public List<WebConnectionInfo> getConnections() {
|
||||
if (!registryIsLoaded) {
|
||||
addDataSourcesToCache();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import io.cloudbeaver.DBWebException;
|
||||
import io.cloudbeaver.WebProjectImpl;
|
||||
import io.cloudbeaver.model.app.BaseWebAppConfiguration;
|
||||
import io.cloudbeaver.model.session.WebSession;
|
||||
import io.cloudbeaver.server.CBConstants;
|
||||
import io.cloudbeaver.service.security.SMUtils;
|
||||
import io.cloudbeaver.service.sql.WebDataFormat;
|
||||
import io.cloudbeaver.utils.CBModelConstants;
|
||||
@@ -59,7 +60,6 @@ import java.util.stream.Collectors;
|
||||
public class WebConnectionInfo {
|
||||
|
||||
private static final Log log = Log.getLog(WebConnectionInfo.class);
|
||||
public static final String SECURED_VALUE = "********";
|
||||
|
||||
private static final String FEATURE_HAS_TOOLS = "hasTools";
|
||||
private static final String FEATURE_CONNECTED = "connected";
|
||||
@@ -127,7 +127,7 @@ public class WebConnectionInfo {
|
||||
if (canViewReadOnlyConnections()) {
|
||||
return dataSourceContainer.getConnectionConfiguration().getHostName();
|
||||
}
|
||||
return SECURED_VALUE;
|
||||
return CBConstants.SECURED_VALUE;
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -135,7 +135,7 @@ public class WebConnectionInfo {
|
||||
if (canViewReadOnlyConnections()) {
|
||||
return dataSourceContainer.getConnectionConfiguration().getHostPort();
|
||||
}
|
||||
return SECURED_VALUE;
|
||||
return CBConstants.SECURED_VALUE;
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -148,7 +148,7 @@ public class WebConnectionInfo {
|
||||
if (canViewReadOnlyConnections()) {
|
||||
return dataSourceContainer.getConnectionConfiguration().getDatabaseName();
|
||||
}
|
||||
return SECURED_VALUE;
|
||||
return CBConstants.SECURED_VALUE;
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -156,7 +156,7 @@ public class WebConnectionInfo {
|
||||
if (canViewReadOnlyConnections()) {
|
||||
return dataSourceContainer.getConnectionConfiguration().getUrl();
|
||||
}
|
||||
return SECURED_VALUE;
|
||||
return CBConstants.SECURED_VALUE;
|
||||
}
|
||||
|
||||
@Property
|
||||
|
||||
+5
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package io.cloudbeaver.model;
|
||||
|
||||
import io.cloudbeaver.server.CBConstants;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.net.DBWHandlerConfiguration;
|
||||
import org.jkiss.dbeaver.model.net.DBWHandlerType;
|
||||
@@ -88,7 +89,9 @@ public class WebNetworkHandlerConfig {
|
||||
DBPPropertyDescriptor[] descriptor = configuration.getHandlerDescriptor().getHandlerProperties();
|
||||
for (DBPPropertyDescriptor p : descriptor) {
|
||||
if (p.hasFeature(RegistryConstants.ATTR_PASSWORD)) {
|
||||
secureProperties.computeIfPresent(p.getId(), (k, v) -> CommonUtils.isEmpty(v) ? null : WebConnectionInfo.SECURED_VALUE);
|
||||
secureProperties.computeIfPresent(p.getId(), (k, v) ->
|
||||
CommonUtils.isEmpty(v) ? null : CBConstants.SECURED_VALUE
|
||||
);
|
||||
}
|
||||
}
|
||||
return secureProperties;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,11 +17,13 @@
|
||||
package io.cloudbeaver.model;
|
||||
|
||||
import io.cloudbeaver.model.session.WebSession;
|
||||
import io.cloudbeaver.server.CBConstants;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.model.*;
|
||||
import org.jkiss.dbeaver.model.connection.DBPDriverConfigurationType;
|
||||
import org.jkiss.dbeaver.model.impl.PropertyDescriptor;
|
||||
import org.jkiss.dbeaver.model.impl.ProviderPropertyDescriptor;
|
||||
import org.jkiss.dbeaver.model.meta.IPropertyValueListProvider;
|
||||
import org.jkiss.dbeaver.model.meta.Property;
|
||||
@@ -30,6 +32,7 @@ import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
|
||||
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
|
||||
import org.jkiss.dbeaver.registry.settings.ProductSettingDescriptor;
|
||||
import org.jkiss.dbeaver.runtime.properties.ObjectPropertyDescriptor;
|
||||
import org.jkiss.utils.ArrayUtils;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
@@ -136,13 +139,14 @@ public class WebPropertyInfo {
|
||||
@Property
|
||||
public Object getValue() throws DBException {
|
||||
Object value = propertySource == null ? null : propertySource.getPropertyValue(session.getProgressMonitor(), property.getId());
|
||||
if (property instanceof ObjectPropertyDescriptor) {
|
||||
ObjectPropertyDescriptor opd = (ObjectPropertyDescriptor) property;
|
||||
if (!showProtected && opd.isPassword() || opd.isHidden()) {
|
||||
if (value == null || value.toString().isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
return "******";
|
||||
if (property instanceof ObjectPropertyDescriptor opd &&
|
||||
(!showProtected && opd.isPassword() || opd.isHidden())
|
||||
) {
|
||||
return maskValue(value);
|
||||
} else if (property instanceof PropertyDescriptor pd) {
|
||||
String[] features = pd.getFeatures();
|
||||
if (features != null && ArrayUtils.contains(features, DBConstants.PROP_FEATURE_PASSWORD)) {
|
||||
return maskValue(value);
|
||||
}
|
||||
}
|
||||
return value == null ? null : makePropertyValue(value);
|
||||
@@ -307,4 +311,13 @@ public class WebPropertyInfo {
|
||||
READ_ONLY
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static String maskValue(@Nullable Object value) {
|
||||
if (value == null || value.toString().isEmpty()) {
|
||||
return "";
|
||||
} else {
|
||||
return CBConstants.SECURED_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-3
@@ -80,9 +80,6 @@ public interface ServletApplication extends DBPApplication {
|
||||
@NotNull
|
||||
DBFileController createFileController(@NotNull SMCredentialsProvider credentialsProvider);
|
||||
|
||||
@Nullable
|
||||
String getServerURL();
|
||||
|
||||
@NotNull
|
||||
default String getServicesURI() {
|
||||
return "/";
|
||||
|
||||
+6
-5
@@ -31,8 +31,6 @@ import org.jkiss.dbeaver.model.rm.RMProject;
|
||||
import org.jkiss.dbeaver.model.rm.RMResource;
|
||||
import org.jkiss.dbeaver.model.rm.RMResourceType;
|
||||
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
|
||||
import org.jkiss.dbeaver.registry.ResourceTypeDescriptor;
|
||||
import org.jkiss.dbeaver.registry.ResourceTypeRegistry;
|
||||
import org.jkiss.utils.ArrayUtils;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
import org.jkiss.utils.IOUtils;
|
||||
@@ -44,7 +42,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
|
||||
|
||||
private final RMResource resource;
|
||||
|
||||
DBNResourceManagerResource(DBNNode parentNode, RMResource resource) {
|
||||
DBNResourceManagerResource(@NotNull DBNNode parentNode, @NotNull RMResource resource) {
|
||||
super(parentNode);
|
||||
this.resource = resource;
|
||||
}
|
||||
@@ -71,6 +69,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
|
||||
@Override
|
||||
public DBPImage getNodeIcon() {
|
||||
if (resource.isFolder()) {
|
||||
/*
|
||||
if (getParentNode() instanceof DBNResourceManagerResource) {
|
||||
return DBIcon.TREE_FOLDER;
|
||||
}
|
||||
@@ -82,11 +81,12 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
|
||||
if (folderResType != null) {
|
||||
return folderResType.getFolderIcon();
|
||||
}
|
||||
*/
|
||||
return DBIcon.TREE_FOLDER;
|
||||
} else {
|
||||
var fileExtension = IOUtils.getFileExtension(getNodeDisplayName());
|
||||
if (!CommonUtils.isEmpty(fileExtension)) {
|
||||
RMProject project = getProjectNode();
|
||||
RMProject project = getRmProject();
|
||||
if (project != null) {
|
||||
for (RMResourceType rt : project.getResourceTypes()) {
|
||||
if (ArrayUtils.contains(rt.getFileExtensions(), fileExtension)) {
|
||||
@@ -99,7 +99,8 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
|
||||
}
|
||||
}
|
||||
|
||||
private RMProject getProjectNode() {
|
||||
@Nullable
|
||||
public RMProject getRmProject() {
|
||||
for (DBNNode node = this; node != null; node = node.getParentNode()) {
|
||||
if (node instanceof DBNResourceManagerProject) {
|
||||
return ((DBNResourceManagerProject) node).getProject();
|
||||
|
||||
+9
-10
@@ -21,7 +21,6 @@ import io.cloudbeaver.model.app.ServletApplication;
|
||||
import io.cloudbeaver.model.app.ServletAuthApplication;
|
||||
import io.cloudbeaver.websocket.CBWebSessionEventHandler;
|
||||
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.auth.SMAuthInfo;
|
||||
@@ -103,7 +102,7 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void addSessionError(Throwable exception);
|
||||
public abstract void addSessionError(@NotNull Throwable exception);
|
||||
|
||||
public void addEventHandler(@NotNull CBWebSessionEventHandler handler) {
|
||||
synchronized (sessionEventHandlers) {
|
||||
@@ -117,11 +116,11 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized boolean updateSMSession(SMAuthInfo smAuthInfo) throws DBException {
|
||||
public boolean updateSMSession(SMAuthInfo smAuthInfo) throws DBException {
|
||||
return userContext.refresh(smAuthInfo);
|
||||
}
|
||||
|
||||
public synchronized void refreshUserData() {
|
||||
public void refreshUserData() {
|
||||
try {
|
||||
userContext.refreshPermissions();
|
||||
if (userContext.isAuthorizedInSecurityManager()) {
|
||||
@@ -151,7 +150,7 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
return workspace.getAuthContext();
|
||||
}
|
||||
|
||||
protected void clearSessionContext() {
|
||||
protected synchronized void clearSessionContext() {
|
||||
this.workspace.getAuthContext().clear();
|
||||
this.workspace.getAuthContext().addSession(this);
|
||||
}
|
||||
@@ -177,12 +176,12 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
return lastAccessTime;
|
||||
}
|
||||
|
||||
public synchronized void touchSession() {
|
||||
public void touchSession() {
|
||||
this.lastAccessTime = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public synchronized WebUserContext getUserContext() {
|
||||
public WebUserContext getUserContext() {
|
||||
return userContext;
|
||||
}
|
||||
|
||||
@@ -227,7 +226,7 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
this.eventsFilter = eventsFilter;
|
||||
}
|
||||
|
||||
public boolean isProjectAccessible(String projectId) {
|
||||
public boolean isProjectAccessible(@NotNull String projectId) {
|
||||
return userContext.getAccessibleProjectIds().contains(projectId);
|
||||
}
|
||||
|
||||
@@ -240,11 +239,11 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
|
||||
}
|
||||
|
||||
|
||||
public void removeSessionProject(@Nullable String projectId) throws DBException {
|
||||
public void removeSessionProject(@NotNull String projectId) throws DBException {
|
||||
userContext.getAccessibleProjectIds().remove(projectId);
|
||||
}
|
||||
|
||||
public abstract void addSessionMessage(WebServerMessage message);
|
||||
public abstract void addSessionMessage(@NotNull WebServerMessage message);
|
||||
|
||||
@Property
|
||||
public boolean isValid() {
|
||||
|
||||
+2
-2
@@ -35,12 +35,12 @@ public class WebHeadlessSession extends BaseWebSession {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSessionError(Throwable exception) {
|
||||
public void addSessionError(@NotNull Throwable exception) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addSessionMessage(WebServerMessage message) {
|
||||
public void addSessionMessage(@NotNull WebServerMessage message) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
+111
-124
@@ -57,8 +57,6 @@ import org.jkiss.dbeaver.model.websocket.event.MessageType;
|
||||
import org.jkiss.dbeaver.model.websocket.event.WSSessionLogUpdatedEvent;
|
||||
import org.jkiss.dbeaver.runtime.DBWorkbench;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
import org.jkiss.utils.function.ThrowableConsumer;
|
||||
import org.jkiss.utils.function.ThrowableFunction;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.file.Path;
|
||||
@@ -66,6 +64,8 @@ import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.stream.Collectors;
|
||||
/**
|
||||
* Web session.
|
||||
@@ -96,12 +96,12 @@ public class WebSession extends BaseWebSession
|
||||
private final List<WebServerMessage> sessionMessages = new ArrayList<>();
|
||||
|
||||
private final Map<String, WebAsyncTaskInfo> asyncTasks = new HashMap<>();
|
||||
private final Map<String, ThrowableConsumer<Object, Exception>> attributeDisposers = new HashMap<>();
|
||||
|
||||
// Map of auth tokens. Key is authentication provider
|
||||
private final List<WebAuthInfo> authTokens = new ArrayList<>();
|
||||
|
||||
private DBNModel navigatorModel;
|
||||
private final ReadWriteLock navigatorModelLock = new ReentrantReadWriteLock(true);
|
||||
private final DBRProgressMonitor progressMonitor = new SessionProgressMonitor();
|
||||
private final Map<String, DBWSessionHandler<WebSession>> sessionHandlers;
|
||||
private final WebDataSourceConnectEventListener connectListener = new WebDataSourceConnectEventListener(this);
|
||||
@@ -188,11 +188,12 @@ public class WebSession extends BaseWebSession
|
||||
this.cacheExpired = cacheExpired;
|
||||
}
|
||||
|
||||
public synchronized WebUser getUser() {
|
||||
public WebUser getUser() {
|
||||
return this.userContext.getUser();
|
||||
}
|
||||
|
||||
public synchronized Map<String, String> getUserMetaParameters() {
|
||||
@NotNull
|
||||
public Map<String, String> getUserMetaParameters() {
|
||||
var user = getUser();
|
||||
if (user == null) {
|
||||
return Map.of();
|
||||
@@ -204,20 +205,20 @@ public class WebSession extends BaseWebSession
|
||||
return allMetaParams;
|
||||
}
|
||||
|
||||
public synchronized String getUserId() {
|
||||
public String getUserId() {
|
||||
return userContext.getUserId();
|
||||
}
|
||||
|
||||
public synchronized boolean hasPermission(String perm) {
|
||||
return getSessionPermissions().contains(DBWConstants.PERMISSION_ADMIN) ||
|
||||
getSessionPermissions().contains(perm);
|
||||
Set<String> sessionPermissions = getSessionPermissions();
|
||||
return sessionPermissions.contains(DBWConstants.PERMISSION_ADMIN) || sessionPermissions.contains(perm);
|
||||
}
|
||||
|
||||
public synchronized boolean isAuthorizedInSecurityManager() {
|
||||
public boolean isAuthorizedInSecurityManager() {
|
||||
return userContext.isAuthorizedInSecurityManager();
|
||||
}
|
||||
|
||||
public synchronized Set<String> getSessionPermissions() {
|
||||
public Set<String> getSessionPermissions() {
|
||||
if (userContext.getUserPermissions() == null) {
|
||||
refreshSessionAuth();
|
||||
}
|
||||
@@ -225,28 +226,30 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public synchronized SMController getSecurityController() {
|
||||
public SMController getSecurityController() {
|
||||
return userContext.getSecurityController();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public synchronized SMAdminController getAdminSecurityController() throws DBException {
|
||||
public SMAdminController getAdminSecurityController() throws DBException {
|
||||
if (!hasPermission(DBWConstants.PERMISSION_ADMIN)) {
|
||||
throw new DBException("Admin permissions required");
|
||||
}
|
||||
return userContext.getAdminSecurityController();
|
||||
}
|
||||
|
||||
public synchronized RMController getRmController() {
|
||||
@NotNull
|
||||
public RMController getRmController() {
|
||||
return userContext.getRmController();
|
||||
}
|
||||
|
||||
public synchronized DBFileController getFileController() {
|
||||
@NotNull
|
||||
public DBFileController getFileController() {
|
||||
return userContext.getFileController();
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void refreshUserData() {
|
||||
public void refreshUserData() {
|
||||
super.refreshUserData();
|
||||
refreshSessionAuth();
|
||||
|
||||
@@ -254,7 +257,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
|
||||
// Note: for admin use only
|
||||
public synchronized void resetUserState(boolean needResetUserCache) throws DBException {
|
||||
public void resetUserState(boolean needResetUserCache) throws DBException {
|
||||
clearAuthTokens();
|
||||
if (needResetUserCache) {
|
||||
try {
|
||||
@@ -268,7 +271,7 @@ public class WebSession extends BaseWebSession
|
||||
clearSessionContext();
|
||||
}
|
||||
|
||||
public synchronized void resetUserState() throws DBException {
|
||||
public void resetUserState() throws DBException {
|
||||
resetUserState(true);
|
||||
}
|
||||
|
||||
@@ -277,26 +280,35 @@ public class WebSession extends BaseWebSession
|
||||
return connectListener;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getClientOrigin() {
|
||||
return clientOrigin;
|
||||
}
|
||||
|
||||
public void updateClientOrigin(@NotNull String originFromRequest) {
|
||||
this.clientOrigin = originFromRequest;
|
||||
}
|
||||
|
||||
private void initNavigatorModel() {
|
||||
navigatorModelLock.writeLock().lock();
|
||||
try {
|
||||
// Cleanup current data
|
||||
if (this.navigatorModel != null) {
|
||||
this.navigatorModel.dispose();
|
||||
this.navigatorModel = null;
|
||||
}
|
||||
this.globalProject = null;
|
||||
|
||||
// Cleanup current data
|
||||
if (this.navigatorModel != null) {
|
||||
this.navigatorModel.dispose();
|
||||
this.navigatorModel = null;
|
||||
loadProjects();
|
||||
|
||||
this.navigatorModel = new DBNModel(DBWorkbench.getPlatform(), getWorkspace().getProjects());
|
||||
this.navigatorModel.setModelAuthContext(getWorkspace().getAuthContext());
|
||||
this.navigatorModel.initialize();
|
||||
|
||||
this.locale = Locale.getDefault().getLanguage();
|
||||
} finally {
|
||||
navigatorModelLock.writeLock().unlock();
|
||||
}
|
||||
this.globalProject = null;
|
||||
|
||||
loadProjects();
|
||||
|
||||
this.navigatorModel = new DBNModel(DBWorkbench.getPlatform(), getWorkspace().getProjects());
|
||||
this.navigatorModel.setModelAuthContext(getWorkspace().getAuthContext());
|
||||
this.navigatorModel.initialize();
|
||||
|
||||
this.locale = Locale.getDefault().getLanguage();
|
||||
}
|
||||
|
||||
private void loadProjects() {
|
||||
@@ -327,7 +339,8 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
}
|
||||
|
||||
private WebSessionProjectImpl createWebProject(RMProject project) throws DBException {
|
||||
@NotNull
|
||||
private WebSessionProjectImpl createWebProject(@NotNull RMProject project) throws DBException {
|
||||
WebSessionProjectImpl sessionProject;
|
||||
if (project.isGlobal()) {
|
||||
sessionProject = createGlobalProject(project);
|
||||
@@ -345,6 +358,7 @@ public class WebSession extends BaseWebSession
|
||||
return sessionProject;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected WebSessionProjectImpl createSessionProject(@NotNull RMProject project) throws DBException {
|
||||
return new WebSessionProjectImpl(this, project, getProjectPath(project));
|
||||
}
|
||||
@@ -354,37 +368,24 @@ public class WebSession extends BaseWebSession
|
||||
return RMUtils.getProjectPath(project);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected WebSessionProjectImpl createGlobalProject(RMProject project) {
|
||||
globalProject = new WebSessionGlobalProjectImpl(this, project);
|
||||
globalProject.refreshAccessibleConnectionIds();
|
||||
return globalProject;
|
||||
}
|
||||
|
||||
private void resetSessionCache() throws DBCException {
|
||||
// Clear attributes
|
||||
synchronized (attributes) {
|
||||
for (Map.Entry<String, ThrowableConsumer<Object, Exception>> attrDisposer : attributeDisposers.entrySet()) {
|
||||
Object attrValue = attributes.get(attrDisposer.getKey());
|
||||
|
||||
try {
|
||||
attrDisposer.getValue().accept(attrValue);
|
||||
} catch (Exception e) {
|
||||
log.error("Error disposing attribute '" + attrDisposer.getKey() + "'", e);
|
||||
}
|
||||
}
|
||||
attributeDisposers.clear();
|
||||
// Remove all non-persistent attributes
|
||||
attributes.entrySet().removeIf(
|
||||
entry -> !(entry.getValue() instanceof PersistentAttribute));
|
||||
}
|
||||
}
|
||||
|
||||
private void resetNavigationModel() {
|
||||
getWorkspace().getProjects().forEach(WebSessionProjectImpl::dispose);
|
||||
navigatorModelLock.writeLock().lock();
|
||||
try {
|
||||
getWorkspace().getProjects().forEach(WebSessionProjectImpl::dispose);
|
||||
|
||||
if (this.navigatorModel != null) {
|
||||
this.navigatorModel.dispose();
|
||||
this.navigatorModel = null;
|
||||
if (this.navigatorModel != null) {
|
||||
this.navigatorModel.dispose();
|
||||
this.navigatorModel = null;
|
||||
}
|
||||
} finally {
|
||||
navigatorModelLock.writeLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,15 +428,25 @@ public class WebSession extends BaseWebSession
|
||||
|
||||
@Nullable
|
||||
public DBNModel getNavigatorModel() {
|
||||
return navigatorModel;
|
||||
navigatorModelLock.readLock().lock();
|
||||
try {
|
||||
return navigatorModel;
|
||||
} finally {
|
||||
navigatorModelLock.readLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DBNModel getNavigatorModelOrThrow() throws DBWebException {
|
||||
if (navigatorModel != null) {
|
||||
return navigatorModel;
|
||||
navigatorModelLock.readLock().lock();
|
||||
try {
|
||||
if (navigatorModel != null) {
|
||||
return navigatorModel;
|
||||
}
|
||||
throw new DBWebException("Navigator model is not found in session");
|
||||
} finally {
|
||||
navigatorModelLock.readLock().unlock();
|
||||
}
|
||||
throw new DBWebException("Navigator model is not found in session");
|
||||
}
|
||||
/**
|
||||
* Returns and clears progress messages
|
||||
@@ -449,7 +460,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
}
|
||||
|
||||
public synchronized void updateInfo(boolean isOldHttpSessionUsed) {
|
||||
public void updateInfo(boolean isOldHttpSessionUsed) {
|
||||
log.trace("Update session lifetime " + getSessionId() + " for user " + getUserId());
|
||||
touchSession();
|
||||
if (isOldHttpSessionUsed) {
|
||||
@@ -513,6 +524,7 @@ public class WebSession extends BaseWebSession
|
||||
super.close(clearTokens, sendSessionExpiredEvent);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<WebAuthInfo> clearAuthTokens() throws DBException {
|
||||
ArrayList<WebAuthInfo> tokensCopy;
|
||||
synchronized (authTokens) {
|
||||
@@ -642,11 +654,11 @@ public class WebSession extends BaseWebSession
|
||||
return asyncTask;
|
||||
}
|
||||
|
||||
public void addSessionError(Throwable exception) {
|
||||
public void addSessionError(@NotNull Throwable exception) {
|
||||
addSessionMessage(new WebServerMessage(exception));
|
||||
}
|
||||
|
||||
public void addSessionMessage(WebServerMessage message) {
|
||||
public void addSessionMessage(@NotNull WebServerMessage message) {
|
||||
synchronized (sessionMessages) {
|
||||
sessionMessages.add(message);
|
||||
}
|
||||
@@ -657,14 +669,15 @@ public class WebSession extends BaseWebSession
|
||||
message.getMessage()));
|
||||
}
|
||||
|
||||
public void addInfoMessage(String message) {
|
||||
public void addInfoMessage(@NotNull String message) {
|
||||
addSessionMessage(new WebServerMessage(MessageType.INFO, message));
|
||||
}
|
||||
|
||||
public void addWarningMessage(String message) {
|
||||
public void addWarningMessage(@NotNull String message) {
|
||||
addSessionMessage(new WebServerMessage(MessageType.WARNING, message));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<WebServerMessage> readLog(Integer maxEntries, Boolean clearLog) {
|
||||
synchronized (sessionMessages) {
|
||||
List<WebServerMessage> messages = new ArrayList<>();
|
||||
@@ -684,46 +697,6 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getAttribute(String name) {
|
||||
synchronized (attributes) {
|
||||
Object value = attributes.get(name);
|
||||
if (value instanceof PersistentAttribute persistentAttribute) {
|
||||
value = persistentAttribute.value();
|
||||
}
|
||||
return (T) value;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAttribute(String name, Object value, boolean persistent) {
|
||||
synchronized (attributes) {
|
||||
attributes.put(name, persistent ? new PersistentAttribute(value) : value);
|
||||
}
|
||||
}
|
||||
|
||||
public <T, E extends Exception> T getAttribute(
|
||||
String name,
|
||||
ThrowableFunction<String, T, E> creator,
|
||||
ThrowableConsumer<T, E> disposer
|
||||
) throws E {
|
||||
synchronized (attributes) {
|
||||
Object value = attributes.get(name);
|
||||
if (value instanceof PersistentAttribute persistentAttribute) {
|
||||
value = persistentAttribute.value();
|
||||
}
|
||||
if (value == null) {
|
||||
value = creator.apply(null);
|
||||
if (value != null) {
|
||||
attributes.put(name, value);
|
||||
if (disposer != null) {
|
||||
attributeDisposers.put(name, (ThrowableConsumer<Object, Exception>) disposer);
|
||||
}
|
||||
}
|
||||
}
|
||||
return (T) value;
|
||||
}
|
||||
}
|
||||
|
||||
@Property
|
||||
public Map<String, Object> getActionParameters() {
|
||||
WebActionParameters action = WebActionParameters.fromSession(this, true);
|
||||
@@ -752,7 +725,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public List<WebAuthInfo> getAllAuthInfo() {
|
||||
synchronized (authTokens) {
|
||||
return new ArrayList<>(authTokens);
|
||||
@@ -804,7 +777,7 @@ public class WebSession extends BaseWebSession
|
||||
});
|
||||
}
|
||||
|
||||
private void removeAuthInfo(WebAuthInfo oldAuthInfo) {
|
||||
private void removeAuthInfo(@NotNull WebAuthInfo oldAuthInfo) {
|
||||
oldAuthInfo.closeAuth();
|
||||
synchronized (authTokens) {
|
||||
authTokens.remove(oldAuthInfo);
|
||||
@@ -830,6 +803,7 @@ public class WebSession extends BaseWebSession
|
||||
return oldInfo;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public List<DBACredentialsProvider> getContextCredentialsProviders() {
|
||||
return getAdapters(DBACredentialsProvider.class);
|
||||
}
|
||||
@@ -917,11 +891,11 @@ public class WebSession extends BaseWebSession
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public synchronized void resetAuthToken() throws DBException {
|
||||
public void resetAuthToken() throws DBException {
|
||||
this.userContext.reset();
|
||||
}
|
||||
|
||||
public synchronized boolean updateSMSession(SMAuthInfo smAuthInfo) throws DBException {
|
||||
public boolean updateSMSession(SMAuthInfo smAuthInfo) throws DBException {
|
||||
boolean contextChanged = super.updateSMSession(smAuthInfo);
|
||||
if (contextChanged) {
|
||||
refreshUserData();
|
||||
@@ -940,7 +914,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public WebSessionProjectImpl getProjectById(@Nullable String projectId) {
|
||||
public WebSessionProjectImpl getProjectById(@NotNull String projectId) {
|
||||
return getWorkspace().getProjectById(projectId);
|
||||
}
|
||||
|
||||
@@ -949,6 +923,7 @@ public class WebSession extends BaseWebSession
|
||||
*
|
||||
* @throws DBWebException if project with provided id is not found.
|
||||
*/
|
||||
@NotNull
|
||||
public WebSessionProjectImpl getAccessibleProjectById(@Nullable String projectId) throws DBWebException {
|
||||
WebSessionProjectImpl project = null;
|
||||
if (projectId != null) {
|
||||
@@ -960,6 +935,7 @@ public class WebSession extends BaseWebSession
|
||||
return project;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<WebSessionProjectImpl> getAccessibleProjects() {
|
||||
return getWorkspace().getProjects();
|
||||
}
|
||||
@@ -969,26 +945,35 @@ public class WebSession extends BaseWebSession
|
||||
*/
|
||||
public void addSessionProject(@NotNull WebSessionProjectImpl project) {
|
||||
getWorkspace().addProject(project);
|
||||
if (navigatorModel != null) {
|
||||
navigatorModel.getRoot().addProject(project, false);
|
||||
navigatorModelLock.readLock().lock();
|
||||
try {
|
||||
if (navigatorModel != null) {
|
||||
navigatorModel.getRoot().addProject(project, false);
|
||||
}
|
||||
} finally {
|
||||
navigatorModelLock.readLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes project from session cache and navigator tree.
|
||||
*/
|
||||
public void deleteSessionProject(@Nullable WebSessionProjectImpl project) {
|
||||
if (project != null) {
|
||||
RMProject rmProject = project.getRMProject();
|
||||
log.info(String.format(
|
||||
"Project deleted: [ID=%s, Name=%s, Type=%s, Creator=%s]",
|
||||
rmProject.getId(), rmProject.getName(), rmProject.getType(), rmProject.getCreator()
|
||||
));
|
||||
project.dispose();
|
||||
}
|
||||
public void deleteSessionProject(@NotNull WebSessionProjectImpl project) {
|
||||
RMProject rmProject = project.getRMProject();
|
||||
log.info(String.format(
|
||||
"Project deleted: [ID=%s, Name=%s, Type=%s, Creator=%s]",
|
||||
rmProject.getId(), rmProject.getName(), rmProject.getType(), rmProject.getCreator()
|
||||
));
|
||||
project.dispose();
|
||||
|
||||
getWorkspace().removeProject(project);
|
||||
if (navigatorModel != null) {
|
||||
navigatorModel.getRoot().removeProject(project);
|
||||
navigatorModelLock.readLock().lock();
|
||||
try {
|
||||
if (navigatorModel != null) {
|
||||
navigatorModel.getRoot().removeProject(project);
|
||||
}
|
||||
} finally {
|
||||
navigatorModelLock.readLock().unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -996,6 +981,10 @@ public class WebSession extends BaseWebSession
|
||||
public void addSessionProject(@NotNull String projectId) throws DBException {
|
||||
super.addSessionProject(projectId);
|
||||
var rmProject = getRmController().getProject(projectId, false, false);
|
||||
if (rmProject == null) {
|
||||
log.error("RM project '" + projectId + "' not found");
|
||||
return;
|
||||
}
|
||||
createWebProject(rmProject);
|
||||
}
|
||||
|
||||
@@ -1010,7 +999,7 @@ public class WebSession extends BaseWebSession
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSessionProject(@Nullable String projectId) throws DBException {
|
||||
public void removeSessionProject(@NotNull String projectId) throws DBException {
|
||||
super.removeSessionProject(projectId);
|
||||
var project = getProjectById(projectId);
|
||||
if (project == null) {
|
||||
@@ -1081,6 +1070,4 @@ public class WebSession extends BaseWebSession
|
||||
return true;
|
||||
}
|
||||
|
||||
private record PersistentAttribute(Object value) {
|
||||
}
|
||||
}
|
||||
|
||||
+54
-22
@@ -19,9 +19,12 @@ package io.cloudbeaver.model.session;
|
||||
import io.cloudbeaver.WebSessionProjectImpl;
|
||||
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.DBPAdaptable;
|
||||
import org.jkiss.dbeaver.model.DBPImage;
|
||||
import org.jkiss.dbeaver.model.app.DBPPlatform;
|
||||
import org.jkiss.dbeaver.model.app.DBPProject;
|
||||
import org.jkiss.dbeaver.model.app.DBPWorkspace;
|
||||
import org.jkiss.dbeaver.model.impl.auth.SessionContextImpl;
|
||||
import org.jkiss.dbeaver.model.rm.RMUtils;
|
||||
@@ -36,6 +39,7 @@ import java.util.List;
|
||||
* Web workspace
|
||||
*/
|
||||
public class WebSessionWorkspace implements DBPWorkspace {
|
||||
private static final Log log = Log.getLog(WebSessionWorkspace.class);
|
||||
|
||||
private final BaseWebSession session;
|
||||
private final SessionContextImpl workspaceAuthContext;
|
||||
@@ -87,7 +91,9 @@ public class WebSessionWorkspace implements DBPWorkspace {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<WebSessionProjectImpl> getProjects() {
|
||||
return accessibleProjects;
|
||||
synchronized (accessibleProjects) {
|
||||
return new ArrayList<>(accessibleProjects);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -99,26 +105,30 @@ public class WebSessionWorkspace implements DBPWorkspace {
|
||||
@Nullable
|
||||
@Override
|
||||
public WebSessionProjectImpl getProject(@NotNull String projectName) {
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
if (project.getName().equals(projectName)) {
|
||||
return project;
|
||||
synchronized (accessibleProjects) {
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
if (project.getName().equals(projectName)) {
|
||||
return project;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.error("Project name '" + projectName + "' not found in session workspace");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public WebSessionProjectImpl getProjectById(@Nullable String projectId) {
|
||||
if (projectId == null) {
|
||||
return activeProject;
|
||||
}
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
if (project.getId().equals(projectId)) {
|
||||
return project;
|
||||
public WebSessionProjectImpl getProjectById(@NotNull String projectId) {
|
||||
synchronized (accessibleProjects) {
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
if (project.getId().equals(projectId)) {
|
||||
return project;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
log.error("Project ID '" + projectId + "' not found in session workspace");
|
||||
// FIXME: return null here
|
||||
return activeProject;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -143,25 +153,47 @@ public class WebSessionWorkspace implements DBPWorkspace {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setActiveProject(WebSessionProjectImpl activeProject) {
|
||||
@NotNull
|
||||
@Override
|
||||
public WebSessionProjectImpl createProject(@NotNull String name, @Nullable String description) throws DBException {
|
||||
throw new DBException("Project creation is not supported in web session workspace");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProject(@NotNull DBPProject project) throws DBException {
|
||||
throw new DBException("Project removing is not supported in web session workspace");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renameProject(@NotNull DBPProject project, @NotNull String newName) throws DBException {
|
||||
throw new DBException("Project renaming is not supported in web session workspace");
|
||||
}
|
||||
|
||||
public void setActiveProject(@NotNull WebSessionProjectImpl activeProject) {
|
||||
this.activeProject = activeProject;
|
||||
}
|
||||
|
||||
void addProject(WebSessionProjectImpl project) {
|
||||
accessibleProjects.add(project);
|
||||
void addProject(@NotNull WebSessionProjectImpl project) {
|
||||
synchronized (accessibleProjects) {
|
||||
accessibleProjects.add(project);
|
||||
}
|
||||
}
|
||||
|
||||
void removeProject(WebSessionProjectImpl project) {
|
||||
accessibleProjects.remove(project);
|
||||
void removeProject(@NotNull WebSessionProjectImpl project) {
|
||||
synchronized (accessibleProjects) {
|
||||
accessibleProjects.remove(project);
|
||||
}
|
||||
}
|
||||
|
||||
void clearProjects() {
|
||||
if (!this.accessibleProjects.isEmpty()) {
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
project.dispose();
|
||||
synchronized (accessibleProjects) {
|
||||
if (!this.accessibleProjects.isEmpty()) {
|
||||
for (WebSessionProjectImpl project : accessibleProjects) {
|
||||
project.dispose();
|
||||
}
|
||||
this.activeProject = null;
|
||||
this.accessibleProjects.clear();
|
||||
}
|
||||
this.activeProject = null;
|
||||
this.accessibleProjects.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+23
-16
@@ -53,9 +53,9 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
private final ServletApplication application;
|
||||
private final DBPWorkspace workspace;
|
||||
|
||||
private WebUser user;
|
||||
private Set<String> userPermissions;
|
||||
private SMCredentials smCredentials = null;
|
||||
private volatile WebUser user;
|
||||
private volatile Set<String> userPermissions;
|
||||
private volatile SMCredentials smCredentials = null;
|
||||
private String smSessionId;
|
||||
private String refreshToken;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
* @return - true if context changed
|
||||
* @throws DBException - if user already authorized and new token come from another user
|
||||
*/
|
||||
public synchronized boolean refresh(@NotNull SMAuthInfo smAuthInfo) throws DBException {
|
||||
public boolean refresh(@NotNull SMAuthInfo smAuthInfo) throws DBException {
|
||||
if (smAuthInfo.getAuthPermissions() == null && !isAuthorizedInSecurityManager()) {
|
||||
throw new DBCException("Required information about session permissions is missing");
|
||||
}
|
||||
@@ -175,53 +175,56 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public synchronized SMController getSecurityController() {
|
||||
public SMController getSecurityController() {
|
||||
return securityController;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public synchronized SMCredentials getActiveUserCredentials() {
|
||||
public SMCredentials getActiveUserCredentials() {
|
||||
return smCredentials;
|
||||
}
|
||||
|
||||
public synchronized boolean isAuthorizedInSecurityManager() {
|
||||
public boolean isAuthorizedInSecurityManager() {
|
||||
return smCredentials != null;
|
||||
}
|
||||
|
||||
public synchronized boolean isNonAnonymousUserAuthorizedInSM() {
|
||||
public boolean isNonAnonymousUserAuthorizedInSM() {
|
||||
return isAuthorizedInSecurityManager() && getUser() != null;
|
||||
}
|
||||
|
||||
public synchronized boolean isAnonymousUserAuthorizedInSM() {
|
||||
public boolean isAnonymousUserAuthorizedInSM() {
|
||||
return isAuthorizedInSecurityManager() && getUser() == null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public synchronized WebUser getUser() {
|
||||
public WebUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public synchronized String getUserId() {
|
||||
@Nullable
|
||||
public String getUserId() {
|
||||
return user == null ? null : user.getUserId();
|
||||
}
|
||||
|
||||
protected synchronized void setUser(@Nullable WebUser user) {
|
||||
protected void setUser(@Nullable WebUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public synchronized SMAdminController getAdminSecurityController() {
|
||||
@NotNull
|
||||
public SMAdminController getAdminSecurityController() {
|
||||
return adminSecurityController;
|
||||
}
|
||||
|
||||
public synchronized Set<String> getUserPermissions() {
|
||||
@Nullable
|
||||
public Set<String> getUserPermissions() {
|
||||
return userPermissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* reread the current user's permissions
|
||||
*/
|
||||
public synchronized void refreshPermissions() throws DBException {
|
||||
public void refreshPermissions() throws DBException {
|
||||
if (isAuthorizedInSecurityManager()) {
|
||||
log.debug("refresh permissions " + getUserId() + " " + getSmSessionId());
|
||||
setUserPermissions(securityController.getTokenPermissions().getPermissions());
|
||||
@@ -234,6 +237,7 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
this.userPermissions = permissions;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DBSSecretController getSecretController() throws DBException {
|
||||
if (this.securityController == null) {
|
||||
this.secretController = application.getSecretController(this, workspace.getAuthContext());
|
||||
@@ -241,7 +245,8 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
return secretController;
|
||||
}
|
||||
|
||||
public synchronized String getSmSessionId() {
|
||||
@NotNull
|
||||
public String getSmSessionId() {
|
||||
return smSessionId;
|
||||
}
|
||||
|
||||
@@ -255,6 +260,7 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
return rmController;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DBFileController getFileController() {
|
||||
return fileController;
|
||||
}
|
||||
@@ -268,6 +274,7 @@ public class WebUserContext implements SMCredentialsProvider {
|
||||
this.refreshToken = refreshToken;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public WebSessionPreferenceStore getPreferenceStore() {
|
||||
return preferenceStore;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,50 +28,34 @@ public class CBConstants {
|
||||
public static final String RUNTIME_PRODUCT_CONFIG_FILE_NAME = ".product.runtime.conf";
|
||||
public static final String AUTO_CONFIG_FILE_NAME = ".cloudbeaver.auto.conf";
|
||||
|
||||
public static final String PARAM_SERVER_CONFIGURATION = "server";
|
||||
public static final String PARAM_SERVER_PORT = "serverPort";
|
||||
public static final String PARAM_SERVER_HOST = "serverHost";
|
||||
public static final String PARAM_SERVER_NAME = "serverName";
|
||||
public static final String PARAM_FORCE_HTTPS = "forceHttps";
|
||||
public static final String PARAM_BIND_SESSION_TO_IP = "bindSessionToIp";
|
||||
public static final String PARAM_SUPPORTED_HOSTS = "supportedHosts";
|
||||
public static final String PARAM_SSL_CONFIGURATION_PATH = "sslConfigurationPath";
|
||||
public static final String PARAM_CONTENT_ROOT = "contentRoot";
|
||||
public static final String PARAM_SERVER_URL = "serverURL";
|
||||
public static final String PARAM_ROOT_URI = "rootURI";
|
||||
public static final String PARAM_SERVICES_URI = "serviceURI";
|
||||
public static final String PARAM_DRIVERS_LOCATION = "driversLocation";
|
||||
public static final String PARAM_WORKSPACE_LOCATION = "workspaceLocation";
|
||||
//legacy path to a product.conf file
|
||||
@Deprecated
|
||||
public static final String PARAM_PRODUCT_CONFIGURATION = "productConfiguration";
|
||||
public static final String PARAM_PRODUCT_SETTINGS = "productSettings";
|
||||
public static final String PARAM_EXTERNAL_PROPERTIES = "externalProperties";
|
||||
public static final String PARAM_STATIC_CONTENT = "staticContent";
|
||||
public static final String PARAM_RESOURCE_QUOTAS = "resourceQuotas";
|
||||
public static final String PARAM_RESOURCE_MANAGER_ENABLED = "resourceManagerEnabled";
|
||||
public static final String PARAM_SECRET_MANAGER_ENABLED = "secretManagerEnabled";
|
||||
public static final String PARAM_SHOW_READ_ONLY_CONN_INFO = "showReadOnlyConnectionInfo";
|
||||
public static final String PARAM_CONN_GRANT_ANON_ACCESS = "grantConnectionsAccessToAnonymousTeam";
|
||||
public static final String PARAM_AUTH_PROVIDERS = "authConfiguration";
|
||||
public static final String PARAM_DB_CONFIGURATION = "database";
|
||||
|
||||
public static final String PARAM_SESSION_EXPIRE_PERIOD = "expireSessionAfterPeriod";
|
||||
|
||||
public static final String PARAM_DEVEL_MODE = "develMode";
|
||||
public static final String PARAM_SECURITY_MANAGER = "enableSecurityManager";
|
||||
public static final String PARAM_SM_CONFIGURATION = "sm";
|
||||
public static final String PARAM_PASSWORD_POLICY_CONFIGURATION = "passwordPolicy";
|
||||
|
||||
public static final int DEFAULT_SERVER_PORT = 8080;
|
||||
//public static final String DEFAULT_SERVER_NAME = "CloudBeaver Web Server";
|
||||
|
||||
public static final String DEFAULT_CONTENT_ROOT = "/var/www/cloudbeaver";
|
||||
public static final String DEFAULT_ROOT_URI = "/";
|
||||
public static final String DEFAULT_SERVICES_URI = "/api/";
|
||||
|
||||
public static final String DEFAULT_DEPLOY_LOCATION = "/opt/cloudbeaver";
|
||||
public static final String DEFAULT_DRIVERS_LOCATION = DEFAULT_DEPLOY_LOCATION + "/drivers";
|
||||
public static final String DEFAULT_WORKSPACE_LOCATION = DEFAULT_DEPLOY_LOCATION + "/workspace";
|
||||
public static final String DEFAULT_PRODUCT_CONFIGURATION = "conf/product.conf";
|
||||
public static final String DEFAULT_DATASOURCE_PERMISSIONS_CONFIGURATION = "data-sources-permissions.json";
|
||||
public static final String DEFAULT_ADMIN_NAME = "cbadmin";
|
||||
@@ -84,14 +68,11 @@ public class CBConstants {
|
||||
public static final String VAR_HOST_DOCKER_INTERNAL = "host.docker.internal";
|
||||
|
||||
public static final String VAR_AUTO_CB_SERVER_NAME = "CB_SERVER_NAME";
|
||||
public static final String VAR_AUTO_CB_SERVER_URL = "CB_SERVER_URL";
|
||||
public static final String VAR_AUTO_CB_ADMIN_NAME = "CB_ADMIN_NAME";
|
||||
public static final String VAR_AUTO_CB_ADMIN_PASSWORD = "CB_ADMIN_PASSWORD";
|
||||
|
||||
public static final String CB_SESSION_COOKIE_NAME = "cb-session-id";
|
||||
|
||||
public static final String APPLICATION_JSON = "application/json";
|
||||
|
||||
public static final String ADMIN_AUTO_GRANT = "auto-grant";
|
||||
public static final String HOST_LOCALHOST = "localhost";
|
||||
public static final String HOST_127_0_0_1 = "127.0.0.1";
|
||||
@@ -99,4 +80,6 @@ public class CBConstants {
|
||||
public static final String BIND_SESSION_ENABLE = "enable";
|
||||
public static final String BIND_SESSION_DISABLE = "disable";
|
||||
public static final String DEFAULT_CLOUD_PROJECT_NAME = "GlobalConfiguration";
|
||||
|
||||
public static final String SECURED_VALUE = "******";
|
||||
}
|
||||
|
||||
+13
-4
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package io.cloudbeaver.service.sql;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.data.DBDAttributeConstraint;
|
||||
import org.jkiss.dbeaver.model.gis.DBGeometry;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
@@ -27,6 +28,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class WebSQLDataFilterConstraint {
|
||||
|
||||
private String attributeName;
|
||||
private Integer attributePosition;
|
||||
private Integer orderPosition;
|
||||
private Boolean orderAsc;
|
||||
@@ -38,8 +40,9 @@ public class WebSQLDataFilterConstraint {
|
||||
private WebSQLDataFilterConstraint() {
|
||||
}
|
||||
|
||||
public WebSQLDataFilterConstraint(Map<String, Object> map) {
|
||||
this.attributePosition = CommonUtils.toInt(map.get("attributePosition"));
|
||||
public WebSQLDataFilterConstraint(@NotNull Map<String, Object> map) {
|
||||
this.attributeName = CommonUtils.toString(map.get("attributeName"));
|
||||
this.attributePosition = CommonUtils.toInteger(map.get("attributePosition"), null);
|
||||
this.orderPosition = map.containsKey("orderPosition") ?
|
||||
CommonUtils.toInt(map.get("orderPosition")) + 1 : // Use position + 1 because 0 means no ordering (because of legacy compatibility)
|
||||
null;
|
||||
@@ -64,8 +67,10 @@ public class WebSQLDataFilterConstraint {
|
||||
|
||||
}
|
||||
|
||||
public static WebSQLDataFilterConstraint from(DBDAttributeConstraint constraint) {
|
||||
@NotNull
|
||||
public static WebSQLDataFilterConstraint from(@NotNull DBDAttributeConstraint constraint) {
|
||||
var webConstraint = new WebSQLDataFilterConstraint();
|
||||
webConstraint.attributeName = constraint.getAttributeName();
|
||||
webConstraint.orderPosition = constraint.getOrderPosition();
|
||||
webConstraint.orderAsc = !constraint.isOrderDescending();
|
||||
webConstraint.criteria = constraint.getCriteria();
|
||||
@@ -76,6 +81,10 @@ public class WebSQLDataFilterConstraint {
|
||||
return webConstraint;
|
||||
}
|
||||
|
||||
public String getAttributeName() {
|
||||
return attributeName;
|
||||
}
|
||||
|
||||
public Integer getAttributePosition() {
|
||||
return attributePosition;
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package io.cloudbeaver.service.sql;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
|
||||
public record WebSQLQueryParameterRecord(@NotNull String name, @Nullable String value) {
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.model.data.json.JSONUtils;
|
||||
import org.jkiss.dbeaver.utils.GeneralUtils;
|
||||
import org.jkiss.utils.HttpConstants;
|
||||
|
||||
import java.net.CookieManager;
|
||||
import java.net.URI;
|
||||
@@ -112,12 +113,22 @@ public class WebGQLClient {
|
||||
@NotNull String query,
|
||||
@Nullable Map<String, Object> variables,
|
||||
@NotNull Map<String, String> requestHeaders
|
||||
) throws Exception {
|
||||
return executeGQLRequest(query, variables, requestHeaders, "result");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Map<String, Object> executeGQLRequest(
|
||||
@NotNull String query,
|
||||
@Nullable Map<String, Object> variables,
|
||||
@NotNull Map<String, String> requestHeaders,
|
||||
@NotNull String resultName
|
||||
) throws Exception {
|
||||
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
|
||||
.uri(URI.create(apiUrl))
|
||||
.POST(HttpRequest.BodyPublishers.ofString(makeGQLRequest(query, variables)))
|
||||
.setHeader("TE-Client-Version", GeneralUtils.getMajorVersion())
|
||||
.header("Content-Type", "application/json");
|
||||
.header(HttpConstants.HEADER_CONTENT_TYPE, HttpConstants.CONTENT_TYPE_JSON);
|
||||
if (!requestHeaders.isEmpty()) {
|
||||
requestHeaders.forEach(requestBuilder::header);
|
||||
}
|
||||
@@ -132,7 +143,7 @@ public class WebGQLClient {
|
||||
throw new DBException(message);
|
||||
}
|
||||
Map<String, Object> parsed = new LinkedHashMap<>();
|
||||
parsed.put("data", JSONUtils.getObject(body, "data").get("result"));
|
||||
parsed.put("data", JSONUtils.getObject(body, "data").get(resultName));
|
||||
parsed.put("headers", response.headers().map());
|
||||
return parsed;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -47,6 +47,8 @@ public class ServletAppUtils {
|
||||
private static final String HEADER_REFERER = "Referer";
|
||||
|
||||
private static final String HEADER_FORWARDED_SCHEME = "X-Forwarded-Scheme";
|
||||
private static final String HEADER_FORWARDED_PROTO = "X-Forwarded-Proto";
|
||||
private static final String HEADER_FORWARDED_PORT = "X-Forwarded-Port";
|
||||
private static final String HEADER_FORWARDED_HOST = "X-Forwarded-Host";
|
||||
private static final Set<Integer> DEFAULT_PORTS = Set.of(
|
||||
80,
|
||||
@@ -294,19 +296,37 @@ public class ServletAppUtils {
|
||||
@NotNull
|
||||
public static String getOriginFromRequest(@NotNull HttpServletRequest request) {
|
||||
String origin = request.getHeader(HEADER_ORIGIN);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Origin header: " + origin);
|
||||
}
|
||||
if (CommonUtils.isEmpty(origin)) {
|
||||
origin = request.getHeader(HEADER_X_ORIGIN);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("X-Origin header: " + origin);
|
||||
}
|
||||
}
|
||||
if (CommonUtils.isEmpty(origin)) {
|
||||
origin = request.getHeader(HEADER_REFERER);
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Referer header: " + origin);
|
||||
}
|
||||
}
|
||||
String forwardedScheme = request.getHeader(HEADER_FORWARDED_SCHEME);
|
||||
if (CommonUtils.isEmpty(forwardedScheme)) {
|
||||
forwardedScheme = request.getHeader(HEADER_FORWARDED_PROTO);
|
||||
}
|
||||
String forwardedHost = request.getHeader(HEADER_FORWARDED_HOST);
|
||||
if (CommonUtils.isNotEmpty(forwardedScheme) && CommonUtils.isNotEmpty(forwardedHost)) {
|
||||
origin = forwardedScheme + "://" + forwardedHost;
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("forwarded origin: " + origin);
|
||||
}
|
||||
}
|
||||
if (CommonUtils.isEmpty(origin)) {
|
||||
URI requestUrl = URI.create(request.getRequestURL().toString());
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Request URL: " + requestUrl);
|
||||
}
|
||||
origin = getRootUrlFromUri(requestUrl) + "/";
|
||||
}
|
||||
origin = removeSideSlashes(origin);
|
||||
@@ -318,7 +338,15 @@ public class ServletAppUtils {
|
||||
|
||||
origin = removeSideSlashes(origin);
|
||||
URI uri = URI.create(origin);
|
||||
if (DEFAULT_PORTS.contains(uri.getPort())) {
|
||||
int port = uri.getPort();
|
||||
if (CommonUtils.isNotEmpty(request.getHeader(HEADER_FORWARDED_PORT))) {
|
||||
try {
|
||||
port = Integer.parseInt(request.getHeader(HEADER_FORWARDED_PORT));
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("Failed to parse port from header: " + request.getHeader(HEADER_FORWARDED_PORT), e);
|
||||
}
|
||||
}
|
||||
if (DEFAULT_PORTS.contains(port)) {
|
||||
try {
|
||||
origin = new URI(
|
||||
uri.getScheme(),
|
||||
@@ -333,6 +361,9 @@ public class ServletAppUtils {
|
||||
log.error("Failed to create URI without port", e);
|
||||
}
|
||||
}
|
||||
if (log.isTraceEnabled()) {
|
||||
log.trace("Origin URI: " + origin);
|
||||
}
|
||||
|
||||
return origin;
|
||||
}
|
||||
|
||||
+5
-4
@@ -16,23 +16,24 @@
|
||||
*/
|
||||
package io.cloudbeaver.websocket.event.task;
|
||||
|
||||
import io.cloudbeaver.service.sql.WebSQLQueryParameterRecord;
|
||||
import org.jkiss.code.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
public class WSSessionTaskQueryParamsConfirmationEvent extends WSAbstractSessionTaskEvent {
|
||||
private static final String ID = "cb_session_task_query_params_confirmation_request";
|
||||
@NotNull
|
||||
private final String query;
|
||||
@NotNull
|
||||
private final Map<String, Object> parameters;
|
||||
private final List<WebSQLQueryParameterRecord> parameters;
|
||||
|
||||
public WSSessionTaskQueryParamsConfirmationEvent(
|
||||
@NotNull String taskId,
|
||||
@NotNull String title,
|
||||
@NotNull String message,
|
||||
@NotNull String query,
|
||||
@NotNull Map<String, Object> parameters
|
||||
@NotNull List<WebSQLQueryParameterRecord> parameters
|
||||
) {
|
||||
super(ID, taskId, title, message);
|
||||
this.query = query;
|
||||
@@ -45,7 +46,7 @@ public class WSSessionTaskQueryParamsConfirmationEvent extends WSAbstractSession
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Map<String, Object> getParameters() {
|
||||
public List<WebSQLQueryParameterRecord> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Community Product
|
||||
Bundle-SymbolicName: io.cloudbeaver.product.ce;singleton:=true
|
||||
Bundle-Version: 25.3.4.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 26.0.2.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: io.cloudbeaver.server.ce
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
</extension>
|
||||
|
||||
<extension point="org.eclipse.core.runtime.products" id="product">
|
||||
<product application="io.cloudbeaver.product.ce.application" description="CloudBeaver CE Web UI Application"
|
||||
name="CloudBeaver CE Server">
|
||||
<property name="appName" value="CloudBeaver CE Server"/>
|
||||
<product application="io.cloudbeaver.product.ce.application" name="CloudBeaver Community">
|
||||
<property name="appName" value="CloudBeaver Community"/>
|
||||
<property name="versionUpdateURL" value="https://dbeaver.com/product/cloudbeaver-ce-version.json"/>
|
||||
</product>
|
||||
</extension>
|
||||
@@ -21,8 +20,7 @@
|
||||
<application
|
||||
id="cloudbeaver-ce"
|
||||
family="CB"
|
||||
name="CloudBeaver CE Server"
|
||||
description="CloudBeaver CE Web UI"
|
||||
name="CloudBeaver Community"
|
||||
server="true"/>
|
||||
</extension>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.product.ce</artifactId>
|
||||
<version>25.3.4-SNAPSHOT</version>
|
||||
<version>26.0.2-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -2,8 +2,8 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Cloudbeaver Base JDBC drivers
|
||||
Bundle-SymbolicName: io.cloudbeaver.resources.drivers.base;singleton:=true
|
||||
Bundle-Version: 1.0.139.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.143.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Automatic-Module-Name: io.cloudbeaver.resources.drivers.base
|
||||
|
||||
@@ -9,6 +9,6 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.resources.drivers.base</artifactId>
|
||||
<version>1.0.139-SNAPSHOT</version>
|
||||
<version>1.0.143-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
</project>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver CE Server
|
||||
Bundle-Name: CloudBeaver Community
|
||||
Bundle-SymbolicName: io.cloudbeaver.server.ce;singleton:=true
|
||||
Bundle-Version: 25.3.4.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 26.0.2.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-Activator: io.cloudbeaver.server.CBPlatformActivator
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.server.ce</artifactId>
|
||||
<version>25.3.4-SNAPSHOT</version>
|
||||
<version>26.0.2-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public class CBWebServerConfig extends WebServerConfig {
|
||||
|
||||
@Property
|
||||
public String getServerURL() {
|
||||
return CommonUtils.notEmpty(cbApp.getServerConfiguration().getServerURL());
|
||||
return ""; // backward compatibility
|
||||
}
|
||||
|
||||
@Property
|
||||
|
||||
-9
@@ -31,7 +31,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
|
||||
private static final Log log = Log.getLog(CBServerConfig.class);
|
||||
|
||||
protected String serverURL;
|
||||
@NotNull
|
||||
protected List<String> supportedHosts = new ArrayList<>();
|
||||
protected boolean forceHttps;
|
||||
@@ -62,10 +61,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
this.securityManagerConfiguration = createSecurityManagerConfiguration();
|
||||
}
|
||||
|
||||
public String getServerURL() {
|
||||
return serverURL;
|
||||
}
|
||||
|
||||
public int getServerPort() {
|
||||
return serverPort;
|
||||
}
|
||||
@@ -108,10 +103,6 @@ public class CBServerConfig implements WebServerConfiguration {
|
||||
return staticContent;
|
||||
}
|
||||
|
||||
public void setServerURL(String serverURL) {
|
||||
this.serverURL = serverURL;
|
||||
}
|
||||
|
||||
public void setServerPort(int serverPort) {
|
||||
this.serverPort = serverPort;
|
||||
}
|
||||
|
||||
@@ -119,11 +119,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
this.homeDirectory = new File(initHomeFolder());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getServerURL() {
|
||||
return getServerConfiguration().getServerURL();
|
||||
}
|
||||
|
||||
// Port this server listens on. If set the 0 a random port is assigned which may be obtained with getLocalPort()
|
||||
@Override
|
||||
public int getServerPort() {
|
||||
@@ -259,9 +254,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
//log.debug("\tProduct details: " + application.getInfoDetails());
|
||||
log.debug("\tListen port: " + getServerPort() + (CommonUtils.isEmpty(getServerHost()) ? " on all interfaces" : " on " + getServerHost()));
|
||||
log.debug("\tBase URI: " + getServicesURI());
|
||||
if (!isConfigurationMode()) {
|
||||
log.debug("\tGlobal access server URL: " + getServerConfiguration().getServerURL());
|
||||
}
|
||||
if (isDevelMode()) {
|
||||
log.debug("\tDevelopment mode");
|
||||
} else {
|
||||
@@ -356,7 +348,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
*/
|
||||
protected void performAutoConfiguration(Path configPath) {
|
||||
String autoServerName = System.getenv(CBConstants.VAR_AUTO_CB_SERVER_NAME);
|
||||
String autoServerURL = System.getenv(CBConstants.VAR_AUTO_CB_SERVER_URL);
|
||||
String autoAdminName = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
|
||||
String autoAdminPassword = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
|
||||
|
||||
@@ -371,7 +362,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
autoProps.load(is);
|
||||
|
||||
autoServerName = autoProps.getProperty(CBConstants.VAR_AUTO_CB_SERVER_NAME);
|
||||
autoServerURL = autoProps.getProperty(CBConstants.VAR_AUTO_CB_SERVER_URL);
|
||||
autoAdminName = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
|
||||
autoAdminPassword = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
|
||||
} catch (IOException e) {
|
||||
@@ -389,7 +379,6 @@ public abstract class CBApplication<T extends CBServerConfig>
|
||||
}
|
||||
CBServerConfig serverConfig = new CBServerConfig();
|
||||
serverConfig.setServerName(autoServerName);
|
||||
serverConfig.setServerURL(autoServerURL);
|
||||
serverConfig.setMaxSessionIdleTime(getMaxSessionIdleTime());
|
||||
try {
|
||||
finishConfiguration(
|
||||
|
||||
@@ -104,4 +104,9 @@ public class CBApplicationCE extends CBApplication<CBServerConfig> {
|
||||
embeddedSecurityController.finishConfiguration(adminName, adminPassword, authInfoList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCommunity() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-16
@@ -56,6 +56,9 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
|
||||
private static final Log log = Log.getLog(CBServerConfigurationController.class);
|
||||
|
||||
private static final String NETWORK_MODE_ENV = "NETWORK_MODE";
|
||||
private static final String NETWORK_MODE_VALUE_HOST = "host";
|
||||
|
||||
// Configurations
|
||||
@NotNull
|
||||
private final T serverConfiguration;
|
||||
@@ -167,12 +170,9 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
|
||||
public T parseServerConfiguration() {
|
||||
var config = getServerConfiguration();
|
||||
if (config.getServerURL() == null) {
|
||||
String hostName = config.getServerHost();
|
||||
if (CommonUtils.isEmpty(hostName)) {
|
||||
hostName = getLocalHostAddress();
|
||||
}
|
||||
config.setServerURL("http://" + hostName + ":" + config.getServerPort());
|
||||
if (NETWORK_MODE_VALUE_HOST.equalsIgnoreCase(System.getenv(NETWORK_MODE_ENV))) {
|
||||
String hostName = getLocalHostAddress();
|
||||
config.setServerHost(hostName);
|
||||
}
|
||||
|
||||
config.setContentRoot(ServletAppUtils.getRelativePath(config.getContentRoot(), homeDirectory));
|
||||
@@ -383,12 +383,6 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public synchronized void updateServerUrl(@NotNull SMCredentialsProvider credentialsProvider,
|
||||
@Nullable String newPublicUrl) throws DBException {
|
||||
getServerConfiguration().setServerURL(newPublicUrl);
|
||||
}
|
||||
|
||||
protected Map<String, Object> collectConfigurationProperties(
|
||||
@NotNull CBServerConfig serverConfig,
|
||||
@NotNull CBAppConfig appConfig
|
||||
@@ -523,10 +517,6 @@ public abstract class CBServerConfigurationController<T extends CBServerConfig>
|
||||
CBConstants.PARAM_SERVER_NAME,
|
||||
serverConfig.getServerName());
|
||||
}
|
||||
if (!CommonUtils.isEmpty(serverConfig.getServerURL())) {
|
||||
copyConfigValue(
|
||||
originServerConfig, serverConfigProperties, CBConstants.PARAM_SERVER_URL, serverConfig.getServerURL());
|
||||
}
|
||||
if (serverConfig.getMaxSessionIdleTime() > 0) {
|
||||
copyConfigValue(
|
||||
originServerConfig,
|
||||
|
||||
+18
-5
@@ -29,11 +29,13 @@ import io.cloudbeaver.server.servlets.WebStatusServlet;
|
||||
import io.cloudbeaver.server.websockets.CBEventsLongPollingServlet;
|
||||
import io.cloudbeaver.server.websockets.CBEventsWebSocket;
|
||||
import io.cloudbeaver.server.websockets.CBWebSocketServerConfigurator;
|
||||
import io.cloudbeaver.server.websockets.lsp.LSPWebSocketConstants;
|
||||
import io.cloudbeaver.server.websockets.lsp.LSPWebSocketEndpoint;
|
||||
import io.cloudbeaver.service.DBWServiceBindingServlet;
|
||||
import io.cloudbeaver.service.DBWServiceBindingWebSocket;
|
||||
import jakarta.websocket.server.ServerEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.servlet.*;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee11.servlet.*;
|
||||
import org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.server.*;
|
||||
import org.eclipse.jetty.util.resource.ResourceFactory;
|
||||
import org.eclipse.jetty.xml.XmlConfiguration;
|
||||
@@ -174,13 +176,24 @@ public class CBJettyServer {
|
||||
|
||||
JakartaWebSocketServletContainerInitializer.configure(servletContextHandler, (context, container) -> {
|
||||
// Add echo endpoint to server container
|
||||
ServerEndpointConfig eventWsEnpoint = ServerEndpointConfig.Builder
|
||||
CBWebSocketServerConfigurator configurator =
|
||||
new CBWebSocketServerConfigurator(application.getSessionManager());
|
||||
|
||||
ServerEndpointConfig eventWsEndpoint = ServerEndpointConfig.Builder
|
||||
.create(
|
||||
CBEventsWebSocket.class,
|
||||
serverConfiguration.getServicesURI() + "ws"
|
||||
).configurator(new CBWebSocketServerConfigurator(application.getSessionManager()))
|
||||
).configurator(configurator)
|
||||
.build();
|
||||
container.addEndpoint(eventWsEnpoint);
|
||||
container.addEndpoint(eventWsEndpoint);
|
||||
|
||||
ServerEndpointConfig lspWsEndpoint = ServerEndpointConfig.Builder
|
||||
.create(
|
||||
LSPWebSocketEndpoint.class,
|
||||
serverConfiguration.getServicesURI() + LSPWebSocketConstants.ENDPOINT_SUFFIX
|
||||
).configurator(configurator)
|
||||
.build();
|
||||
container.addEndpoint(lspWsEndpoint);
|
||||
});
|
||||
|
||||
JettyUtils.initSessionManager(
|
||||
|
||||
-1
@@ -39,7 +39,6 @@ public class CBServerContextListener implements ServletContextListener {
|
||||
//scf.setDomain(domain);
|
||||
//scf.setMaxAge(CB_SESSION_LIFE_TIME);
|
||||
cookieConfig.setPath(CBApplication.getInstance().getRootURI());
|
||||
// cookieConfig.setSecure(application.getServerURL().startsWith("https"));
|
||||
cookieConfig.setHttpOnly(true);
|
||||
cookieConfig.setName(CBConstants.CB_SESSION_COOKIE_NAME);
|
||||
}
|
||||
|
||||
+14
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,6 +33,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class RequestHostFilter implements Filter {
|
||||
private static final Log log = Log.getLog(RequestHostFilter.class);
|
||||
|
||||
@@ -74,9 +75,19 @@ public class RequestHostFilter implements Filter {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
boolean isIpAddress = InetAddresses.isInetAddress(originUri.getHost());
|
||||
|
||||
if (CommonUtils.isNotEmpty(originUri.getHost())) {
|
||||
requestAllowed = InetAddresses.isInetAddress(originUri.getHost());
|
||||
} else {
|
||||
log.debug(
|
||||
"Request origin host is null, request URI - " + originUri +
|
||||
", request path - " + httpRequest.getServletPath() +
|
||||
", request url - " + httpRequest.getRequestURL()
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
String servletPath = httpRequest.getServletPath();
|
||||
requestAllowed = isIpAddress;
|
||||
if (!requestAllowed) {
|
||||
if (CommonUtils.isNotEmpty(servletPath)) {
|
||||
for (String excludedPath : excludedPaths) {
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.annotation.WebServlet;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.eclipse.jetty.ee10.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.ee11.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.http.HttpHeader;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
|
||||
@@ -3,14 +3,15 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Server
|
||||
Bundle-SymbolicName: io.cloudbeaver.server;singleton:=true
|
||||
Bundle-Version: 25.3.4.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 26.0.2.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
|
||||
org.apache.commons.jexl,
|
||||
org.jkiss.utils;visibility:=reexport,
|
||||
org.jkiss.dbeaver.model.sql;visibility:=reexport,
|
||||
org.jkiss.dbeaver.model.lsp,
|
||||
org.jkiss.dbeaver.data.gis,
|
||||
org.jkiss.bundle.jetty.server;visibility:=reexport,
|
||||
com.google.gson;visibility:=reexport,
|
||||
@@ -19,7 +20,8 @@ Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
|
||||
org.jkiss.dbeaver.net.ssh,
|
||||
io.cloudbeaver.model;visibility:=reexport,
|
||||
io.cloudbeaver.model.cli,
|
||||
io.cloudbeaver.service.security;visibility:=reexport
|
||||
io.cloudbeaver.service.security;visibility:=reexport,
|
||||
org.eclipse.lsp4j.websocket.jakarta
|
||||
Export-Package: io.cloudbeaver,
|
||||
io.cloudbeaver.model,
|
||||
io.cloudbeaver.model.app,
|
||||
@@ -33,9 +35,11 @@ Export-Package: io.cloudbeaver,
|
||||
io.cloudbeaver.server.jobs,
|
||||
io.cloudbeaver.server.servlets,
|
||||
io.cloudbeaver.server.websockets,
|
||||
io.cloudbeaver.server.websockets.lsp,
|
||||
io.cloudbeaver.service,
|
||||
io.cloudbeaver.service.navigator,
|
||||
io.cloudbeaver.service.sql
|
||||
Import-Package: org.slf4j
|
||||
Import-Package: org.slf4j,
|
||||
jakarta.websocket
|
||||
Bundle-Localization: OSGI-INF/l10n/bundle
|
||||
Automatic-Module-Name: io.cloudbeaver.server
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</extension>
|
||||
|
||||
<extension point="org.jkiss.dbeaver.ws.event.handler">
|
||||
<eventHandler class="io.cloudbeaver.server.events.WSDefaultEventHandler">
|
||||
<eventHandler class="io.cloudbeaver.server.events.WSServerConfigurationChangedEventHandler">
|
||||
<topic id="cb_config"/>
|
||||
</eventHandler>
|
||||
<eventHandler class="io.cloudbeaver.server.events.WSDataSourceUpdatedEventHandlerImpl">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.server</artifactId>
|
||||
<version>25.3.4-SNAPSHOT</version>
|
||||
<version>26.0.2-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -825,7 +825,7 @@ extend type Mutation {
|
||||
testConnection( config: ConnectionConfig!, projectId: ID): ConnectionInfo!
|
||||
|
||||
"Test network handler connectivity"
|
||||
testNetworkHandler( config: NetworkHandlerConfigInput! ): NetworkEndpointInfo!
|
||||
testNetworkHandler(projectId: ID, connectionId: ID, config: NetworkHandlerConfigInput! ): NetworkEndpointInfo!
|
||||
|
||||
"Initiate database connection. User credentials may be (optionally) override default settings."
|
||||
initConnection(
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
####################################################
|
||||
extend enum CBServerEventId {
|
||||
|
||||
"Datasource created"
|
||||
cb_datasource_created,
|
||||
"Datasource updated"
|
||||
cb_datasource_updated,
|
||||
"Datasource deleted"
|
||||
cb_datasource_deleted,
|
||||
|
||||
"Datasource folder created"
|
||||
cb_datasource_folder_created,
|
||||
"Datasource folder updated"
|
||||
cb_datasource_folder_updated,
|
||||
"Datasource folder deleted"
|
||||
cb_datasource_folder_deleted,
|
||||
|
||||
"Datasource disconnected"
|
||||
cb_datasource_disconnected,
|
||||
"Datasource connected"
|
||||
cb_datasource_connected
|
||||
}
|
||||
|
||||
extend enum CBEventTopic {
|
||||
cb_datasource,
|
||||
cb_datasource_folder,
|
||||
cb_datasource_connection
|
||||
}
|
||||
|
||||
"Datasource folder event"
|
||||
type CBDatasourceFolderEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
nodePaths: [String!]! # list of folders node ids
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Datasource event"
|
||||
type CBDatasourceEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
dataSourceIds: [String!]! # list of datasources ids
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Datasource disconnect event"
|
||||
type WSDataSourceDisconnectEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
connectionId: String!
|
||||
projectId: String!
|
||||
timestamp: Int!
|
||||
}
|
||||
"Datasource connect event"
|
||||
type WSDataSourceConnectEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
connectionId: String!
|
||||
projectId: String!
|
||||
timestamp: Int!
|
||||
}
|
||||
|
||||
@@ -17,52 +17,11 @@ enum CBServerEventId {
|
||||
"Session expired"
|
||||
cb_session_expired,
|
||||
|
||||
"Datasource created"
|
||||
cb_datasource_created,
|
||||
"Datasource updated"
|
||||
cb_datasource_updated,
|
||||
"Datasource deleted"
|
||||
cb_datasource_deleted,
|
||||
|
||||
"Datasource folder created"
|
||||
cb_datasource_folder_created,
|
||||
"Datasource folder updated"
|
||||
cb_datasource_folder_updated,
|
||||
"Datasource folder deleted"
|
||||
cb_datasource_folder_deleted,
|
||||
|
||||
"Datasource disconnected"
|
||||
cb_datasource_disconnected,
|
||||
"Datasource connected"
|
||||
cb_datasource_connected,
|
||||
|
||||
"Resource manager resource created"
|
||||
cb_rm_resource_created,
|
||||
"Resource manager resource updated"
|
||||
cb_rm_resource_updated,
|
||||
"Resource manager resource deleted"
|
||||
cb_rm_resource_deleted,
|
||||
|
||||
"Resource manager project added"
|
||||
cb_rm_project_added,
|
||||
"Resource manager project added"
|
||||
cb_rm_project_updated,
|
||||
"Resource manager project removed"
|
||||
cb_rm_project_removed,
|
||||
|
||||
"Object permissions updated (e.g., datasource)"
|
||||
cb_object_permissions_updated,
|
||||
"Subject permissions updated (e.g., user, team)"
|
||||
cb_subject_permissions_updated,
|
||||
|
||||
"Database output log updated (e.g., DBMS in Oracle)"
|
||||
cb_database_output_log_updated,
|
||||
cb_ai_chat_message_chunk @since(version: "25.1.1")
|
||||
cb_ai_chat_message_error @since(version: "25.1.1")
|
||||
|
||||
"Transaction count updated"
|
||||
cb_transaction_count @since(version: "24.3.3"),
|
||||
|
||||
"Session async task info updated"
|
||||
cb_session_task_info_updated @since(version: "24.3.1"),
|
||||
"Workspace configuration updated"
|
||||
@@ -70,11 +29,6 @@ enum CBServerEventId {
|
||||
"Server notification"
|
||||
cb_server_notification@since(version: "25.2.1")
|
||||
|
||||
"Session task confirmations"
|
||||
cb_session_task_confirmation_request @since(version: "25.2.2")
|
||||
cb_session_task_query_confirmation_request @since(version: "25.2.2")
|
||||
cb_session_task_query_params_confirmation_request @since(version: "25.2.5")
|
||||
|
||||
"Open URL request in client"
|
||||
cb_open_url @since(version: "25.3.1")
|
||||
}
|
||||
@@ -84,9 +38,7 @@ enum CBClientEventId {
|
||||
cb_client_topic_subscribe,
|
||||
cb_client_topic_unsubscribe,
|
||||
cb_client_projects_active,
|
||||
cb_client_session_ping,
|
||||
cb_client_session_task_confirmation @since(version: "25.2.2")
|
||||
cb_client_session_task_with_parameters_confirmation @since(version: "25.2.5")
|
||||
cb_client_session_ping
|
||||
}
|
||||
|
||||
"Client subscribes on topic to receive only related events"
|
||||
@@ -94,22 +46,14 @@ enum CBEventTopic {
|
||||
cb_config,
|
||||
cb_session_log,
|
||||
cb_session,
|
||||
cb_datasource,
|
||||
cb_datasource_folder,
|
||||
cb_scripts,
|
||||
cb_projects,
|
||||
cb_object_permissions,
|
||||
cb_subject_permissions,
|
||||
cb_database_output_log,
|
||||
|
||||
cb_session_task, @since(version: "24.3.1")
|
||||
|
||||
cb_datasource_connection,
|
||||
cb_delete_temp_folder,
|
||||
|
||||
cb_transaction @since(version: "24.3.3"),
|
||||
cb_workspace_configuration @since(version: "25.1.1")
|
||||
cb_ai @since(version: "25.1.1")
|
||||
cb_notification @since(version: "25.2.1")
|
||||
cb_session_action @since(version: "25.3.1")
|
||||
}
|
||||
@@ -126,30 +70,6 @@ interface CBClientEvent {
|
||||
topicId: CBEventTopic
|
||||
}
|
||||
|
||||
"Datasource folder event"
|
||||
type CBDatasourceFolderEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
nodePaths: [String!]! # list of folders node ids
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Datasource event"
|
||||
type CBDatasourceEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
dataSourceIds: [String!]! # list of datasources ids
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Resource manager event"
|
||||
type CBRMEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
resourcePath: String!
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Server Config event"
|
||||
type CBConfigEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
@@ -187,12 +107,6 @@ type WSSessionExpiredEvent implements CBServerEvent {
|
||||
topicId: CBEventTopic
|
||||
}
|
||||
|
||||
"RM project update event"
|
||||
type CBProjectUpdateEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
projectId: String!
|
||||
}
|
||||
|
||||
"Subject permission update event"
|
||||
type CBSubjectPermissionUpdateEvent implements CBServerEvent {
|
||||
@@ -222,22 +136,6 @@ type CBProjectsActiveEvent implements CBClientEvent {
|
||||
projectIds: [String!]!
|
||||
}
|
||||
|
||||
"Database output log event"
|
||||
type CBDatabaseOutputLogEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
contextId: String!
|
||||
messages: [WSOutputLogInfo!]!
|
||||
eventTimestamp: Int!
|
||||
}
|
||||
|
||||
"Define the type for WSOutputLogInfo"
|
||||
type WSOutputLogInfo {
|
||||
severity: String
|
||||
message: String
|
||||
# Add more fields if needed
|
||||
}
|
||||
|
||||
"Async task info status event"
|
||||
type WSAsyncTaskInfo @since(version: "24.3.1") {
|
||||
id: CBServerEventId!
|
||||
@@ -246,56 +144,13 @@ type WSAsyncTaskInfo @since(version: "24.3.1") {
|
||||
running: Boolean!
|
||||
}
|
||||
|
||||
"Datasource disconnect event"
|
||||
type WSDataSourceDisconnectEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
connectionId: String!
|
||||
projectId: String!
|
||||
timestamp: Int!
|
||||
}
|
||||
"Datasource connect event"
|
||||
type WSDataSourceConnectEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
connectionId: String!
|
||||
projectId: String!
|
||||
timestamp: Int!
|
||||
}
|
||||
|
||||
"Datasource count event in transactional mode"
|
||||
type WSTransactionalCountEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
contextId: String!
|
||||
projectId: String!
|
||||
connectionId: String!
|
||||
transactionalCount: Int!
|
||||
}
|
||||
|
||||
type WSAIChatMessageChunkEvent implements CBServerEvent @since(version: "25.1.1") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
conversationId: ID!
|
||||
messageId: ID!
|
||||
chunk: String
|
||||
completed: Boolean!
|
||||
}
|
||||
|
||||
type WSAIChatMessageErrorEvent implements CBServerEvent @since(version: "25.1.1") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
conversationId: ID!
|
||||
messageId: ID!
|
||||
errorMessage: String
|
||||
}
|
||||
|
||||
enum WSServerNotificationEventType {
|
||||
INFO
|
||||
ERROR
|
||||
LOADING
|
||||
CUSTOM
|
||||
}
|
||||
|
||||
"General event for showing user notification"
|
||||
type WSServerNotificationEvent implements CBServerEvent @since(version: "25.2.1") {
|
||||
id: CBServerEventId!
|
||||
@@ -305,6 +160,7 @@ type WSServerNotificationEvent implements CBServerEvent @since(version: "25.2.1"
|
||||
notificationType: WSServerNotificationEventType!
|
||||
}
|
||||
|
||||
#TODO: move out
|
||||
"Event for opening URL in client application"
|
||||
type WSOpenUrlEvent implements CBServerEvent @since(version: "25.3.1") {
|
||||
id: CBServerEventId!
|
||||
@@ -313,48 +169,6 @@ type WSOpenUrlEvent implements CBServerEvent @since(version: "25.3.1") {
|
||||
url: String!
|
||||
}
|
||||
|
||||
type WSSessionTaskConfirmationRequestEvent implements CBServerEvent @since(version: "25.2.2") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
}
|
||||
|
||||
type WSSessionTaskQueryConfirmationRequestEvent implements CBServerEvent @since(version: "25.2.2") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
query: String!
|
||||
}
|
||||
|
||||
type WSSessionTaskConfirmationEvent implements CBClientEvent @since(version: "25.2.2") {
|
||||
id: CBClientEventId!
|
||||
topicId: CBEventTopic
|
||||
taskId: ID!
|
||||
confirmed: Boolean!
|
||||
skipConfirmations: Boolean!
|
||||
}
|
||||
|
||||
type WSSessionTaskQueryParamsConfirmationEvent implements CBServerEvent @since(version: "25.2.5") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
query: String!
|
||||
parameters: Object!
|
||||
}
|
||||
|
||||
type WSSessionTaskWithParametersConfirmationEvent implements CBClientEvent @since(version: "25.2.5") {
|
||||
id: CBClientEventId!
|
||||
topicId: CBEventTopic
|
||||
taskId: ID!
|
||||
parameters: Object!
|
||||
}
|
||||
|
||||
extend type Query {
|
||||
emptyEvent: Boolean
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
extend enum CBServerEventId {
|
||||
"Database output log updated (e.g., DBMS in Oracle)"
|
||||
cb_database_output_log_updated,
|
||||
|
||||
"Transaction count updated"
|
||||
cb_transaction_count @since(version: "24.3.3"),
|
||||
|
||||
"Session task confirmations"
|
||||
cb_session_task_confirmation_request @since(version: "25.2.2")
|
||||
cb_session_task_query_confirmation_request @since(version: "25.2.2")
|
||||
cb_session_task_query_params_confirmation_request @since(version: "25.2.5")
|
||||
}
|
||||
|
||||
extend enum CBClientEventId {
|
||||
cb_client_session_task_confirmation @since(version: "25.2.2")
|
||||
cb_client_session_task_with_parameters_confirmation @since(version: "25.2.5")
|
||||
}
|
||||
|
||||
extend enum CBEventTopic {
|
||||
cb_database_output_log,
|
||||
cb_transaction @since(version: "24.3.3")
|
||||
}
|
||||
|
||||
"Database output log event"
|
||||
type CBDatabaseOutputLogEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
contextId: String!
|
||||
messages: [WSOutputLogInfo!]!
|
||||
eventTimestamp: Int!
|
||||
}
|
||||
|
||||
"Define the type for WSOutputLogInfo"
|
||||
type WSOutputLogInfo {
|
||||
severity: String
|
||||
message: String
|
||||
# Add more fields if needed
|
||||
}
|
||||
|
||||
"Datasource count event in transactional mode"
|
||||
type WSTransactionalCountEvent implements CBServerEvent {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic
|
||||
contextId: String!
|
||||
projectId: String!
|
||||
connectionId: String!
|
||||
transactionalCount: Int!
|
||||
}
|
||||
|
||||
"Query parameter information"
|
||||
type WSQueryParameterInfo {
|
||||
name: String!
|
||||
value: String
|
||||
}
|
||||
|
||||
type WSSessionTaskConfirmationRequestEvent implements CBServerEvent @since(version: "25.2.2") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
}
|
||||
|
||||
type WSSessionTaskQueryConfirmationRequestEvent implements CBServerEvent @since(version: "25.2.2") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
query: String!
|
||||
}
|
||||
|
||||
type WSSessionTaskConfirmationEvent implements CBClientEvent @since(version: "25.2.2") {
|
||||
id: CBClientEventId!
|
||||
topicId: CBEventTopic
|
||||
taskId: ID!
|
||||
confirmed: Boolean!
|
||||
skipConfirmations: Boolean!
|
||||
}
|
||||
|
||||
type WSSessionTaskQueryParamsConfirmationEvent implements CBServerEvent @since(version: "26.0.0") {
|
||||
id: CBServerEventId!
|
||||
topicId: CBEventTopic!
|
||||
taskId: ID!
|
||||
title: String!
|
||||
message: String!
|
||||
query: String!
|
||||
parameters: [WSQueryParameterInfo]!
|
||||
}
|
||||
|
||||
type WSSessionTaskWithParametersConfirmationEvent implements CBClientEvent @since(version: "25.2.5") {
|
||||
id: CBClientEventId!
|
||||
topicId: CBEventTopic
|
||||
taskId: ID!
|
||||
parameters: Object!
|
||||
}
|
||||
|
||||
@@ -51,7 +51,9 @@ type SQLContextInfo {
|
||||
}
|
||||
|
||||
input SQLDataFilterConstraint {
|
||||
attributePosition: Int!
|
||||
"Either attributeName or attributePosition must be specified"
|
||||
attributeName: String
|
||||
attributePosition: Int
|
||||
orderPosition: Int
|
||||
orderAsc: Boolean
|
||||
|
||||
@@ -150,6 +152,19 @@ enum SQLRowIdentifierState {
|
||||
VIRTUAL_KEY
|
||||
}
|
||||
|
||||
enum SQLResultSetGeneratorId {
|
||||
"SELECT .. WHERE .. ="
|
||||
dataSelect,
|
||||
"SELECT .. WHERE .. IN"
|
||||
dataSelectMany,
|
||||
"INSERT"
|
||||
dataInsert,
|
||||
"UPDATE"
|
||||
dataUpdate,
|
||||
"DELETE by Unique Key"
|
||||
dataDeleteByUniqueKey,
|
||||
}
|
||||
|
||||
type SQLRowIdentifier {
|
||||
"Single or multiple attributes acting as a row identifier"
|
||||
attributes: [SQLRowIdentifierAttribute!]!
|
||||
@@ -183,6 +198,8 @@ type SQLExecuteInfo {
|
||||
filterText: String
|
||||
# Full query that was executed, contains all used filters
|
||||
fullQuery: String
|
||||
# Original query that was executed, without modifications
|
||||
originalQuery: String
|
||||
# Results
|
||||
results: [ SQLQueryResults! ]!
|
||||
}
|
||||
@@ -336,6 +353,19 @@ extend type Query {
|
||||
nodePathList: [String!]!
|
||||
): String!
|
||||
|
||||
"""
|
||||
Returns an auto-generated SQL query based on provided rows data.
|
||||
Uses generatorId value to establish the type of query (e.g. SELECT or INSERT)
|
||||
"""
|
||||
sqlGenerateResultSetQuery(
|
||||
projectId: ID,
|
||||
connectionId: ID!,
|
||||
contextId: ID!,
|
||||
generatorId: SQLResultSetGeneratorId!,
|
||||
resultsId: ID!,
|
||||
selectedRows: [SQLResultRow!]!,
|
||||
): String!
|
||||
|
||||
"Parses SQL script and returns script info with queries start and end positions"
|
||||
sqlParseScript(
|
||||
projectId: ID,
|
||||
|
||||
+15
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,10 @@ import io.cloudbeaver.DBWebException;
|
||||
import io.cloudbeaver.WebServiceUtils;
|
||||
import io.cloudbeaver.model.session.WebSession;
|
||||
import io.cloudbeaver.utils.WebCommonUtils;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.DBConstants;
|
||||
import org.jkiss.dbeaver.model.connection.DBPAuthModelDescriptor;
|
||||
import org.jkiss.dbeaver.model.impl.auth.AuthModelDatabaseNative;
|
||||
import org.jkiss.dbeaver.model.meta.Property;
|
||||
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
|
||||
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
|
||||
@@ -74,7 +77,6 @@ public class WebDatabaseAuthModel {
|
||||
|
||||
@Property
|
||||
public WebPropertyInfo[] getProperties() throws DBWebException {
|
||||
|
||||
DBPPropertySource credentialsSource = model.createCredentialsSource(null, null);
|
||||
Predicate<DBPPropertyDescriptor> predicate = CommonUtils.isEmpty(getRequiredAuth())
|
||||
? p -> true
|
||||
@@ -82,8 +84,18 @@ public class WebDatabaseAuthModel {
|
||||
|
||||
return Arrays.stream(credentialsSource.getProperties())
|
||||
.filter(predicate)
|
||||
.map(p -> new WebPropertyInfo(webSession, p, credentialsSource)).toArray(WebPropertyInfo[]::new);
|
||||
.filter(p -> !isPassword(p) || isPasswordApplicable())
|
||||
.filter(p -> !p.isDesktop())
|
||||
.map(p -> new WebPropertyInfo(webSession, p, credentialsSource))
|
||||
.toArray(WebPropertyInfo[]::new);
|
||||
}
|
||||
|
||||
private boolean isPassword(@NotNull DBPPropertyDescriptor property) {
|
||||
return property.hasFeature(DBConstants.PROP_FEATURE_PASSWORD);
|
||||
}
|
||||
|
||||
private boolean isPasswordApplicable() {
|
||||
return model.getInstance() instanceof AuthModelDatabaseNative<?> nativeModel &&
|
||||
nativeModel.isUserPasswordApplicable();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -61,6 +61,7 @@ public class WebNetworkHandlerDescriptor {
|
||||
|
||||
public WebPropertyInfo[] getProperties() {
|
||||
return Arrays.stream(descriptor.getHandlerProperties())
|
||||
.filter(p -> !p.isDesktop() && !p.isHidden())
|
||||
.map(p -> new WebPropertyInfo(session, p, null)).toArray(WebPropertyInfo[]::new);
|
||||
}
|
||||
|
||||
|
||||
+3
-25
@@ -23,20 +23,14 @@ import org.jkiss.dbeaver.model.DBConstants;
|
||||
import org.jkiss.dbeaver.model.app.DBACertificateStorage;
|
||||
import org.jkiss.dbeaver.model.app.DBPWorkspace;
|
||||
import org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage;
|
||||
import org.jkiss.dbeaver.model.qm.QMRegistry;
|
||||
import org.jkiss.dbeaver.model.qm.QMUtils;
|
||||
import org.jkiss.dbeaver.registry.DataSourceProviderRegistry;
|
||||
import org.jkiss.dbeaver.runtime.SecurityProviderUtils;
|
||||
import org.jkiss.dbeaver.runtime.qm.QMLogFileWriter;
|
||||
import org.jkiss.dbeaver.runtime.qm.QMRegistryImpl;
|
||||
|
||||
public abstract class BaseWebPlatform extends BaseServletPlatform {
|
||||
public static final String TEMP_FILE_FOLDER = "temp-sql-upload-files";
|
||||
public static final String TEMP_FILE_IMPORT_FOLDER = "temp-import-files";
|
||||
|
||||
|
||||
private QMRegistryImpl queryManager;
|
||||
private QMLogFileWriter qmLogWriter;
|
||||
private DBACertificateStorage certificateStorage;
|
||||
private ServerGlobalWorkspace workspace;
|
||||
|
||||
@@ -49,14 +43,11 @@ public abstract class BaseWebPlatform extends BaseServletPlatform {
|
||||
getApplication().beforeWorkspaceInitialization();
|
||||
this.workspace = new ServerGlobalWorkspace(this, getApplication());
|
||||
this.workspace.initializeProjects();
|
||||
QMUtils.initApplication(this);
|
||||
|
||||
this.queryManager = new QMRegistryImpl();
|
||||
|
||||
this.qmLogWriter = new QMLogFileWriter();
|
||||
this.queryManager.registerMetaListener(qmLogWriter);
|
||||
QMUtils.initPlatform(true);
|
||||
|
||||
this.certificateStorage = new DefaultCertificateStorage(
|
||||
this,
|
||||
WebPlatformActivator.getInstance()
|
||||
.getStateLocation()
|
||||
.toFile()
|
||||
@@ -92,21 +83,8 @@ public abstract class BaseWebPlatform extends BaseServletPlatform {
|
||||
@Override
|
||||
public synchronized void dispose() {
|
||||
super.dispose();
|
||||
if (this.qmLogWriter != null) {
|
||||
this.queryManager.unregisterMetaListener(qmLogWriter);
|
||||
this.qmLogWriter.dispose();
|
||||
this.qmLogWriter = null;
|
||||
}
|
||||
if (this.queryManager != null) {
|
||||
this.queryManager.dispose();
|
||||
//queryManager = null;
|
||||
}
|
||||
QMUtils.disposePlatform();
|
||||
DataSourceProviderRegistry.dispose();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public QMRegistry getQueryManager() {
|
||||
return queryManager;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,13 +16,21 @@
|
||||
*/
|
||||
package io.cloudbeaver.server;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.runtime.DBWorkbench;
|
||||
|
||||
public class WebAppUtils {
|
||||
|
||||
public static boolean isWebApplication() {
|
||||
return DBWorkbench.getPlatform().getApplication() instanceof WebApplication;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static WebApplication getWebApplication() {
|
||||
return (WebApplication) DBWorkbench.getPlatform().getApplication();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static BaseWebPlatform getWebPlatform() {
|
||||
return (BaseWebPlatform) DBWorkbench.getPlatform();
|
||||
}
|
||||
|
||||
+3
@@ -31,6 +31,9 @@ public class WSDefaultEventHandler<EVENT extends WSEvent> implements WSEventHand
|
||||
|
||||
@Override
|
||||
public void handleEvent(@NotNull EVENT event) {
|
||||
if (!WebAppUtils.isWebApplication()) {
|
||||
return;
|
||||
}
|
||||
log.debug(event.getTopicId() + " event handled");
|
||||
Collection<BaseWebSession> allSessions = WebAppUtils.getWebApplication()
|
||||
.getSessionManager()
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package io.cloudbeaver.server.events;
|
||||
|
||||
import io.cloudbeaver.model.session.BaseWebSession;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.websocket.event.WSServerConfigurationChangedEvent;
|
||||
|
||||
public class WSServerConfigurationChangedEventHandler extends WSDefaultEventHandler<WSServerConfigurationChangedEvent> {
|
||||
|
||||
@Override
|
||||
protected void updateSessionData(@NotNull BaseWebSession activeUserSession, @NotNull WSServerConfigurationChangedEvent event) {
|
||||
activeUserSession.refreshUserData();
|
||||
super.updateSessionData(activeUserSession, event);
|
||||
}
|
||||
}
|
||||
+10
-4
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,6 +37,7 @@ import io.cloudbeaver.service.DBWBindingContext;
|
||||
import io.cloudbeaver.service.DBWServiceBindingGraphQL;
|
||||
import io.cloudbeaver.service.WebServiceBindingBase;
|
||||
import io.cloudbeaver.utils.ServletAppUtils;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
@@ -202,16 +203,21 @@ public class GraphQLEndpoint extends HttpServlet {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
String path = request.getPathInfo();
|
||||
if (path == null) {
|
||||
path = request.getServletPath();
|
||||
}
|
||||
boolean develMode = ServletAppUtils.getServletApplication().getServerConfiguration().isDevelMode();
|
||||
|
||||
if (path.contentEquals("/schema.json") && develMode) {
|
||||
if (!develMode) {
|
||||
super.doGet(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
if (path.contentEquals("/schema.json")) {
|
||||
executeQuery(request, response, GraphQLConstants.SCHEMA_READ_QUERY, null, null);
|
||||
} else if (path.contentEquals("/console") && develMode) {
|
||||
} else if (path.contentEquals("/console")) {
|
||||
response.setContentType(MimeTypes.TEXT_HTML);
|
||||
try (InputStream consolePageStream = WebServiceUtils.openStaticResource("static/graphiql/index.html")) {
|
||||
IOUtils.copyStream(consolePageStream, response.getOutputStream());
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class GraphQLLoggerUtil {
|
||||
public static String getUserId(@NotNull HttpServletRequest request) {
|
||||
WebSession session = getWebSession(request);
|
||||
if (session == null) {
|
||||
return null;
|
||||
return QMConstants.QM_UNAUTHORIZED_USER;
|
||||
}
|
||||
String userId = session.getUserContext().getUserId();
|
||||
if (userId == null) {
|
||||
|
||||
+2
-2
@@ -19,8 +19,8 @@ package io.cloudbeaver.server.jetty;
|
||||
|
||||
import io.cloudbeaver.service.DBWServletContext;
|
||||
import jakarta.servlet.http.HttpServlet;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletHolder;
|
||||
import org.eclipse.jetty.ee11.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee11.servlet.ServletHolder;
|
||||
|
||||
public class CBJettyServletContext implements DBWServletContext {
|
||||
private final ServletContextHandler contextHandler;
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ package io.cloudbeaver.server.jetty;
|
||||
|
||||
import io.cloudbeaver.service.DBWWebSocketContext;
|
||||
import jakarta.websocket.server.ServerEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.ee11.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.jkiss.code.NotNull;
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
package io.cloudbeaver.server.jetty;
|
||||
|
||||
import io.cloudbeaver.server.WebApplication;
|
||||
import org.eclipse.jetty.ee10.servlet.SessionHandler;
|
||||
import org.eclipse.jetty.ee11.servlet.SessionHandler;
|
||||
import org.jkiss.code.NotNull;
|
||||
|
||||
public class CBSessionHandler extends SessionHandler {
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
package io.cloudbeaver.server.jetty;
|
||||
|
||||
import io.cloudbeaver.server.WebApplication;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.ee11.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.session.DefaultSessionCache;
|
||||
import org.eclipse.jetty.session.DefaultSessionIdManager;
|
||||
|
||||
+3
-3
@@ -17,16 +17,16 @@
|
||||
package io.cloudbeaver.server.servlets;
|
||||
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import io.cloudbeaver.server.CBConstants;
|
||||
import io.cloudbeaver.server.WebAppUtils;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.annotation.WebServlet;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.eclipse.jetty.ee10.servlet.DefaultServlet;
|
||||
import org.eclipse.jetty.ee11.servlet.DefaultServlet;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.dbeaver.model.data.json.JSONUtils;
|
||||
import org.jkiss.dbeaver.utils.GeneralUtils;
|
||||
import org.jkiss.utils.HttpConstants;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -39,7 +39,7 @@ public class WebStatusServlet extends DefaultServlet {
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
response.setContentType(CBConstants.APPLICATION_JSON);
|
||||
response.setContentType(HttpConstants.CONTENT_TYPE_JSON);
|
||||
response.setHeader("Access-Control-Allow-Origin", "*");
|
||||
Map<String, Object> infoMap = new LinkedHashMap<>();
|
||||
infoMap.put("health", "ok");
|
||||
|
||||
+3
-4
@@ -93,7 +93,7 @@ public class CBEventsLongPollingServlet extends HttpServlet {
|
||||
return;
|
||||
}
|
||||
|
||||
resp.setContentType(CBConstants.APPLICATION_JSON);
|
||||
resp.setContentType(HttpConstants.CONTENT_TYPE_JSON);
|
||||
WSUtils.clientGson.toJson(Map.of("events", events), resp.getWriter());
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
@@ -187,8 +187,7 @@ public class CBEventsLongPollingServlet extends HttpServlet {
|
||||
|
||||
private void addCorsHeaders(@NotNull HttpServletRequest req, @NotNull HttpServletResponse resp) {
|
||||
String origin = req.getHeader("Origin");
|
||||
boolean develMode = ServletAppUtils.getServletApplication().getServerConfiguration().isDevelMode();
|
||||
if (!develMode || origin == null) {
|
||||
if (origin == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -239,7 +238,7 @@ public class CBEventsLongPollingServlet extends HttpServlet {
|
||||
) {
|
||||
try {
|
||||
resp.setStatus(status);
|
||||
resp.setContentType(CBConstants.APPLICATION_JSON);
|
||||
resp.setContentType(HttpConstants.CONTENT_TYPE_JSON);
|
||||
|
||||
Map<String, Object> error = Map.of(
|
||||
"error", message,
|
||||
|
||||
+3
-3
@@ -30,12 +30,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
public class CBJettyWebSocketManager {
|
||||
private static final Log log = Log.getLog(CBJettyWebSocketManager.class);
|
||||
private static final Map<String, List<CBEventsWebSocket>> socketBySessionId = new ConcurrentHashMap<>();
|
||||
private static final Map<String, List<CBAbstractWebSocket>> socketBySessionId = new ConcurrentHashMap<>();
|
||||
|
||||
private CBJettyWebSocketManager() {
|
||||
}
|
||||
|
||||
public static void registerWebSocket(@NotNull String webSessionId, @NotNull CBEventsWebSocket webSocket) {
|
||||
public static void registerWebSocket(@NotNull String webSessionId, @NotNull CBAbstractWebSocket webSocket) {
|
||||
socketBySessionId.computeIfAbsent(webSessionId, key -> new CopyOnWriteArrayList<>()).add(webSocket);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class CBJettyWebSocketManager {
|
||||
entry -> {
|
||||
var sessionId = entry.getKey();
|
||||
var webSockets = entry.getValue();
|
||||
for (CBEventsWebSocket webSocket : webSockets) {
|
||||
for (CBAbstractWebSocket webSocket : webSockets) {
|
||||
try {
|
||||
webSocket.getSession().getBasicRemote().sendPing(
|
||||
ByteBuffer.wrap("cb-ping".getBytes(StandardCharsets.UTF_8))
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import jakarta.servlet.http.HttpSession;
|
||||
import jakarta.websocket.HandshakeResponse;
|
||||
import jakarta.websocket.server.HandshakeRequest;
|
||||
import jakarta.websocket.server.ServerEndpointConfig;
|
||||
import org.eclipse.jetty.ee10.websocket.jakarta.server.internal.JakartaWebSocketCreator;
|
||||
import org.eclipse.jetty.ee11.websocket.jakarta.server.internal.JakartaWebSocketCreator;
|
||||
import org.eclipse.jetty.http.BadMessageException;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2026 DBeaver Corp
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* NOTICE: All information contained herein is, and remains
|
||||
* the property of DBeaver Corp and its suppliers, if any.
|
||||
* The intellectual and technical concepts contained
|
||||
* herein are proprietary to DBeaver Corp and its suppliers
|
||||
* and may be covered by U.S. and Foreign Patents,
|
||||
* patents in process, and are protected by trade secret or copyright law.
|
||||
* Dissemination of this information or reproduction of this material
|
||||
* is strictly forbidden unless prior written permission is obtained
|
||||
* from DBeaver Corp.
|
||||
*/
|
||||
package io.cloudbeaver.server.websockets.lsp;
|
||||
|
||||
import io.cloudbeaver.model.session.BaseWebSession;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.model.app.DBPWorkspace;
|
||||
import org.jkiss.dbeaver.model.auth.impl.AbstractSessionPersistent;
|
||||
import org.jkiss.dbeaver.model.lsp.DBLServerSessionProvider;
|
||||
|
||||
public class LSPWebServerSesssionProvider implements DBLServerSessionProvider {
|
||||
|
||||
@NotNull
|
||||
private final BaseWebSession session;
|
||||
|
||||
public LSPWebServerSesssionProvider(@NotNull BaseWebSession session) {
|
||||
this.session = session;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public AbstractSessionPersistent getSession() {
|
||||
return session;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public DBPWorkspace getWorkspace() {
|
||||
return session.getWorkspace();
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2026 DBeaver Corp
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* NOTICE: All information contained herein is, and remains
|
||||
* the property of DBeaver Corp and its suppliers, if any.
|
||||
* The intellectual and technical concepts contained
|
||||
* herein are proprietary to DBeaver Corp and its suppliers
|
||||
* and may be covered by U.S. and Foreign Patents,
|
||||
* patents in process, and are protected by trade secret or copyright law.
|
||||
* Dissemination of this information or reproduction of this material
|
||||
* is strictly forbidden unless prior written permission is obtained
|
||||
* from DBeaver Corp.
|
||||
*/
|
||||
package io.cloudbeaver.server.websockets.lsp;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
public class LSPWebSocketConstants {
|
||||
|
||||
public static final String ENDPOINT_SUFFIX = "ws/lsp";
|
||||
public static final Duration IDLE_TIMEOUT = Duration.ofMinutes(5);
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2026 DBeaver Corp
|
||||
*
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* NOTICE: All information contained herein is, and remains
|
||||
* the property of DBeaver Corp and its suppliers, if any.
|
||||
* The intellectual and technical concepts contained
|
||||
* herein are proprietary to DBeaver Corp and its suppliers
|
||||
* and may be covered by U.S. and Foreign Patents,
|
||||
* patents in process, and are protected by trade secret or copyright law.
|
||||
* Dissemination of this information or reproduction of this material
|
||||
* is strictly forbidden unless prior written permission is obtained
|
||||
* from DBeaver Corp.
|
||||
*/
|
||||
package io.cloudbeaver.server.websockets.lsp;
|
||||
|
||||
import io.cloudbeaver.model.session.BaseWebSession;
|
||||
import io.cloudbeaver.server.websockets.CBAbstractWebSocket;
|
||||
import io.cloudbeaver.server.websockets.CBJettyWebSocketManager;
|
||||
import io.cloudbeaver.server.websockets.CBWebSocketServerConfigurator;
|
||||
import jakarta.websocket.CloseReason;
|
||||
import jakarta.websocket.EndpointConfig;
|
||||
import jakarta.websocket.Session;
|
||||
import org.eclipse.lsp4j.jsonrpc.Launcher;
|
||||
import org.eclipse.lsp4j.services.LanguageClient;
|
||||
import org.eclipse.lsp4j.websocket.jakarta.WebSocketLauncherBuilder;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.dbeaver.model.lsp.DBLServer;
|
||||
|
||||
public class LSPWebSocketEndpoint extends CBAbstractWebSocket {
|
||||
private static final Log log = Log.getLog(LSPWebSocketEndpoint.class);
|
||||
|
||||
public LSPWebSocketEndpoint() {}
|
||||
|
||||
@Override
|
||||
public void onOpen(Session wsSession, EndpointConfig endpointConfig) {
|
||||
BaseWebSession webSession = (BaseWebSession) wsSession.getUserProperties()
|
||||
.get(CBWebSocketServerConfigurator.PROP_WEB_SESSION);
|
||||
CBJettyWebSocketManager.registerWebSocket(webSession.getSessionId(), this);
|
||||
|
||||
wsSession.setMaxIdleTimeout(LSPWebSocketConstants.IDLE_TIMEOUT.toMillis());
|
||||
wsSession.setMaxTextMessageBufferSize(Integer.MAX_VALUE);
|
||||
wsSession.setMaxBinaryMessageBufferSize(Integer.MAX_VALUE);
|
||||
|
||||
LSPWebServerSesssionProvider sessionProvider = new LSPWebServerSesssionProvider(webSession);
|
||||
DBLServer server = new DBLServer(sessionProvider);
|
||||
var builder = new WebSocketLauncherBuilder<LanguageClient>();
|
||||
builder.setSession(wsSession);
|
||||
builder.setLocalService(server);
|
||||
builder.setRemoteInterface(LanguageClient.class);
|
||||
Launcher<LanguageClient> launcher = builder.create();
|
||||
server.connect(launcher.getRemoteProxy());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(Session session, CloseReason closeReason) {
|
||||
log.debug("Closing websocket session: " + session.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Session session, Throwable thr) {
|
||||
log.error("LSP WebSocket error", thr);
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -160,7 +160,12 @@ public interface DBWServiceCore extends DBWService {
|
||||
) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
WebNetworkEndpointInfo testNetworkHandler(@NotNull WebSession webSession, @NotNull WebNetworkHandlerConfigInput nhConfig) throws DBWebException;
|
||||
WebNetworkEndpointInfo testNetworkHandler(
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String projectId,
|
||||
@Nullable String connectionId,
|
||||
@NotNull WebNetworkHandlerConfigInput nhConfig
|
||||
) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
WebConnectionInfo closeConnection(@NotNull WebSession webSession, @Nullable String projectId, @NotNull String connectionId) throws DBWebException;
|
||||
|
||||
+4
-1
@@ -139,7 +139,10 @@ public class WebServiceBindingCore extends WebServiceBindingBase<DBWServiceCore>
|
||||
getWebSession(env), getProjectReference(env), getArgumentVal(env, "config")
|
||||
))
|
||||
.dataFetcher("testNetworkHandler", env -> getService(env).testNetworkHandler(
|
||||
getWebSession(env), new WebNetworkHandlerConfigInput(getArgument(env, "config"))
|
||||
getWebSession(env),
|
||||
getProjectReference(env),
|
||||
getArgument(env, "connectionId"),
|
||||
new WebNetworkHandlerConfigInput(getArgument(env, "config"))
|
||||
))
|
||||
.dataFetcher("closeConnection", env -> getService(env).closeConnection(
|
||||
getWebSession(env),
|
||||
|
||||
+38
-3
@@ -398,7 +398,9 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
dataSourceContainer,
|
||||
dataSourceContainer.getConnectionConfiguration()
|
||||
);
|
||||
saveConfig[0] = true;
|
||||
// don't understand why whe need to set this flag here
|
||||
// need to discover it, maybe we can avoid it at all
|
||||
saveConfig[0] = sharedCredentials;
|
||||
}
|
||||
if (WebServiceUtils.isGlobalProject(dataSourceContainer.getProject())) {
|
||||
// Do not flush config for global project (only admin can do it - CB-2415)
|
||||
@@ -462,12 +464,21 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
throw new DBException("Node '" + nodePath + "' is not a datasource node");
|
||||
}
|
||||
DBPDataSourceContainer dataSourceTemplate = dbnDataSource.getDataSourceContainer();
|
||||
if (!dataSourceTemplate.isExternallyProvided()) {
|
||||
if (!CommonUtils.equalObjects(dataSourceTemplate.getProject(), project)) {
|
||||
throw new DBException("Copying connection to another project is not allowed");
|
||||
}
|
||||
}
|
||||
|
||||
DataSourceDescriptor newDataSource = dataSourceRegistry.createDataSource(dataSourceTemplate);
|
||||
|
||||
ServletApplication app = ServletAppUtils.getServletApplication();
|
||||
if (app instanceof WebApplication webApplication) {
|
||||
newDataSource.setNavigatorSettings(webApplication.getAppConfiguration().getDefaultNavigatorSettings());
|
||||
newDataSource.setNavigatorSettings(
|
||||
dataSourceTemplate.isExternallyProvided() ?
|
||||
webApplication.getAppConfiguration().getDefaultNavigatorSettings() :
|
||||
dataSourceTemplate.getNavigatorSettings().getOriginalSettings()
|
||||
);
|
||||
}
|
||||
|
||||
WebConnectionConfig config = project.getConnectionConfigInput(connectionConfig);
|
||||
@@ -580,6 +591,8 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
@Override
|
||||
public WebNetworkEndpointInfo testNetworkHandler(
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String projectId,
|
||||
@Nullable String connectionId,
|
||||
@NotNull WebNetworkHandlerConfigInput nhConfig
|
||||
) throws DBWebException {
|
||||
DBRProgressMonitor monitor = webSession.getProgressMonitor();
|
||||
@@ -600,7 +613,13 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
try {
|
||||
monitor.subTask("Initialize tunnel");
|
||||
|
||||
DBWHandlerConfiguration configuration = new DBWHandlerConfiguration(handlerDescriptor, null);
|
||||
DBWHandlerConfiguration currentConnectionHandlerConfig =
|
||||
getCurrentConnectionHandlerConfig(webSession, projectId, connectionId, nhConfig.getId());
|
||||
|
||||
DBWHandlerConfiguration configuration = currentConnectionHandlerConfig == null
|
||||
? new DBWHandlerConfiguration(handlerDescriptor, null)
|
||||
: new DBWHandlerConfiguration(currentConnectionHandlerConfig);
|
||||
|
||||
WebDataSourceUtils.updateHandlerConfig(configuration, nhConfig);
|
||||
configuration.setSavePassword(true);
|
||||
configuration.setEnabled(true);
|
||||
@@ -631,6 +650,22 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private DBWHandlerConfiguration getCurrentConnectionHandlerConfig(
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String projectId,
|
||||
@Nullable String connectionId,
|
||||
@NotNull String handlerConfigId
|
||||
) throws DBWebException {
|
||||
if (projectId == null || connectionId == null) {
|
||||
return null;
|
||||
}
|
||||
WebSessionProjectImpl sessionProject = webSession.getAccessibleProjectById(projectId);
|
||||
WebConnectionInfo connectionInfo = sessionProject.getWebConnectionInfo(connectionId);
|
||||
DBPConnectionConfiguration connectionConfiguration = connectionInfo.getDataSourceContainer().getConnectionConfiguration();
|
||||
return connectionConfiguration.getHandler(handlerConfigId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WebConnectionInfo closeConnection(
|
||||
@NotNull WebSession webSession,
|
||||
|
||||
+9
-9
@@ -145,11 +145,6 @@ public class WebDefaultFeatureProvider implements DBWFeatureProvider {
|
||||
return features;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private String getProjectId(@NotNull DBNNode node) {
|
||||
return node.getOwnerProject().getId();
|
||||
}
|
||||
|
||||
private boolean canCreateConnectionFromFileName(String fileName) {
|
||||
String fileExtension = IOUtils.getFileExtension(fileName);
|
||||
if (CommonUtils.isEmpty(fileExtension)) {
|
||||
@@ -169,11 +164,16 @@ public class WebDefaultFeatureProvider implements DBWFeatureProvider {
|
||||
}
|
||||
|
||||
private boolean hasNodePermission(@NotNull WebSession webSession, @NotNull DBNNode node, @NotNull RMProjectPermission permission) {
|
||||
WebProjectImpl project = webSession.getProjectById(node.getOwnerProject().getId());
|
||||
if (project == null) {
|
||||
return false;
|
||||
RMProject rmProject;
|
||||
if (node instanceof DBNResourceManagerResource rmr) {
|
||||
rmProject = rmr.getRmProject();
|
||||
} else {
|
||||
WebProjectImpl project = webSession.getProjectById(node.getOwnerProject().getId());
|
||||
if (project == null) {
|
||||
return false;
|
||||
}
|
||||
rmProject = project.getRMProject();
|
||||
}
|
||||
RMProject rmProject = project.getRMProject();
|
||||
return SMUtils.hasProjectPermission(webSession, rmProject, permission);
|
||||
}
|
||||
|
||||
|
||||
+10
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -79,6 +79,15 @@ public interface DBWServiceSQL extends DBWService {
|
||||
@NotNull Map<String, Object> options,
|
||||
@NotNull List<String> nodePathList) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
String sqlGenerateResultSetQuery(
|
||||
@NotNull WebSession session,
|
||||
@NotNull WebSQLContextInfo sqlContext,
|
||||
@NotNull String generatorId,
|
||||
@NotNull String resultsId,
|
||||
@NotNull List<WebSQLResultsRow> selectedRows
|
||||
) throws DBWebException;
|
||||
|
||||
@WebAction
|
||||
WebSQLContextInfo createContext(
|
||||
@NotNull WebSQLProcessor processor,
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class WebSQLCompletionContext implements SQLCompletionContext {
|
||||
|
||||
@Override
|
||||
public boolean isSearchInsideNames() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+44
-7
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ public class WebSQLDataFilter {
|
||||
|
||||
|
||||
private int offset;
|
||||
private int limit ;
|
||||
private int limit;
|
||||
private String where;
|
||||
private final List<WebSQLDataFilterConstraint> constraints = new ArrayList<>();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class WebSQLDataFilter {
|
||||
this.limit = DEFAULT_ROWS_NUMBER;
|
||||
}
|
||||
|
||||
public WebSQLDataFilter(Map<String, Object> filterProps) {
|
||||
public WebSQLDataFilter(@NotNull Map<String, Object> filterProps) {
|
||||
this.offset = CommonUtils.toInt(filterProps.get("offset"));
|
||||
this.limit = CommonUtils.toInt(filterProps.get("limit"));
|
||||
if (this.limit <= 0) {
|
||||
@@ -59,10 +59,10 @@ public class WebSQLDataFilter {
|
||||
this.where = CommonUtils.toString(filterProps.get("where"), null);
|
||||
Object constraints = filterProps.get("constraints");
|
||||
if (constraints instanceof Collection) {
|
||||
for (Object constrItem : (Collection<?>)constraints) {
|
||||
for (Object constrItem : (Collection<?>) constraints) {
|
||||
if (constrItem instanceof Map) {
|
||||
this.constraints.add(
|
||||
new WebSQLDataFilterConstraint((Map<String, Object>)constrItem));
|
||||
new WebSQLDataFilterConstraint((Map<String, Object>) constrItem));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,8 @@ public class WebSQLDataFilter {
|
||||
return where;
|
||||
}
|
||||
|
||||
public static WebSQLDataFilter from(DBDDataFilter filter) {
|
||||
@NotNull
|
||||
public static WebSQLDataFilter from(@NotNull DBDDataFilter filter) {
|
||||
var webFilter = new WebSQLDataFilter();
|
||||
webFilter.where = filter.getWhere();
|
||||
for (DBDAttributeConstraint constraint : filter.getConstraints()) {
|
||||
@@ -101,6 +102,7 @@ public class WebSQLDataFilter {
|
||||
return webFilter;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public DBDDataFilter makeDataFilter(@Nullable WebSQLResultsInfo resultInfo) throws DBException {
|
||||
DBDDataFilter dataFilter = new DBDDataFilter();
|
||||
dataFilter.setWhere(where);
|
||||
@@ -112,12 +114,17 @@ public class WebSQLDataFilter {
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
private List<DBDAttributeConstraint> mapWebConstrainsToDbdConstrains(@Nullable WebSQLResultsInfo resultInfo) throws DBException {
|
||||
if (resultInfo == null) {
|
||||
return getDbdConstraints();
|
||||
}
|
||||
List<DBDAttributeConstraint> constraints = generateEmptyConstrains(resultInfo);
|
||||
fillEmptyConstrains(constraints);
|
||||
return constraints;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public List<DBDAttributeConstraint> generateEmptyConstrains(@Nullable WebSQLResultsInfo resultInfo) {
|
||||
if (resultInfo == null) {
|
||||
return Collections.emptyList();
|
||||
@@ -132,7 +139,7 @@ public class WebSQLDataFilter {
|
||||
|
||||
private void fillEmptyConstrains(@NotNull List<DBDAttributeConstraint> emptyConstraints) throws DBException {
|
||||
for (WebSQLDataFilterConstraint webConstr : constraints) {
|
||||
if(webConstr.getAttributePosition() >= emptyConstraints.size()) {
|
||||
if (webConstr.getAttributePosition() >= emptyConstraints.size()) {
|
||||
throw new DBException(MessageFormat.format("Incorrect column position ''{0}'' in order clause", webConstr.getAttributePosition()));
|
||||
}
|
||||
DBDAttributeConstraint dbConstr = emptyConstraints.get(webConstr.getAttributePosition());
|
||||
@@ -140,6 +147,7 @@ public class WebSQLDataFilter {
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private DBDAttributeConstraint fillEmptyConstraint(@NotNull DBDAttributeConstraint dbConstr,
|
||||
@NotNull WebSQLDataFilterConstraint webConstr) {
|
||||
dbConstr.setPlainNameReference(true);
|
||||
@@ -159,4 +167,33 @@ public class WebSQLDataFilter {
|
||||
}
|
||||
return dbConstr;
|
||||
}
|
||||
|
||||
private List<DBDAttributeConstraint> getDbdConstraints() {
|
||||
List<DBDAttributeConstraint> dbConstraints = new ArrayList<>();
|
||||
for (WebSQLDataFilterConstraint constraint : constraints) {
|
||||
String attributeName = constraint.getAttributeName();
|
||||
DBDAttributeConstraint dbConstraint = new DBDAttributeConstraint(
|
||||
attributeName, getOriginalVisualPosition(constraint, attributeName)
|
||||
);
|
||||
|
||||
fillEmptyConstraint(dbConstraint, constraint);
|
||||
dbConstraints.add(dbConstraint);
|
||||
}
|
||||
return dbConstraints;
|
||||
}
|
||||
|
||||
private static int getOriginalVisualPosition(WebSQLDataFilterConstraint constraint, String attributeName) {
|
||||
Integer attributePosition = constraint.getAttributePosition();
|
||||
|
||||
if (CommonUtils.isEmpty(attributeName)) {
|
||||
if (attributePosition == null) {
|
||||
throw new IllegalArgumentException("Constraint must specify either attributePosition or attributeName");
|
||||
}
|
||||
throw new IllegalArgumentException(
|
||||
"Can't convert constraint by attributePosition without result set metadata (attributeName is required)"
|
||||
);
|
||||
}
|
||||
|
||||
return attributePosition == null ? -1 : attributePosition;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package io.cloudbeaver.service.sql;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.dbeaver.model.meta.Property;
|
||||
|
||||
@@ -30,6 +31,7 @@ public class WebSQLExecuteInfo {
|
||||
private long duration;
|
||||
private String filterText;
|
||||
private String fullQuery;
|
||||
private String originalQuery;
|
||||
private WebSQLQueryResults[] results;
|
||||
|
||||
@Property
|
||||
@@ -70,8 +72,11 @@ public class WebSQLExecuteInfo {
|
||||
|
||||
@Property
|
||||
public String getOriginalQuery() {
|
||||
//TODO implement
|
||||
return null; // should return the original query without data filters
|
||||
return originalQuery;
|
||||
}
|
||||
|
||||
public void setOriginalQuery(@NotNull String originalQuery) {
|
||||
this.originalQuery = originalQuery;
|
||||
}
|
||||
|
||||
@Property
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.annotation.MultipartConfig;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.eclipse.jetty.ee10.servlet.ServletContextRequest;
|
||||
import org.eclipse.jetty.ee11.servlet.ServletContextRequest;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.dbeaver.model.data.json.JSONUtils;
|
||||
|
||||
+3
-3
@@ -32,7 +32,7 @@ import org.jkiss.dbeaver.model.sql.SQLQueryParameter;
|
||||
import org.jkiss.dbeaver.model.sql.SQLScriptContext;
|
||||
import org.jkiss.dbeaver.model.websocket.event.WSEvent;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -58,11 +58,11 @@ public class WebSQLParametersProvider extends SQLParametersProviderBase {
|
||||
@NotNull List<SQLQueryParameter> parameters,
|
||||
@NotNull Supplier<DBDDataReceiver> dataReceiverSupplier
|
||||
) {
|
||||
Map<String, Object> unsetParams = new LinkedHashMap<>();
|
||||
List<WebSQLQueryParameterRecord> unsetParams = new ArrayList<>();
|
||||
for (SQLQueryParameter param : parameters) {
|
||||
if (!param.isVariableSet()) {
|
||||
// Empty value for now, maybe in future we can set some defaults here
|
||||
unsetParams.put(param.getName(), "");
|
||||
unsetParams.add(new WebSQLQueryParameterRecord(param.getName(), param.getValue()));
|
||||
}
|
||||
}
|
||||
if (unsetParams.isEmpty()) {
|
||||
|
||||
+15
-2
@@ -296,7 +296,17 @@ public class WebSQLProcessor implements WebSessionProvider {
|
||||
if (sqlOutputLogReaderJob != null) {
|
||||
sqlOutputLogReaderJob.join();
|
||||
}
|
||||
fillQueryResults(contextInfo, dataContainer, dbStat, hasResultSet, executeInfo, webDataFilter, dataFilter, dataFormat);
|
||||
fillQueryResults(
|
||||
contextInfo,
|
||||
dataContainer,
|
||||
dbStat,
|
||||
hasResultSet,
|
||||
executeInfo,
|
||||
webDataFilter,
|
||||
dataFilter,
|
||||
dataFormat,
|
||||
sqlElement.getOriginalText()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1066,7 +1076,9 @@ public class WebSQLProcessor implements WebSessionProvider {
|
||||
@NotNull WebSQLExecuteInfo executeInfo,
|
||||
@NotNull WebSQLDataFilter webDataFilter,
|
||||
@NotNull DBDDataFilter dataFilter,
|
||||
@Nullable WebDataFormat dataFormat) throws DBException {
|
||||
@Nullable WebDataFormat dataFormat,
|
||||
@NotNull String originalQuery
|
||||
) throws DBException {
|
||||
|
||||
List<WebSQLQueryResults> resultList = new ArrayList<>();
|
||||
int maxResultsCount = resolveMaxResultsCount(dataContainer.getDataSource());
|
||||
@@ -1110,6 +1122,7 @@ public class WebSQLProcessor implements WebSessionProvider {
|
||||
|
||||
setResultFilterText(dbStat.getSession().getDataSource(), executeInfo, dataFilter);
|
||||
executeInfo.setFullQuery(dbStat.getQueryString());
|
||||
executeInfo.setOriginalQuery(originalQuery);
|
||||
}
|
||||
|
||||
private void setResultFilterText(
|
||||
|
||||
+1
-6
@@ -34,7 +34,6 @@ import org.jkiss.dbeaver.model.meta.MetaData;
|
||||
import org.jkiss.dbeaver.model.sql.DBQuotaException;
|
||||
import org.jkiss.dbeaver.model.struct.DBSDataContainer;
|
||||
import org.jkiss.dbeaver.model.struct.DBSEntity;
|
||||
import org.jkiss.dbeaver.model.struct.DBSEntityConstraintType;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
@@ -190,15 +189,11 @@ class WebSQLQueryDataReceiver implements DBDDataReceiver {
|
||||
DBDRowIdentifier rowIdentifier = resultsInfo.getDefaultRowIdentifier();
|
||||
if (rowIdentifier == null) {
|
||||
webResultSet.setRowIdentifierState(WebSQLResultSetRowIdentifierState.METADATA_NOT_FOUND);
|
||||
} else if (rowIdentifier.getUniqueKey().getConstraintType().equals(DBSEntityConstraintType.VIRTUAL_KEY)) {
|
||||
webResultSet.setRowIdentifierState(WebSQLResultSetRowIdentifierState.VIRTUAL_KEY);
|
||||
} else if (!rowIdentifier.isIncomplete() && rowIdentifier.isValidIdentifier()) {
|
||||
webResultSet.setHasRowIdentifier(true);
|
||||
webResultSet.setRowIdentifierState(WebSQLResultSetRowIdentifierState.PRIMARY_KEY);
|
||||
List<WebSQLResultSetRowIdentifierAttribute> attributes = rowIdentifier.getAttributes().stream()
|
||||
.map(a -> new WebSQLResultSetRowIdentifierAttribute(
|
||||
a.getName(), a.getOrdinalPosition(), a.getLabel(), a.getDescription()
|
||||
))
|
||||
.map(a -> new WebSQLResultSetRowIdentifierAttribute(a.getName(), a.getOrdinalPosition()))
|
||||
.toList();
|
||||
String constraintTypeName = rowIdentifier.getUniqueKey().getConstraintType().getName();
|
||||
webResultSet.setRowIdentifier(
|
||||
|
||||
+3
-2
@@ -184,8 +184,9 @@ public class WebSQLQueryResultSet {
|
||||
/**
|
||||
* Sets info about read-only status of a result set.
|
||||
*/
|
||||
public void setReadOnlyInfo(@NotNull DBCExecutionContext executionContext) {
|
||||
public void setReadOnlyInfo(@Nullable DBCExecutionContext executionContext) {
|
||||
this.readOnly = DBExecUtils.isResultSetReadOnly(executionContext);
|
||||
this.readOnlyStatus = DBExecUtils.getResultSetReadOnlyStatus(executionContext.getDataSource().getContainer());
|
||||
this.readOnlyStatus = DBExecUtils.getResultSetReadOnlyStatus(
|
||||
executionContext == null ? null : executionContext.getDataSource().getContainer());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -29,6 +29,7 @@ import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
import org.jkiss.utils.HttpConstants;
|
||||
import org.jkiss.utils.IOUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -64,7 +65,7 @@ public class WebSQLResultServlet extends WebServiceServletBase {
|
||||
}
|
||||
Path dataFile = getDataFile(request);
|
||||
session.addInfoMessage("Download LOB file ...");
|
||||
response.setHeader("Content-Type", "application/octet-stream");
|
||||
response.setHeader(HttpConstants.HEADER_CONTENT_TYPE, "application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + dataFile.getFileName().toString() + "\"");
|
||||
response.setHeader("Content-Length", String.valueOf(Files.size(dataFile)));
|
||||
response.setDateHeader("Expires", System.currentTimeMillis() + CBConstants.STATIC_CACHE_SECONDS * 1000);
|
||||
|
||||
+1
-2
@@ -48,8 +48,7 @@ public class WebSQLResultSetRowIdentifier {
|
||||
public enum WebSQLResultSetRowIdentifierState {
|
||||
METADATA_NOT_FOUND,
|
||||
NONE,
|
||||
PRIMARY_KEY,
|
||||
VIRTUAL_KEY
|
||||
PRIMARY_KEY
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-4
@@ -1,7 +1,6 @@
|
||||
package io.cloudbeaver.service.sql;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
|
||||
public class WebSQLResultSetRowIdentifierAttribute {
|
||||
|
||||
@@ -11,9 +10,7 @@ public class WebSQLResultSetRowIdentifierAttribute {
|
||||
|
||||
public WebSQLResultSetRowIdentifierAttribute(
|
||||
@NotNull String name,
|
||||
int ordinalPosition,
|
||||
@NotNull String label,
|
||||
@Nullable String description
|
||||
int ordinalPosition
|
||||
) {
|
||||
this.name = name;
|
||||
this.ordinalPosition = ordinalPosition;
|
||||
|
||||
+24
-11
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,10 +27,12 @@ import io.cloudbeaver.service.DBWServletContext;
|
||||
import io.cloudbeaver.service.WebServiceBindingBase;
|
||||
import io.cloudbeaver.service.sql.impl.WebServiceSQL;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.NotNullWhen;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -90,7 +92,17 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
getArgumentVal(env, "generatorId"),
|
||||
getArgumentVal(env, "options"),
|
||||
getArgumentVal(env, "nodePathList"))
|
||||
).dataFetcher("sqlParseScript", env ->
|
||||
)
|
||||
.dataFetcher("sqlGenerateResultSetQuery", env ->
|
||||
getService(env).sqlGenerateResultSetQuery(
|
||||
getWebSession(env),
|
||||
getSQLContext(env),
|
||||
getArgumentVal(env, "generatorId"),
|
||||
getArgumentVal(env, "resultsId"),
|
||||
getResultsRow(env, "selectedRows")
|
||||
)
|
||||
)
|
||||
.dataFetcher("sqlParseScript", env ->
|
||||
getService(env).parseSqlScript(getWebConnection(env), getArgumentVal(env, "script"))
|
||||
).dataFetcher("sqlParseQuery", env ->
|
||||
getService(env).parseSqlQuery(
|
||||
@@ -152,7 +164,7 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
getSQLContext(env),
|
||||
getArgumentVal(env, "resultsId"),
|
||||
getArgumentVal(env, "lobColumnIndex"),
|
||||
getResultsRow(env, "row").get(0)))
|
||||
getResultsRow(env, "row").getFirst()))
|
||||
.dataFetcher("sqlReadLobValue", env ->
|
||||
getService(env).readLobValue(
|
||||
getSQLContext(env),
|
||||
@@ -291,10 +303,10 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
|
||||
@NotNull
|
||||
public static WebSQLProcessor getSQLProcessor(WebConnectionInfo connectionInfo) throws DBWebException {
|
||||
return getSQLConfiguration(connectionInfo.getSession()).getSQLProcessor(connectionInfo);
|
||||
return getSQLProcessor(connectionInfo, true);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NotNullWhen("connect")
|
||||
public static WebSQLProcessor getSQLProcessor(WebConnectionInfo connectionInfo, boolean connect) throws DBWebException {
|
||||
return getSQLConfiguration(connectionInfo.getSession()).getSQLProcessor(connectionInfo, connect);
|
||||
}
|
||||
@@ -346,16 +358,13 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
return application.isMultiuser();
|
||||
}
|
||||
|
||||
private static class WebSQLConfiguration {
|
||||
public static class WebSQLConfiguration {
|
||||
private final Map<WebConnectionInfo, WebSQLProcessor> processors = new HashMap<>();
|
||||
|
||||
public WebSQLConfiguration() {
|
||||
}
|
||||
|
||||
WebSQLProcessor getSQLProcessor(WebConnectionInfo connectionInfo) throws DBWebException {
|
||||
return WebServiceBindingSQL.getSQLProcessor(connectionInfo, true);
|
||||
}
|
||||
|
||||
@NotNullWhen("connect")
|
||||
WebSQLProcessor getSQLProcessor(WebConnectionInfo connectionInfo, boolean connect) throws DBWebException {
|
||||
if (connectionInfo.getDataSource() == null) {
|
||||
if (!connect) {
|
||||
@@ -378,6 +387,7 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public WebSQLConfiguration dispose() {
|
||||
synchronized (processors) {
|
||||
processors.forEach((connectionInfo, processor) -> processor.dispose());
|
||||
@@ -389,15 +399,18 @@ public class WebServiceBindingSQL extends WebServiceBindingBase<DBWServiceSQL>
|
||||
|
||||
///////////////////////////////////////
|
||||
// Helpers
|
||||
|
||||
@Nullable
|
||||
public static WebSQLDataFilter getDataFilter(DataFetchingEnvironment env) {
|
||||
Map<String, Object> filterProps = getArgument(env, "filter");
|
||||
return filterProps == null ? null : new WebSQLDataFilter(filterProps);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<WebSQLResultsRow> getResultsRow(DataFetchingEnvironment env, String param) {
|
||||
List<Map<String, Object>> mapList = getArgument(env, param);
|
||||
if (CommonUtils.isEmpty(mapList)) {
|
||||
return null;
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mapList.stream().map(WebSQLResultsRow::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package io.cloudbeaver.service.sql.impl;
|
||||
|
||||
import io.cloudbeaver.DBWebException;
|
||||
import io.cloudbeaver.service.sql.WebSQLContextInfo;
|
||||
import io.cloudbeaver.service.sql.WebSQLResultsRow;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.code.Nullable;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.model.DBPDataSource;
|
||||
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
|
||||
import org.jkiss.dbeaver.model.DBUtils;
|
||||
import org.jkiss.dbeaver.model.data.DBDAttributeBinding;
|
||||
import org.jkiss.dbeaver.model.data.DBDResultSetDataProvider;
|
||||
import org.jkiss.dbeaver.model.data.DBDRowIdentifier;
|
||||
import org.jkiss.dbeaver.model.data.DBDValueRow;
|
||||
import org.jkiss.dbeaver.model.data.hints.DBDValueHintContext;
|
||||
import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
|
||||
import org.jkiss.dbeaver.model.struct.DBSEntity;
|
||||
import org.jkiss.dbeaver.model.struct.DBSObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class WebDBDResultSetDataProvider implements DBDResultSetDataProvider, DBSObject {
|
||||
|
||||
private final String resultsId;
|
||||
private final WebSQLContextInfo contextInfo;
|
||||
private final List<WebSQLResultsRow> selectedRows;
|
||||
|
||||
WebDBDResultSetDataProvider(
|
||||
@NotNull String resultsId,
|
||||
@NotNull WebSQLContextInfo contextInfo,
|
||||
@NotNull List<WebSQLResultsRow> selectedRows
|
||||
) {
|
||||
this.resultsId = resultsId;
|
||||
this.contextInfo = contextInfo;
|
||||
this.selectedRows = selectedRows;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public DBDAttributeBinding[] getAttributes() throws DBWebException {
|
||||
return contextInfo.getResults(resultsId).getAttributes();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<DBDAttributeBinding> getVisibleAttributes() throws DBException {
|
||||
return Arrays.asList(getAttributes());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<? extends DBDValueRow> getAllRows() {
|
||||
return getSelectedRows();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<? extends DBDValueRow> getSelectedRows() {
|
||||
if (selectedRows.isEmpty()) {
|
||||
return List.of();
|
||||
}
|
||||
|
||||
List<WebDBDValueRow> rows = new ArrayList<>();
|
||||
for (int rowNumber = 0; rowNumber < selectedRows.size(); rowNumber++) {
|
||||
WebSQLResultsRow row = selectedRows.get(rowNumber);
|
||||
if (row != null && row.getData() != null) {
|
||||
rows.add(new WebDBDValueRow(rowNumber, row.getData()));
|
||||
}
|
||||
}
|
||||
return rows;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public DBSEntity getSingleSource() throws DBWebException {
|
||||
DBDRowIdentifier rowIdentifier = contextInfo.getResults(resultsId).getDefaultRowIdentifier();
|
||||
if (rowIdentifier == null) {
|
||||
return null;
|
||||
} else {
|
||||
return rowIdentifier.getEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public DBDRowIdentifier getDefaultRowIdentifier() {
|
||||
try {
|
||||
return contextInfo.getResults(resultsId).getDefaultRowIdentifier();
|
||||
} catch (DBWebException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getCellValue(@NotNull DBDAttributeBinding attribute, @NotNull DBDValueRow row) throws DBException {
|
||||
return DBUtils.getAttributeValue(attribute, getAttributes(), row.getValues());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getCellValue(
|
||||
@NotNull DBDAttributeBinding attribute,
|
||||
@NotNull DBDValueRow row,
|
||||
@Nullable int[] rowIndexes,
|
||||
boolean retrieveDeepestCollectionElement
|
||||
) throws DBWebException {
|
||||
return DBUtils.getAttributeValue(attribute, getAttributes(), row.getValues());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public DBDValueHintContext getHintContext() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getReadOnlyStatus(@Nullable DBPDataSourceContainer dataSourceContainer) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public DBSObject getParentObject() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public DBPDataSource getDataSource() {
|
||||
DBCExecutionContext executionContext = contextInfo.getProcessor().getExecutionContext();
|
||||
if (executionContext == null) {
|
||||
return null;
|
||||
} else {
|
||||
return executionContext.getDataSource();
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getName() {
|
||||
return WebDBDResultSetDataProvider.class.getSimpleName();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPersisted() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package io.cloudbeaver.service.sql.impl;
|
||||
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.data.DBDValueRow;
|
||||
|
||||
public class WebDBDValueRow implements DBDValueRow {
|
||||
private final int rowNumber;
|
||||
private final Object[] values;
|
||||
|
||||
public WebDBDValueRow(int rowNumber, @NotNull Object[] values) {
|
||||
this.rowNumber = rowNumber;
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRowNumber() {
|
||||
return rowNumber;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getValues() {
|
||||
return values;
|
||||
}
|
||||
}
|
||||
+51
-5
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* DBeaver - Universal Database Manager
|
||||
* Copyright (C) 2010-2025 DBeaver Corp and others
|
||||
* Copyright (C) 2010-2026 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +31,7 @@ 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.DBPDataKind;
|
||||
import org.jkiss.dbeaver.model.DBPDataSource;
|
||||
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
|
||||
import org.jkiss.dbeaver.model.DBUtils;
|
||||
@@ -66,10 +67,7 @@ import org.jkiss.dbeaver.utils.RuntimeUtils;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -248,6 +246,54 @@ public class WebServiceSQL implements DBWServiceSQL {
|
||||
@Override
|
||||
public String generateEntityQuery(@NotNull WebSession session, @NotNull String generatorId, @NotNull Map<String, Object> options, @NotNull List<String> nodePathList) throws DBWebException {
|
||||
List<DBSObject> objectList = getObjectListFromNodeIds(session, nodePathList);
|
||||
return createAndRunGenerator(session, generatorId, objectList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String sqlGenerateResultSetQuery(
|
||||
@NotNull WebSession webSession,
|
||||
@NotNull WebSQLContextInfo sqlContext,
|
||||
@NotNull String generatorId,
|
||||
@NotNull String resultsId,
|
||||
@NotNull List<WebSQLResultsRow> selectedRows
|
||||
) throws DBWebException {
|
||||
checkAndFillTruncatedData(sqlContext, resultsId, selectedRows);
|
||||
WebDBDResultSetDataProvider dataProvider = new WebDBDResultSetDataProvider(resultsId, sqlContext, selectedRows);
|
||||
return createAndRunGenerator(webSession, generatorId, Collections.singletonList(dataProvider));
|
||||
}
|
||||
|
||||
private void checkAndFillTruncatedData(
|
||||
@NotNull WebSQLContextInfo sqlContext,
|
||||
@NotNull String resultsId,
|
||||
@NotNull List<WebSQLResultsRow> selectedRows
|
||||
) throws DBWebException {
|
||||
List<DBDAttributeBinding> attributes = Arrays.stream(sqlContext.getResults(resultsId).getAttributes())
|
||||
.filter(attr -> canBeTruncated(attr.getDataKind()))
|
||||
.toList();
|
||||
for (WebSQLResultsRow row : selectedRows) {
|
||||
Object[] data = row.getData();
|
||||
for (DBDAttributeBinding attribute : attributes) {
|
||||
int position = attribute.getOrdinalPosition();
|
||||
boolean valueIsTruncated = data[position] != null &&
|
||||
data[position].toString().length() == WebSQLConstants.TEXT_PREVIEW_MAX_LENGTH;
|
||||
if (valueIsTruncated) {
|
||||
data[position] = getCellValue(sqlContext, resultsId, position, row);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canBeTruncated(@NotNull DBPDataKind dataKind) {
|
||||
return dataKind.equals(DBPDataKind.STRING) ||
|
||||
dataKind.equals(DBPDataKind.CONTENT) ||
|
||||
dataKind.equals(DBPDataKind.BINARY);
|
||||
}
|
||||
|
||||
private String createAndRunGenerator(
|
||||
@NotNull WebSession session,
|
||||
@NotNull String generatorId,
|
||||
@NotNull List<DBSObject> objectList
|
||||
) throws DBWebException {
|
||||
SQLGeneratorDescriptor generator = SQLGeneratorConfigurationRegistry.getInstance().getGenerator(generatorId);
|
||||
if (generator == null) {
|
||||
throw new DBWebException("Generator '" + generatorId + "' not found");
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Administration
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.admin;singleton:=true
|
||||
Bundle-Version: 1.0.138.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.142.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: io.cloudbeaver.server.ce,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.service.admin</artifactId>
|
||||
<version>1.0.138-SNAPSHOT</version>
|
||||
<version>1.0.142-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
-10
@@ -34,7 +34,6 @@ public class AdminServerConfig {
|
||||
private static final Log log = Log.getLog(AdminServerConfig.class);
|
||||
|
||||
private String serverName;
|
||||
private String serverURL;
|
||||
|
||||
private String adminName;
|
||||
private String adminPassword;
|
||||
@@ -60,7 +59,6 @@ public class AdminServerConfig {
|
||||
|
||||
public AdminServerConfig(Map<String, Object> params) {
|
||||
this.serverName = JSONUtils.getString(params, "serverName");
|
||||
this.serverURL = JSONUtils.getString(params, "serverURL");
|
||||
this.adminName = JSONUtils.getString(params, "adminName");
|
||||
this.adminPassword = JSONUtils.getString(params, "adminPassword");
|
||||
|
||||
@@ -133,14 +131,6 @@ public class AdminServerConfig {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public String getServerURL() {
|
||||
return serverURL;
|
||||
}
|
||||
|
||||
public void setServerURL(String serverURL) {
|
||||
this.serverURL = serverURL;
|
||||
}
|
||||
|
||||
public String getAdminName() {
|
||||
return adminName;
|
||||
}
|
||||
|
||||
+10
-13
@@ -20,9 +20,11 @@ import io.cloudbeaver.model.config.CBAppConfig;
|
||||
import io.cloudbeaver.model.session.WebSession;
|
||||
import io.cloudbeaver.model.utils.ConfigurationUtils;
|
||||
import io.cloudbeaver.server.CBApplication;
|
||||
import io.cloudbeaver.server.CBConstants;
|
||||
import io.cloudbeaver.server.CBPlatform;
|
||||
import io.cloudbeaver.server.WebAppUtils;
|
||||
import io.cloudbeaver.service.admin.AdminConnectionSearchInfo;
|
||||
import org.jkiss.code.NotNull;
|
||||
import org.jkiss.dbeaver.model.connection.DBPDriver;
|
||||
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
|
||||
import org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress;
|
||||
@@ -46,7 +48,7 @@ public class ConnectionSearcher implements DBRRunnableWithProgress {
|
||||
private final String[] hostNames;
|
||||
private final List<AdminConnectionSearchInfo> foundConnections = new ArrayList<>();
|
||||
|
||||
public ConnectionSearcher(WebSession webSession, String[] hostNames) {
|
||||
public ConnectionSearcher(@NotNull WebSession webSession, @NotNull String[] hostNames) {
|
||||
this.webSession = webSession;
|
||||
this.hostNames = hostNames;
|
||||
}
|
||||
@@ -54,6 +56,7 @@ public class ConnectionSearcher implements DBRRunnableWithProgress {
|
||||
/**
|
||||
* Returns all found connections in a current machine.
|
||||
*/
|
||||
@NotNull
|
||||
public List<AdminConnectionSearchInfo> getFoundConnections() {
|
||||
synchronized (foundConnections) {
|
||||
return new ArrayList<>(foundConnections);
|
||||
@@ -66,7 +69,7 @@ public class ConnectionSearcher implements DBRRunnableWithProgress {
|
||||
Map<String, String> localHostNames = new HashMap<>();
|
||||
for (String hostName : hostNames) {
|
||||
monitor.subTask("Search connections on '" + hostName + "'");
|
||||
if (hostName.equals("localhost") || hostName.equals("local") || hostName.equals("127.0.0.1")) {
|
||||
if (hostName.equals("localhost") || hostName.equals("local") || hostName.equals(CBConstants.HOST_127_0_0_1)) {
|
||||
for (InetAddress addr : CBPlatform.getInstance().getApplication().getLocalInetAddresses()) {
|
||||
String localHostAddress = addr.getHostAddress();
|
||||
finalHostNames.add(localHostAddress);
|
||||
@@ -105,7 +108,7 @@ public class ConnectionSearcher implements DBRRunnableWithProgress {
|
||||
}
|
||||
}
|
||||
|
||||
private void searchConnections(DBRProgressMonitor monitor, String hostName, String displayName) {
|
||||
private void searchConnections(@NotNull DBRProgressMonitor monitor, String hostName, String displayName) {
|
||||
int checkTimeout = 150;
|
||||
Map<Integer, AdminConnectionSearchInfo> portCache = new HashMap<>();
|
||||
|
||||
@@ -164,16 +167,10 @@ public class ConnectionSearcher implements DBRRunnableWithProgress {
|
||||
|
||||
private static boolean isPortInBlockList(int portNumber) {
|
||||
// All http(s) and telnet ports are in block lists
|
||||
switch (portNumber) {
|
||||
case 0:
|
||||
case 22:
|
||||
case 80:
|
||||
case 443:
|
||||
case 8080:
|
||||
case 8443:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return switch (portNumber) {
|
||||
case 0, 22, 80, 443, 8080, 8443 -> true;
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-3
@@ -5,15 +5,16 @@ import io.cloudbeaver.DBWebException;
|
||||
import io.cloudbeaver.model.session.WebSession;
|
||||
import io.cloudbeaver.server.CBApplication;
|
||||
import io.cloudbeaver.service.WebServiceServletBase;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.jkiss.dbeaver.DBException;
|
||||
import org.jkiss.dbeaver.Log;
|
||||
import org.jkiss.dbeaver.model.DBConstants;
|
||||
import org.jkiss.dbeaver.utils.GeneralUtils;
|
||||
import org.jkiss.dbeaver.utils.MimeTypes;
|
||||
import org.jkiss.utils.HttpConstants;
|
||||
import org.jkiss.utils.IOUtils;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
@@ -47,7 +48,7 @@ public class WebAdminLogsServlet extends WebServiceServletBase {
|
||||
throw new DBWebException("Log file '" + logFileName + "' not found");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Type", MimeTypes.TEXT_PLAIN);
|
||||
response.setHeader(HttpConstants.HEADER_CONTENT_TYPE, MimeTypes.TEXT_PLAIN);
|
||||
if (logFileName.equals(".log")) {
|
||||
logFileName = "server.log";
|
||||
}
|
||||
|
||||
+57
-6
@@ -38,6 +38,7 @@ 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.DBConstants;
|
||||
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
|
||||
import org.jkiss.dbeaver.model.app.DBPDataSourceRegistry;
|
||||
import org.jkiss.dbeaver.model.app.DBPProject;
|
||||
@@ -51,6 +52,7 @@ import org.jkiss.dbeaver.model.security.*;
|
||||
import org.jkiss.dbeaver.model.security.user.SMTeam;
|
||||
import org.jkiss.dbeaver.model.security.user.SMUser;
|
||||
import org.jkiss.dbeaver.utils.GeneralUtils;
|
||||
import org.jkiss.utils.ArrayUtils;
|
||||
import org.jkiss.utils.CommonUtils;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
@@ -496,7 +498,7 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
@NotNull HttpServletRequest request,
|
||||
@NotNull WebSession webSession,
|
||||
@Nullable String providerId
|
||||
) throws DBWebException {
|
||||
) {
|
||||
String origin = ServletAppUtils.getOriginFromRequest(request);
|
||||
List<WebAuthProviderConfiguration> result = new ArrayList<>();
|
||||
for (SMAuthProviderCustomConfiguration cfg : CBApplication.getInstance().getAppConfiguration().getAuthCustomConfigurations()) {
|
||||
@@ -505,7 +507,11 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
}
|
||||
WebAuthProviderDescriptor authProvider = WebAuthProviderRegistry.getInstance().getAuthProvider(cfg.getProvider());
|
||||
if (authProvider != null) {
|
||||
result.add(new WebAuthProviderConfiguration(authProvider, cfg, origin));
|
||||
result.add(new WebAuthProviderConfiguration(
|
||||
authProvider,
|
||||
maskSecuredConfigParameters(authProvider.getConfigurationParameters(), cfg),
|
||||
origin
|
||||
));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -521,7 +527,8 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
boolean disabled,
|
||||
@Nullable String iconURL,
|
||||
@Nullable String description,
|
||||
@Nullable Map<String, Object> parameters) throws DBWebException {
|
||||
@Nullable Map<String, Object> parameters
|
||||
) throws DBWebException {
|
||||
WebAuthProviderDescriptor authProvider = WebAuthProviderRegistry.getInstance().getAuthProvider(providerId);
|
||||
if (authProvider == null) {
|
||||
throw new DBWebException("Auth provider '" + providerId + "' not found");
|
||||
@@ -534,6 +541,14 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
providerConfig.setDisabled(disabled);
|
||||
providerConfig.setIconURL(iconURL);
|
||||
providerConfig.setDescription(description);
|
||||
SMAuthProviderCustomConfiguration savedConfig = getProviderConfig(id);
|
||||
if (parameters != null && savedConfig != null) {
|
||||
for (Map.Entry<String, Object> entry : parameters.entrySet()) {
|
||||
if (CBConstants.SECURED_VALUE.equals(entry.getValue())) {
|
||||
parameters.put(entry.getKey(), savedConfig.getParameter(entry.getKey()));
|
||||
}
|
||||
}
|
||||
}
|
||||
providerConfig.setParameters(parameters);
|
||||
CBApplication.getInstance().getAppConfiguration().addAuthProviderConfiguration(providerConfig);
|
||||
try {
|
||||
@@ -547,7 +562,11 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
providerConfig.getProvider(),
|
||||
webSession.getUserId()
|
||||
));
|
||||
return new WebAuthProviderConfiguration(authProvider, providerConfig, ServletAppUtils.getOriginFromRequest(request));
|
||||
return new WebAuthProviderConfiguration(
|
||||
authProvider,
|
||||
maskSecuredConfigParameters(authProvider.getConfigurationParameters(), providerConfig),
|
||||
ServletAppUtils.getOriginFromRequest(request)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -576,7 +595,6 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
CBAppConfig appConfig = new CBAppConfig(CBApplication.getInstance().getAppConfiguration());
|
||||
CBServerConfig serverConfig = new CBServerConfig();
|
||||
serverConfig.setServerName(CBApplication.getInstance().getServerName());
|
||||
serverConfig.setServerURL(CBApplication.getInstance().getServerURL());
|
||||
serverConfig.setMaxSessionIdleTime(CBApplication.getInstance().getMaxSessionIdleTime());
|
||||
String adminName = null;
|
||||
String adminPassword = null;
|
||||
@@ -606,7 +624,6 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
adminName = config.getAdminName();
|
||||
adminPassword = config.getAdminPassword();
|
||||
serverConfig.setServerName(config.getServerName());
|
||||
serverConfig.setServerURL(config.getServerURL());
|
||||
serverConfig.setMaxSessionIdleTime(config.getSessionExpireTime());
|
||||
if (config.getForceHttps() != null) {
|
||||
serverConfig.setForceHttps(config.getForceHttps());
|
||||
@@ -667,6 +684,11 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
// In config mode we always refresh because admin user doesn't exist yet
|
||||
webSession.resetUserState();
|
||||
}
|
||||
else {
|
||||
// Just reload session state
|
||||
webSession.refreshUserData();
|
||||
}
|
||||
|
||||
WebAppUtils.getWebApplication().getDriverRegistry().refreshApplicableDrivers();
|
||||
} catch (Throwable e) {
|
||||
throw new DBWebException("Error configuring server", e);
|
||||
@@ -954,4 +976,33 @@ public class WebServiceAdmin implements DBWServiceAdmin {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private SMAuthProviderCustomConfiguration maskSecuredConfigParameters(
|
||||
@NotNull List<WebAuthProviderProperty> configProperties,
|
||||
@NotNull SMAuthProviderCustomConfiguration config
|
||||
) {
|
||||
SMAuthProviderCustomConfiguration securedConfig = new SMAuthProviderCustomConfiguration(config);
|
||||
for (WebAuthProviderProperty property : configProperties) {
|
||||
String[] features = property.getFeatures();
|
||||
if (features != null && ArrayUtils.contains(features, DBConstants.PROP_FEATURE_PASSWORD)) {
|
||||
String propertyId = property.getId();
|
||||
Object securedParameterValue = config.getParameter(propertyId);
|
||||
if (securedParameterValue != null && !securedParameterValue.toString().isEmpty()) {
|
||||
securedConfig.getParameters().put(propertyId, CBConstants.SECURED_VALUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return securedConfig;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private SMAuthProviderCustomConfiguration getProviderConfig(@NotNull String configId) {
|
||||
return CBApplication.getInstance().getAppConfiguration().getAuthCustomConfigurations().stream()
|
||||
.filter(cfg -> Objects.equals(cfg.getId(), configId))
|
||||
.filter(cfg ->
|
||||
WebAuthProviderRegistry.getInstance().getAuthProvider(cfg.getProvider()) != null
|
||||
).findFirst()
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Authentication
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.auth;singleton:=true
|
||||
Bundle-Version: 1.0.138.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.142.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: io.cloudbeaver.server.ce
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.service.auth</artifactId>
|
||||
<version>1.0.138-SNAPSHOT</version>
|
||||
<version>1.0.142-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Data Transfer
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.data.transfer;singleton:=true
|
||||
Bundle-Version: 1.0.139.qualifier
|
||||
Bundle-Release-Date: 20260202
|
||||
Bundle-Version: 1.0.143.qualifier
|
||||
Bundle-Release-Date: 20260406
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-21
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Require-Bundle: io.cloudbeaver.server.ce,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<relativePath>../</relativePath>
|
||||
</parent>
|
||||
<artifactId>io.cloudbeaver.service.data.transfer</artifactId>
|
||||
<version>1.0.139-SNAPSHOT</version>
|
||||
<version>1.0.143-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
|
||||
</project>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user