dbeaver/pro#8234 only admin can overwrite existing udbt handler - #4285
dbeaver/pro#8234 only admin can overwrite existing udbt handler#4285HocKu7 wants to merge 12 commits into
Conversation
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Documentation | 1 minor |
🟢 Metrics 2 duplication
Metric Results Duplication 2
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
…te permission checks
…dmins' into dbeaver/pro#8234-udbt-only-for-admins # Conflicts: # server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/BaseLocalResourceController.java # server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java
# Conflicts: # server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java
There was a problem hiding this comment.
🟡 Changes recommended
There are correctness/robustness issues in the updated validation flow (redundant/ineffective pre-validation and a potential null stored-configuration passed into validation) that should be resolved before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR tightens server-side permission enforcement around network handler configuration changes so that only appropriately privileged users (e.g., admins) can overwrite existing handler settings when updating connections or importing/updating project data source configurations.
Changes:
- Pass a permission realm into connection configuration application so handler descriptors are resolved with permission checks.
- Add validation of network handler configuration updates against the previous (stored) configuration during data source updates and RM project config updates.
- Extend
BaseWebProjectImplwith project-awarehasRealmPermissionevaluation to support per-project permissions.
File summaries
| File | Description |
|---|---|
| server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/WebConnectionConfigInputHandler.java | Adds permission-aware configuration application and validates handler updates during datasource update/create. |
| server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/utils/WebDataSourceUtils.java | Introduces permission-realm overload and enforces permission checks when configuring network handlers. |
| server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java | Captures prior configs and validates handler changes after loading updated datasource/network profile configs. |
| server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/BaseLocalResourceController.java | Adds hooks to capture/validate stored configs and refreshes registry on load failures. |
| server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/BaseWebProjectImpl.java | Implements project-aware realm permission checks (workspace + project permissions). |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| DBPConnectionConfiguration storedConfiguration = new DBPConnectionConfiguration( | ||
| dataSource.getConnectionConfiguration() | ||
| ); | ||
| DBPConnectionConfiguration updatedConfiguration = new DBPConnectionConfiguration(storedConfiguration); | ||
| WebDataSourceUtils.setConnectionConfiguration( | ||
| dataSource.getDriver(), | ||
| updatedConfiguration, | ||
| input, | ||
| registry.getProject() | ||
| ); | ||
| validateHandlerConfigurationUpdate(storedConfiguration, updatedConfiguration); | ||
|
|
| continue; | ||
| } | ||
|
|
||
| DBPConnectionConfiguration storedConfiguration = storedDataSourceConfigurations.get(dataSource.getId()); |
Closes https://github.com/dbeaver/pro/issues/8234