Compare commits

...
354 Commits
Author SHA1 Message Date
mayerro f7218fb819 devops: revert docker 2024-01-04 11:26:59 +03:00
serge-rider 4162aeb942 23.3.2 version bump 2024-01-03 21:28:51 +03:00
serge-rider 544cd0fa5b 23.3.2 version bump 2024-01-03 21:25:06 +03:00
9aace7c0ce Cb 4364 remove spaces at the beginning of the input fields (#2252)
* CB-4364 create connection trim to SSH fields

* CB-4364 create connection trim to SSL fields

* CB-4364 create connection SSH trim cleanup

* CB-4364 create main tab trim input values

* CB-4364 connection form driver properties trimmed

* CB-4364 trimmed team creation inputs

* CB-4364 trimmed identity providers inputs

* CB-4364 fix trimmed team creation inputs so it checks property type before trim

* CB-4364 trimmed server config service

* CB-4364 trimmed user form in admin settings

* CB-4364 trimmed auth form log:pass data

* CB-4364 options, ssh, ssl create connection tabs supports trim for all of the text inputs

* CB-4364 ssl tab service cleanup

* CB-4364 refactor: cleanup auth config

* CB-4364 refactor: cleanup user form info part

* CB-4364 refactor: SSH tab do not mutated state directly

* CB-4364 refactor: AuthDIalog tab do not mutated state directly

* CB-4364 refactor: connection options tab do not mutated state directly

* CB-4364 prepare config for server configuration service

* CB-4364 fix: trim driver properties if is custom ones

* CB-4364 auth, server config, userFormPart info cleanup

* CB-4364 trim password in format FormPart function

* CB-4364 connectionDriverProps cleanup

* CB-4364 fix: format user form info

* CB-4364 connectionDriverProps cleanup with keys

* CB-4364 fix: useInfoFormPart trim user id only on creation

* CB-4364 userFormInfoPart trim user id on create in format

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2024-01-03 18:57:38 +01:00
168fb9c272 CB-3952 unify validation for connection folders and rm resources (#2264)
* CB-3952 unify validation for connection folders and rm resources

* CB-3952 adjust folder name regex

* CB-3952 adjust resource file regex

* CB-3952 use trimmed value for regex test

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2024-01-03 18:13:45 +01:00
0f253672dd Cb 4461 json and xml formatting doesnt work in value panel 🔥 (#2268)
* CB-4461 fix: json and xml formats properly

* CB-4461 fix: edited cell can show its unformatted string value

* CB-4461 fix: panel value - on empty selected cell return empty string

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2024-01-03 17:14:18 +01:00
DenisSinelnikovandDaria Marutkina 41861efb8d CB-4331. Bruteforce protection (#2262)
* CB-4331. Bruteforce protection

* CB-4331. Bruteforce protection

* CB-4331. Update bruteforce protection

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Refactor after review

* CB-4331. Fix build

* CB-4331. Fixed typo

* CB-4331. Set default value without config

* CB-4331. Set default value without config

* CB-4331. Fixed AWS IAM and NTLM log in

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2024-01-03 13:09:18 +01:00
alex d719008944 CB-3972 safe way to get action check for the document (#2261) 2024-01-03 13:46:39 +03:00
Alexey 1330b95580 chore: update vs-code configs (#2267) 2024-01-03 12:26:23 +03:00
Alexey 027b986757 CB-3464 refactor: add formate stage for form (#2266) 2024-01-03 11:28:06 +03:00
Alexander Skoblikov 7db7049fe3 CB-4424 add function isEnvironmentVariablesAccessible into DBPApplication (#2258) 2023-12-31 19:41:08 +03:00
sergeyteleshev d6cd15c5e6 Merge pull request #2256 from dbeaver/CB-3555-view-byte-type-data-decoded
Cb 3555 view byte type data decoded
2023-12-29 17:34:24 +01:00
sergeyteleshev b66fce12e2 Merge branch 'devel' into CB-3555-view-byte-type-data-decoded 2023-12-29 17:12:04 +01:00
alexandEvgenia Bezborodova 1d5dc1468b CB-3443 add format number util function (#2263)
* CB-3443 add format number util function

* CB-3443 format number from 1k

* CB-3443 include 1k in formatting

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-29 15:52:22 +01:00
alex 5f26449f30 CB-4388 add credentials menu (#2260)
* CB-4388 add credentials menu

* CB-4388 check key for undefined
2023-12-29 13:20:31 +01:00
sergeyteleshev 0f1cac99f3 Merge pull request #2259 from dbeaver/CB-4275-inconsistent-mobile-rendering
CB-4275 feat: app height set via js
2023-12-29 12:47:09 +01:00
Daria Marutkina c5182b298f Merge branch 'devel' into CB-4275-inconsistent-mobile-rendering 2023-12-29 11:28:05 +01:00
s.teleshev 071fec6b77 CB-3555 setBinaryFileValue helper 2023-12-29 11:26:11 +01:00
s.teleshev 82fa392ff4 CB-3555 add licenses 2023-12-28 13:45:01 +01:00
s.teleshev b865948f0d Merge branch 'devel' into CB-3555-view-byte-type-data-decoded 2023-12-28 13:28:52 +01:00
s.teleshev 22c6cfc82b CB-4275 useAppHeight + set default height for the app 2023-12-28 13:19:42 +01:00
s.teleshev 0faf4f7076 CB-3555 useTextValue cleanup 2023-12-28 12:02:05 +01:00
s.teleshev 56333d524e CB-3555 fix: json columns shows correctly 2023-12-28 11:45:50 +01:00
s.teleshev 7a14f903ba CB-3555 code cleanup 2023-12-28 11:45:30 +01:00
Mikhailov Grigorii ba881a242d Merge pull request #2240 from dbeaver/devops#905-alpine-dockerfile
Devops#905 alpine dockerfile
2023-12-28 12:23:48 +04:00
s.teleshev 6784715ba4 CB-4275 feat: app height set via js 2023-12-28 00:10:32 +01:00
s.teleshev b9210072ab CB-3555 use auto format cleanup 2023-12-27 14:07:59 +01:00
s.teleshev 3557e54d1f CB-3555 hide html/xml/json tabs for blob value panel 2023-12-27 14:05:44 +01:00
s.teleshev 046a540ff8 CB-3555 feat: hex/base64 tabs shows content correctly 2023-12-27 14:03:12 +01:00
s.teleshev b5f884efcb CB-3555 fix: show base64/hex in blobs only 2023-12-27 12:53:06 +01:00
s.teleshev da0ea15f17 CB-3555 :feat adds format blob to string helpers 2023-12-27 11:18:35 +01:00
s.teleshev 5041798447 Merge branch 'devel' into CB-3555-view-byte-type-data-decoded 2023-12-27 10:40:24 +01:00
sergeyteleshev 9f092b83d0 Merge pull request #2254 from dbeaver/CB-4438-fix-localization
CB-4438 team creation text with upper cases
2023-12-27 10:38:45 +01:00
DenisSinelnikovandEvgenia Bezborodova 89df586a6e CB-4211. Disable embedded drivers in TM (#2217)
* CB-4211. Disable embedded drivers in TM

* CB-4211. Fixed checkstyle

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-26 20:09:25 +03:00
AinurandEvgenia Bezborodova 9eb32a0428 CB-4312 optimize te deps (#2251)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-26 20:07:54 +03:00
s.teleshev c671532ebf CB-3555 feat: add hex and base64 tabs 2023-12-26 14:47:56 +01:00
s.teleshev a9d1d42378 CB-3555 fix: add proper interfaces to TextValuePresentation tab has all correctly working props 2023-12-26 14:46:39 +01:00
s.teleshev e9601257a3 CB-3555 isImageValuePresentationAvailable 2023-12-26 14:13:21 +01:00
Daria Marutkina d5dcdaff15 Merge branch 'devel' into CB-4438-fix-localization 2023-12-26 09:57:26 +01:00
Greg Miller a37aae9c23 #905 Added sqlite-jdbc driver to lib 2023-12-26 02:23:51 +04:00
Evgenia Bezborodova 33205ad78a Merge branch 'devel' into devops#905-alpine-dockerfile 2023-12-25 17:34:03 +03:00
alexandEvgenia Bezborodova 94041e9b44 CB-4380 add clarification message (#2249)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-25 15:24:14 +01:00
Evgenia Bezborodova 7517bdac71 Merge pull request #2255 from dbeaver/EvgeniaBzzz-patch-1
CB-23-3-1 update.md
2023-12-25 15:21:17 +03:00
Evgenia Bezborodova b0e3deccb4 CB-23-3-1 update.md 2023-12-25 15:21:03 +03:00
Greg Miller 9ea97aa54e #905 Added packeges to Dockerfile 2023-12-25 15:02:12 +04:00
s.teleshev 0175d66c33 CB-4438 team creation text with upper cases 2023-12-25 12:02:11 +01:00
Evgenia Bezborodova 883d71e387 Merge branch 'devel' into devops#905-alpine-dockerfile 2023-12-25 12:47:14 +03:00
Alexander Skoblikov 95be398806 remove forRemoval (#2250) 2023-12-24 21:55:31 +03:00
mr-anton-t 65bbe89875 Merge branch 'devel' into devops#905-alpine-dockerfile 2023-12-22 20:43:37 +01:00
alexandmr-anton-t 982485b312 Cb 4414 plugin authentication administration css modules (#2246)
* CB-4414 refactor identity providers to css modules

* CB-4414 migrate UsersTable to css modules

* CB-4414 formatting

* CB-4414 add aria-label

---------

Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-22 15:57:33 +01:00
alexandmr-anton-t 4d7ea213d4 CB-4392 support string type in useErrorDetails (#2235)
* CB-4392 support string type in useErrorDetails

* CB-4392 remove ExportNotification controller

* CB-4392 get error type from interface

* CB-4392 check hasDetails before pass callback

---------

Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-22 15:56:01 +01:00
alexandmr-anton-t 9bfe982a4c CB-4415 migrate connection search plugin to css modules (#2247)
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-22 15:54:37 +01:00
Evgenia Bezborodova a41a1308e7 Merge branch 'devel' into devops#905-alpine-dockerfile 2023-12-22 13:10:23 +03:00
Alexander SkoblikovandEvgenia Bezborodova 5cb45878c4 CB-2383 change node path format (#2207)
* CB-2383 change node path format

* CB-2383 backward compatibility fix

* CB-2383 fix frontend build

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-21 16:31:56 +03:00
alexandmr-anton-t 674569795a CB-4392 remove data export controller (#2238)
* CB-4392 remove data export controller

* CB-4412 add catch handler

---------

Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-20 19:08:47 +01:00
sergeyteleshev 6a998a030c Merge pull request #2243 from dbeaver/CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins
Cb 4417 migrate to reshadow user profile version update plugin tools plugins
2023-12-20 17:54:46 +01:00
s.teleshev 2a448cb6a4 Merge branch 'devel' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-20 17:01:46 +01:00
mayer fb72d2a15a dbeaver/dbeaver-devops#943 multicore-with-jenkins-params (#2237) 2023-12-20 18:52:53 +03:00
mr-anton-t 3ee3758969 Merge branch 'devel' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-20 15:28:53 +01:00
sergeyteleshev 4c38b08b1d Merge pull request #2244 from dbeaver/CB-4416-migrate-help-log-viewer-settings-menu-settings-panel-plugins
Cb 4416 migrate help log viewer settings menu settings panel plugins
2023-12-20 15:26:38 +01:00
s.teleshev b317966e47 CB-4417 useFrom revert container 2023-12-20 14:44:51 +01:00
s.teleshev 939a6042cb CB-4417 useFrom cleanup 2023-12-20 14:36:00 +01:00
mr-anton-t 1e62fcf3e3 Merge branch 'devel' into CB-4416-migrate-help-log-viewer-settings-menu-settings-panel-plugins 2023-12-20 13:34:19 +01:00
sergeyteleshev b1614dd237 Merge pull request #2236 from dbeaver/CB-4385-migration-from-reshadow-to-module-styles
Cb 4385 migration from reshadow to module styles
2023-12-20 13:26:13 +01:00
s.teleshev eed97a392e CB-4417 revert Tabs styles 2023-12-20 11:34:23 +01:00
s.teleshev 1c68241fe0 CB-4416 :refactor remove reshadow from plugin-settings-panel 2023-12-19 17:50:43 +01:00
s.teleshev 6067c0a384 CB-4416 :refactor remove reshadow from plugin-settings-menu 2023-12-19 17:45:29 +01:00
s.teleshev 27f748da73 CB-4416 :refactor remove reshadow from plugin-help 2023-12-19 17:44:10 +01:00
s.teleshev 7a36620f11 CB-4416 :refactor Shortcut to css modules 2023-12-19 17:43:04 +01:00
s.teleshev 7e92d4b36f Merge branch 'CB-4385-migration-from-reshadow-to-module-styles' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-19 17:26:04 +01:00
s.teleshev 58b508ceaf CB-4417 diagram footer to module styles 2023-12-19 17:00:57 +01:00
mr-anton-t a0ee9a0e4a Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-19 16:56:37 +01:00
DenisSinelnikovandEvgenia Bezborodova 7b05e9bba6 CB-4376. Upgrade logback (#2228)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-19 17:25:47 +03:00
s.teleshev b5f645a864 Merge branch 'devel' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-19 14:09:31 +01:00
mr-anton-t 0ed32eb3e8 Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-19 13:47:47 +01:00
s.teleshev bbee98292d CB-4385 rollback IconButton styles in TableFooter 2023-12-19 13:09:57 +01:00
sergeyteleshev 46e406c9b1 Merge pull request #2195 from dbeaver/CB-4325-remove-preloaded-property-from-useResource-hook
CB-4325 useResource has no action property "preload"
2023-12-19 12:58:31 +01:00
Mikhailov Grigorii 931ede5056 Merge pull request #2241 from dbeaver/devel
Update to devel
2023-12-19 15:50:13 +04:00
Greg Miller 4a55f5a425 #905 Added alpine packeges 2023-12-19 15:30:41 +04:00
s.teleshev 96b9ebf3f6 CB-4417 ToolsPanel to module styles 2023-12-19 12:23:35 +01:00
s.teleshev dbfccc8cb9 CB-4417 version update drawer item to module styles 2023-12-19 12:04:14 +01:00
mr-anton-t ac39d453c0 Merge branch 'devel' into CB-4325-remove-preloaded-property-from-useResource-hook 2023-12-19 11:48:55 +01:00
s.teleshev 0a9e8a7a0c CB-4417 :refactor Version to module styles 2023-12-19 11:33:03 +01:00
s.teleshev bb76f01886 CB-4417 :refactor DockerUpdateInstructions to module styles 2023-12-19 11:28:05 +01:00
Greg Miller aa8189c9eb #905 fix 2023-12-19 12:10:09 +04:00
s.teleshev b68f6cce3b Merge branch 'CB-4385-migration-from-reshadow-to-module-styles' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-18 23:30:44 +01:00
s.teleshev 16398bbec4 CB-4385: finish page has okay layout 2023-12-18 23:28:34 +01:00
s.teleshev a9bede499a Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-18 23:10:09 +01:00
s.teleshev 1f9e5e12c0 CB-4417 module styles for AuthTokenList 2023-12-18 22:32:46 +01:00
s.teleshev a74e29daf8 CB-4417 removed unused components UserAuthProvidersPanel 2023-12-18 22:24:56 +01:00
s.teleshev 4cb5828b6f CB-4417 removed unused components UserAuthProvidersTab 2023-12-18 22:23:44 +01:00
s.teleshev 2eaf272197 CB-4417 module styles for AuthProvidersList 2023-12-18 22:17:57 +01:00
s.teleshev 100341a724 CB-4417 module styles for UserProfileForm 2023-12-18 21:48:22 +01:00
s.teleshev 68bcb4500c CB-4417 module styles for UserForm 2023-12-18 21:36:02 +01:00
sergeyteleshev 6bc5bb4ae8 Merge pull request #2225 from dbeaver/CB-4386-unify-feature-naming
CB-4386 unify feature naming
2023-12-18 21:25:08 +01:00
s.teleshev e3c02ed8f5 CB-4386 fix: create form instead of finish for button 2023-12-18 21:17:54 +01:00
s.teleshev 942372fd6a Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-18 20:59:43 +01:00
s.teleshev 76106d3e25 CB-4417 _savePassword id for checkboxes 2023-12-18 18:34:13 +01:00
Greg Miller bed9c984c0 #905 Rewrite Dockerfile to Alpine image 2023-12-18 21:26:51 +04:00
7d410a6460 CB-3833. Refactor after big review, added logic for get secret contro… (#2177)
* CB-3833. Refactor after big review, added logic for get secret controller in EE/TM

* CB-3833. Refactor after big review

* CB-3833. Fixed tests

* UI init warning remove

* CB-3833 Secret controller init fix

* CB-3833 Secret controller API refactoring. Use secret manager configuration and secret policy. Performance

* CB-3833 Role secrets

* CB-3833 Errors throw fix

* CB-3833 Secret controller obtain fix

---------

Co-authored-by: Serge Rider <serge@jkiss.org>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-18 20:20:55 +03:00
s.teleshev 934092510f CB-4417 refactor: UserInfo 2023-12-18 18:00:13 +01:00
mr-anton-t ecd5c6fd2e Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-18 17:57:39 +01:00
s.teleshev 2de8ec84a5 Merge branch 'devel' into CB-4417-migrate-to-reshadow-user-profile-version-update-plugin-tools-plugins 2023-12-18 17:27:13 +01:00
sergeyteleshev 22276de1ba Merge pull request #2234 from dbeaver/CB-4393-cannot-validate-the-select-during-form-submission
CB-4393 fix: Cannot validate the select during form submission
2023-12-18 17:22:46 +01:00
s.teleshev bceefc19f4 Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-18 17:20:46 +01:00
s.teleshev ab43d60ecc CB-4385 :refactor cleanup the code 2023-12-18 16:10:47 +01:00
mr-anton-t 281c63a47d Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-18 13:21:27 +01:00
Evgenia Bezborodova 7d3fdf9643 Merge branch 'devel' into CB-4393-cannot-validate-the-select-during-form-submission 2023-12-18 15:15:58 +03:00
eb1ff96487 CB-4356 useForm does not switch tabs like insane after press enter (#2211)
* CB-4334. Added new property for ObjectPropertyInfo.

* CB-4277. Fixed typo

* CB-4335 added to gql "required" property for form inputs

* CB-4335 added required properties to all inputs of ObjectPropertyInfoForm

* CB-4335 added to useForm submit events handling

* CB-4335 create connection form uses useForm hook (first iteration)

* CB-4335 required fix for render field

* CB-4335 actions not required fix for connection form

* CB-4335 identify providers forms uses useForm

* CB-4335 connection form has scroll and access tab

* enable panels tab switch on invalid text input for SSH and SSL tabs

* CB-4335 all dynamic fields shows correctly

* СB-4335 made textarea required

* CB-4335 user authorization and change password has useForms

* CB-4335 team meta uses useForms

* CB-4335 team form actions uses react context

* CB-4335 Add ConnectionFormActionsContext to
ConnectionFormBaseActions

* CB-4335 Remove unnecessary required attribute from
AuthProviderForm component

* CB-4356 useForm does not switch tabs like insane after press enter

* CB-4335. Added required parameter to AuthProviderInfo

* CB-4335 auth provider form has required property

* Revert "CB-4356 useForm does not switch tabs like insane after press enter"

This reverts commit 6f658eb51e.

* CB-4356 tab panel does not switch on each enter press

* CB-4356 clean code in tabPanel component

* CB-4356 TabPanelValidation handler for switching tabs

* CB-4356 cleanup for useExecutor, TabState, TabPanel components

* CB-4356 switch tabs simplified (cleanup)

* CB-4356 highlight invalid fields after tab being switched

* CB-4356 added license to TabPanelValidation

* CB-4356 remove unneeded dep from useExecutor

* CB-4356 chore: refactor tabs validation

* feat(CB-4356): clear tabs validation state before start new one

* Revert "feat(CB-4356): clear tabs validation state before start new one"

This reverts commit 76b0a9c5ce.

* CB-4356 reset invalid element before form validation

* CB-4356 fix: executor collection usage

* fix: required field should not be required if it is readonly

* CB-4356 fix: forms shows child content correctly

* Revert "CB-4356 fix: forms shows child content correctly"

This reverts commit 4fd046b690.

* CB-4356 fix: TeamForm show users tab correctly

* CB-4356 fix: ssh key doesnt required if it is saved

* CB-4356 remove unique id error in console

* CB-4356 fix: error with form validation

* Revert "CB-4356 fix: error with form validation"

This reverts commit 0dce34f8b4.

---------

Co-authored-by: Denis Sinelnikov <denis.sinelnikov@dbeaver.com>
Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-12-18 13:03:19 +01:00
s.teleshev a2dbeb8d20 Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-18 11:40:24 +01:00
serge-rider dcddb57cee 23.3.1 version bump 2023-12-18 10:31:37 +03:00
serge-rider c0f9d8d232 23.3.1 version bump 2023-12-18 10:31:08 +03:00
s.teleshev 7f06dd5632 CB-4385 :refactor license to css 2023-12-16 20:52:23 +01:00
s.teleshev 987d8aaa6f CB-4385 :refactor license to MenuBarSmallItem 2023-12-16 20:48:39 +01:00
s.teleshev 6003684277 CB-4385 :refactor PropertiesTable to module styles 2023-12-16 20:31:19 +01:00
s.teleshev 03b83ebf73 CB-4395 :refactor IconButton outer styles passed correctly 2023-12-16 19:52:03 +01:00
s.teleshev a06097b464 Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-16 19:42:31 +01:00
s.teleshev c2abce61db CB-4385 removed unneeded styles 2023-12-15 18:09:21 +01:00
alexandmr-anton-t 7e78859957 CB-4397 remove custom connection controller (#2229)
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-15 17:49:19 +01:00
mr-anton-t 9c38508009 Merge branch 'devel' into CB-4325-remove-preloaded-property-from-useResource-hook 2023-12-15 15:55:58 +01:00
mr-anton-t b7670d15d2 Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-15 15:53:38 +01:00
s.teleshev cdd4ecc50c Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-15 15:51:43 +01:00
Alexeyandmr-anton-t 2f7c674ab9 CB-4332 refactor: migrate some parts of application to css-modules (#2194)
* CB-4332 refactor: migrate some parts of application to css-modules

* CB-4332 fix: aria attribute name

* CB-4332 refactor: remove ADMINISTRATION_TOOLS_PANEL_STYLES

* CB-4332 fix: inputs

* CB-4332 fix: conflicts

* СИ-4396 fix: sql editor sync

---------

Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-15 17:28:05 +03:00
s.teleshev a3366ef3fe Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-15 14:34:45 +01:00
Serge Rider 0ef0b319aa dbeaver/pro#2175 Cloud configuration load error handle (#2185) 2023-12-15 13:27:45 +03:00
s.teleshev 8b4d59079a CB-4393 fix: Combobox validation input uses inputValue as value prop 2023-12-15 11:19:21 +01:00
s.teleshev 038d38879f CB-4393 fix: adds Combobox validation input for form submission 2023-12-15 10:45:19 +01:00
Alexey 694302f41c CB-4396 fix: remove getter (#2230) 2023-12-15 11:39:56 +03:00
alexandEvgenia Bezborodova 582924335c CB-4390 increase notifications pool to 20 (#2224)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-15 11:37:24 +03:00
AlexeyandEvgenia Bezborodova d8d929ecda CB-4302 fix: always display auth methods tab (#2231)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-15 11:36:55 +03:00
s.teleshev 2818824965 Merge branch 'refactor/cb-4332/css-modules/ee-parts' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-15 09:36:00 +01:00
AlexeyandDaria Marutkina 3050cd8b45 CB-2196 chore: update react-data-grid (#2199)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-12-15 11:35:41 +03:00
s.teleshev a2b7b6701d Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-15 09:29:35 +01:00
s.teleshev 128c3c310b CB-4385 refactor: removed reshadow ADMINISTRATION_TOOLS_PANEL_STYLES 2023-12-15 09:26:50 +01:00
mr-anton-t bd2d518eed Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-15 01:59:51 +01:00
mr-anton-t ebe24f7e97 Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-14 20:00:40 +01:00
s.teleshev 3c3d2f9b35 CB-4385 refactor: finish page to css modules 2023-12-14 18:02:18 +01:00
serge-rider 50a898b75a UI init warning remove 2023-12-14 19:36:20 +03:00
mr-anton-t db83920588 Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-14 17:35:49 +01:00
s.teleshev 4f8b2e1494 Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-14 17:30:11 +01:00
Evgenia Bezborodova db1ea4451e Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-14 19:14:23 +03:00
0f00c234d3 CB-4058 errors in console (#2180)
* CB-4058 invalid authorization - invalid creds (no error)

* CB-4058 table error cause no error when ref is updated while render

* CB-4058 removed from console session expire logs after session being expired

* Revert "CB-4058 removed from console session expire logs after session being expired"

This reverts commit a506f4cbe7.

* CB-4058 session errors fix

* CB-4058 remove error from userInfo

* CB-4058 remove redundant code

* CB-4059 useAutoLoad session error fixed

* CB-4059 clean code after refactor

* CB-4059 clean code after refactor [2]

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
Co-authored-by: Alexey <wrouds@gmail.com>
2023-12-14 18:31:46 +03:00
2fc9f36ddb CB-2755 add lock icon on readonly sql editor tab scripts (#2181)
* CB-2755 add lock icon on readonly sql editor tab scripts

* CB-2755 readonly localization in core-localization module

* CB-2755 lock is showed instead of unresolved mark in read-only scripts

* CB-2755 lock and unsaved mark positioning

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-12-14 18:29:07 +03:00
63186a17c4 CB-4349 remove templates controller (#2215)
* CB-4349 remove templates controller

* CB-4349 review fixes

* CB-4349 review fixes

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-14 18:24:27 +03:00
AlexeyandEvgenia Bezborodova 2cbdba177a CB-3696 feat: codemirror hyperlinks extension (#2216)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-14 18:23:39 +03:00
AinurandEvgenia Bezborodova 3fd5f4d011 CB-4336 remove derby driver (#2214)
* CB-4336 update derby driver

* CB-4336 remove derby driver

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-14 17:43:38 +03:00
s.teleshev 35901cbf15 CB-4386 chore: added connections_connection_test_tooltip and fixed button name 2023-12-14 15:34:23 +01:00
Evgenia Bezborodova 69aaaf00b7 Merge branch 'devel' into CB-4386-unify-feature-naming 2023-12-14 17:14:50 +03:00
Aleksei Potsetsuev f61ac47c1c CB-4332 fix: conflicts 2023-12-14 21:22:04 +08:00
Aleksei Potsetsuev 13a0fc258c CB-4332 fix: inputs 2023-12-14 20:47:12 +08:00
mr-anton-t 072646c9e0 Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-14 13:43:23 +01:00
807365f42c CB-4306 update ce deps (#2206)
* CB-4306 update ce deps

* CB-4306 update yarn lock

* CB-4306 revert quadtree-ts

* CB-4306 lock version

* CB-4306 pass missed globals to the vm context

* CB-4306 revert prettier version

* CB-4306 add types

* CB-4306 fix: msw types

* CB-4306 refactor: remove reshadow types declaration

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-14 15:25:10 +03:00
s.teleshev 30c450efb7 CB-4386 chore: keep the key ui_processing_create 2023-12-14 12:22:29 +01:00
s.teleshev d20cda4398 Revert "CB-4386 chore: ui_processing_create for all forms according to dbeaver"
This reverts commit 2bb259379a.
2023-12-14 12:17:35 +01:00
Aleksei Potsetsuev d4b9bdd3c2 Merge remote-tracking branch 'origin/devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-14 19:05:23 +08:00
Serge Rider 91bec0b813 dbeaver/pro#2176 Localhost IP resolve (#2176)
* dbeaver/pro#2176 Localhost IP resolve

* dbeaver/pro#2176 Localhost name resolve
2023-12-14 14:04:19 +03:00
s.teleshev 2bb259379a CB-4386 chore: ui_processing_create for all forms according to dbeaver 2023-12-14 11:52:57 +01:00
Aleksei Potsetsuev da0055fb75 Merge remote-tracking branch 'origin/devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-14 18:41:25 +08:00
s.teleshev 17f9b70dc9 CB-4386 chore: customConnection_main naming 2023-12-14 11:18:24 +01:00
s.teleshev 215b557273 CB-4386 chore: fix non en & ru locales 2023-12-14 11:16:37 +01:00
s.teleshev 9ccf56f7d4 CB-4386 chore: "show scripts" fix according to dbeaver 2023-12-14 11:01:23 +01:00
s.teleshev e5d6ad121d CB-4386 chore: ui_processing_finish for all forms according to dbeaver 2023-12-14 10:58:14 +01:00
AlexeyandEvgenia Bezborodova 5779100b9a CB-4348 fix: parse sql script (#2212)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-14 12:57:54 +03:00
alexandmr-anton-t 6c456c8a63 CB-4297 bump node version (#2204)
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-14 12:56:36 +03:00
Serge Rider 13888efe95 dbeaver/pro#2181 DI + platform initialization refactoring (#2190)
* dbeaver/pro#2181 DI + platform initialization refactoring

* dbeaver/pro#2181 Tests headless environment
2023-12-14 12:55:12 +03:00
s.teleshev 1493f18e0e CB-4386 chore: connection translations according to dbeaver 2023-12-13 22:48:23 +01:00
s.teleshev 3e2530ec55 CB-4386 chore: replace customConnection_options translations 2023-12-13 22:38:59 +01:00
s.teleshev 985cc8078b CB-4386 chore: replace revert to cancel 2023-12-13 21:29:58 +01:00
s.teleshev a8df087958 CB-4386 chore: features naming according to dbeaver 2023-12-13 21:25:05 +01:00
mayer 9e2a6ce35a Devops#823 build servers and front end separately (#2163)
* dbeaver/dbeaver-devops#823 separated back front

* dbeaver/dbeaver-devops#823 updated SAMPLE_DATABASE_PATH var definition

* dbeaver/dbeaver-devops#823 removed unbound variable exception
2023-12-13 17:37:35 +01:00
Ainur a68737f329 CB-4383 use jakarta 5 fix (#2223)
* CB-4383 use jakarta 5

* CB-4383 use jakarta servlet from orbit
2023-12-13 18:29:16 +03:00
5117dcc106 CB-4266 change notification display (#2184)
* CB-4266 notifications fixed size

* CB-4266 action snack bar fixed size

* CB-4266 snack bar fixed size

* CB-4266 export notification fixed size

* CB-4266 DataSynchronizationNotification fixed size

* CB-4266 ProcessSnackbar fixed size

* Revert "CB-4266 ProcessSnackbar fixed size"

This reverts commit 6a780e387f.

* CB-4266 all notifications container has 172px height

* CB-4266 revert styles

* CB-4266 use divs in notifications after removing of reshadow styles

* CB-4266 add license

* CB-4266 show only 1 notification visible

* CB-4266 export notification uses pre tag

* Revert "CB-4266 show only 1 notification visible"

This reverts commit 5e4b237abd.

* CB-4266 display notifications in fixed height window one by one

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-13 17:38:07 +03:00
Ainur 8d47238938 CB-4383 use jakarta 5 (#2222) 2023-12-13 17:21:20 +03:00
s.teleshev ee1433af49 Merge branch 'devel' into CB-4325-remove-preloaded-property-from-useResource-hook 2023-12-13 14:03:02 +01:00
Alexey 1b5a5ac5fa Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-13 15:31:42 +03:00
AlexeyandEvgenia Bezborodova 60c320708a CB-4302 refactor: reorganize auth methods (#2208)
* CB-4302 refactor: reorganize auth methods

* CB-4302 fix: type casting

* CB-4302 fix: add overflow for users providers

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-13 15:27:26 +03:00
Ainur 272690b8c1 CB-4276 migrate to jakarta servlet api (#2213) 2023-12-13 14:53:57 +03:00
mr-anton-t 77c493d5fa Merge branch 'devel' into CB-4325-remove-preloaded-property-from-useResource-hook 2023-12-13 11:52:50 +01:00
Aleksei Potsetsuev 571830f1ae CB-4332 refactor: remove ADMINISTRATION_TOOLS_PANEL_STYLES 2023-12-13 16:16:18 +08:00
Aleksei Potsetsuev 9522b176f5 Merge remote-tracking branch 'origin/devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-13 15:46:19 +08:00
9a69f4e660 Cb 3963 migrate core view to css modules (#2192)
* CB-3963 error message reshadow refactor

* CB-3963 remove extra reshadow use from ItemListSearch

* CB-3963 remove reshadow from TopAppBar

* CB-3963 remove unused LoadingScreen component

* CB-3963 removed reshadow from VersionUpdate

* CB-3963 removed reshadow from VersionSelector

* CB-3963 removed reshadow from renderLayout

* CB-3963 removed reshadow from AuthenticationProvider

* CB-3963 removed reshadow from VersionInfo

* CB-3963 removed reshadow from TableItemSelect

* CB-3963 removed reshadow from CaptureView

* CB-3963 removed reshadow from ConnectionList

* CB-3963 removed reshadow from WizzardStepper

* CB-3963 removed reshadow from ConfigurationWizardTittle

* Revert "CB-3963 removed reshadow from AuthenticationProvider"

This reverts commit d5828c2689.

* CB.3963 fix checkboxes margin in table items

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-13 10:45:31 +03:00
s.teleshev a62ac973dc Merge branch 'devel' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-12 16:23:10 +01:00
e9081598e3 CB-3990 removed big version of logo (#2186)
Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-12-12 18:12:24 +03:00
923dadee86 CB-3961 removed ADMINISTRATION_TOOLS_PANEL_STYLES from core-administr… (#2171)
* CB-3961 removed ADMINISTRATION_TOOLS_PANEL_STYLES from core-administration

* Revert "CB-3961 removed ADMINISTRATION_TOOLS_PANEL_STYLES from core-administration"

This reverts commit 50bb0160c8.

* CB-3961 removed reshadow from core-administration

* CB-3961 styles for table has gray color

* CB-3961 ToolsPanel has 2 modes: surface and secondary

* CB-3961 primary/secondary toolsPanel styles fix

* CB-3961 table footer height is 30px

* CB-3961 table footer height is initial

* CB-3961 no border for footer table + min-height 32 px as it was

* CB-3961 no border for footer in table

* CB-3961 remove EE border bottom at ToolsPanel

* CB-3961 remove EE border bottom at ToolsPanel

---------

Co-authored-by: s.teleshev <s.teleshev@mu.se>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-12 18:11:59 +03:00
s.teleshev 6ed92dab14 refactor(CB-4385): removed reshadow from IconButton 2023-12-12 13:15:26 +01:00
s.teleshev e6d3458855 Merge branch 'refactor/cb-4332/css-modules/ee-parts' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-12 12:54:49 +01:00
s.teleshev d19dfd0c8f Merge branch 'CB-3963-migrate-core-view-to-css-modules' into CB-4385-migration-from-reshadow-to-module-styles 2023-12-12 12:54:26 +01:00
s.teleshev 583d342c8b Merge branch 'devel' into CB-4325-remove-preloaded-property-from-useResource-hook 2023-12-12 12:00:35 +01:00
Aleksei Potsetsuev ef93be4842 CB-4332 fix: aria attribute name 2023-12-12 17:33:14 +08:00
mr-anton-t a46c5fc974 Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-11 12:26:26 +01:00
serge-rider 21a9e78381 Code style 2023-12-09 17:19:08 +03:00
mr-anton-t a5b9041cf0 Merge branch 'devel' into refactor/cb-4332/css-modules/ee-parts 2023-12-08 17:20:36 +01:00
mr-anton-t b561a8f707 Merge branch 'devel' into CB-3963-migrate-core-view-to-css-modules 2023-12-08 16:45:45 +01:00
serge-rider 43f50f2ff3 dbeaver/pro#2176 Localhost IP resolve fix 2023-12-08 13:35:52 +03:00
serge-rider 96a163c50e dbeaver/pro#2176 Localhost domain name resolve fix 2023-12-08 07:47:35 +03:00
Ainurandnaumov 36061a03c4 CB-4314 add test locale (#2209)
Co-authored-by: naumov <iamemptyhuh@gmail.com>
2023-12-07 14:26:34 +03:00
serge-rider a9e727a9d2 Merge remote-tracking branch 'origin/devel' into devel 2023-12-07 10:08:09 +03:00
serge-rider 1220e4ba38 Logging and code style 2023-12-07 10:07:41 +03:00
alex f58f2a3c90 Update frontend.yml (#2205) 2023-12-06 20:58:33 +01:00
AlexeyandDaria Marutkina bb3ee1d822 CB-4317 fix: require authentication to load connection origin details (#2189)
* CB-4317 fix: require authentication to load connection origin details

* CB-4317 fix: ensure user loaded and up to date

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-12-06 20:36:05 +03:00
s.teleshev ca378a4e53 CB.3963 fix checkboxes margin in table items 2023-12-06 13:37:10 +01:00
mr-anton-t 9b728aec67 Merge branch 'devel' into CB-3963-migrate-core-view-to-css-modules 2023-12-06 12:29:07 +01:00
Alexeyandmr-anton-t b83cd0d883 CB-4060 feat: remove data-testid attribute (#2166)
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-12-06 09:54:51 +03:00
mr-anton-t ad9cebdaf9 Merge branch 'devel' into CB-3963-migrate-core-view-to-css-modules 2023-12-06 00:22:48 +01:00
Ainur 669ad9cb66 CB-4328 get updated rows info only using key identifier attributes (#2193)
* CB-4328 get updated rows info only using key identifier attributes

* CB-4328 do not refresh row for nosql db
2023-12-05 19:57:21 +03:00
s.teleshev 5aa474a000 CB-4325 removed console log 2023-12-05 09:57:48 +01:00
s.teleshev 53ea6dce4f CB-4325 useResource has no action property "preload" 2023-12-04 18:48:38 +01:00
Aleksei Potsetsuev e899e49cb6 CB-4332 refactor: migrate some parts of application to css-modules 2023-12-05 00:13:22 +08:00
s.teleshev fc518b2ef5 Revert "CB-3963 removed reshadow from AuthenticationProvider"
This reverts commit d5828c2689.
2023-12-04 13:26:00 +01:00
s.teleshev a09c63d639 CB-3963 removed reshadow from ConfigurationWizardTittle 2023-12-04 13:24:22 +01:00
s.teleshev f0e5e639dc CB-3963 removed reshadow from WizzardStepper 2023-12-04 13:22:01 +01:00
s.teleshev df585f1852 Merge branch 'devel' into CB-3963-migrate-core-view-to-css-modules 2023-12-04 13:01:21 +01:00
s.teleshev 6953e6fa9a CB-3963 removed reshadow from ConnectionList 2023-12-04 12:59:43 +01:00
s.teleshev b4d31d396d CB-3963 removed reshadow from CaptureView 2023-12-04 12:53:34 +01:00
Daria Marutkina 081dcfcda5 Merge pull request #2191 from dbeaver/dariamarutkina-patch-1
CB_2330 chore: update README
2023-12-04 12:52:51 +01:00
Daria Marutkina b710f55684 CB_2330 chore: update README 2023-12-04 12:52:11 +01:00
s.teleshev da688df4f9 CB-3963 removed reshadow from TableItemSelect 2023-12-02 14:24:45 +01:00
s.teleshev c8d29fe57f CB-3963 removed reshadow from VersionInfo 2023-12-01 19:07:28 +01:00
s.teleshev d5828c2689 CB-3963 removed reshadow from AuthenticationProvider 2023-12-01 18:36:05 +01:00
s.teleshev bcbfd7e2df CB-3963 removed reshadow from renderLayout 2023-12-01 18:26:48 +01:00
s.teleshev 8ba210bd81 CB-3963 removed reshadow from VersionSelector 2023-12-01 15:45:19 +01:00
s.teleshev 8293cd4515 CB-3963 removed reshadow from VersionUpdate 2023-12-01 15:24:12 +01:00
s.teleshev e4e1e179c0 CB-3963 remove unused LoadingScreen component 2023-12-01 14:15:35 +01:00
s.teleshev 1c0dbb15f6 CB-3963 remove reshadow from TopAppBar 2023-12-01 14:12:16 +01:00
s.teleshev 0a04d60512 CB-3963 remove extra reshadow use from ItemListSearch 2023-12-01 14:09:50 +01:00
s.teleshev edfd4ad063 CB-3963 error message reshadow refactor 2023-12-01 13:36:06 +01:00
Alexander Skoblikov 4ea74d92f8 CB-4110 change default user team description (#2178) 2023-11-28 22:14:59 +03:00
Alexander SkoblikovandDaria Marutkina 07781c3c85 CB-4239 secured same site (#2175)
* CB-4239 use more secured same site for auth

* CB-4239 validate content type for gql requests

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-28 19:07:24 +03:00
alexandEvgenia Bezborodova e8bf1baf51 CB-4281 send saveCredentials flag only if credentials exist (#2154)
* CB-4281 send saveCredentials flag only if credentials exist

* CB-4281 send save creds flag only if there is auth model id

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-28 17:37:43 +03:00
alexandDaria Marutkina ef8a4809fa CB-4111 take as much width as needed in inline mode (#2172)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-28 15:59:59 +03:00
AlexeyandDaria Marutkina c3d6490efb CB-3975 fix: selection out of boundaries (#2173)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-28 15:58:05 +03:00
AlexeyandEvgenia Bezborodova 76a440c482 CB-2974 feat: allow private connections selecting for sql editor (#2167)
* CB-2974 feat: allow private connections selecting for sql editor

* CB-2974 fix: typo

* CB-2974 chore: decrease message delay

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-28 15:57:25 +03:00
alexandDaria Marutkina 660c175c66 CB-4205 do not shrink status icon (#2169)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-28 13:34:32 +03:00
772864451e Cb 4255 output logs optional severity (#2170)
* CB-4255 show message separately if no severity

* CB-4255 output log for oracle fix

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-27 20:20:22 +03:00
AinurandEvgenia Bezborodova 65c2631d43 CB-4238 disable embedded drivers (#2161)
* CB-4238 disable embedded drivers

* CB-4238 code style fix

* CB-3794 rename vars and use linkedhashset

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-27 20:18:15 +03:00
Ainur 5a0558731d CB-3794 s3 root folder name get fix (#2168) 2023-11-27 20:17:32 +03:00
alexandEvgenia Bezborodova e68269efc1 CB-4230 pass case insensitive key to users resource (#2162)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-27 10:38:42 +03:00
6075fe0003 CB-4269 move recommendations group (#2159)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-11-24 13:56:39 +01:00
alexandDaria Marutkina 65bb6661be CB-4272 rerender inputs on configuration change (#2155)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-24 13:55:37 +01:00
ElizabethandMatvey16 9b48c42a59 dbeaver/dbeaver#18036 Update DB2 driver version (#2147)
Co-authored-by: Matvey16 <82543000+Matvey16@users.noreply.github.com>
2023-11-24 14:12:16 +03:00
serge-rider 9b8f52aaf6 23.3.0 version bump 2023-11-24 12:57:19 +03:00
DenisSinelnikovandEvgenia Bezborodova bf7e23ebb4 CB-4241. Refactor after review (#2158)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-23 16:28:07 +03:00
1e45a8185e CB-4165. Added acs property (#2153)
* CB-4165. Added acs property

* CB-4165. Added link to graphql

* CB-4165 show acs link in form

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-23 16:27:20 +03:00
DenisSinelnikovandDaria Marutkina 90a3c561a4 CB-4220. Show real S3 message (#2137)
* CB-4220. Show real S3 message

* CB-4165. Fixed after review

* CB-4220. Refactor after review

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-23 16:25:24 +03:00
AinurandDaria Marutkina d3894a487c CB-4217 fix drivers deps (#2145)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-23 15:57:08 +03:00
Alexander SkoblikovandEvgenia Bezborodova cecc47a3d1 Cb 4195 authentication security concerns (#2151)
* CB-4195 wip

* CB-4195 show remaining session lifetime

* CB-4195 remove unused class

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-23 15:54:29 +03:00
alexandDaria Marutkina 88a23978ee CB-4259 update vulnerable packages (#2148)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-22 18:56:03 +01:00
alexandEvgenia Bezborodova afe39be839 CB-4210 mark base source updated on load (#2150)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-22 13:28:01 +01:00
da9ff59cae CB-1494 change result tabs ordering logic (#2135)
Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-21 15:34:37 +01:00
alexandDaria Marutkina 07a636b57f CB-4187 keep empty properties for test purpose (#2136)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-21 15:34:15 +01:00
mayerro 76d4b49ac0 removed wget tool from base image 2023-11-21 11:59:51 +01:00
Evgenia Bezborodova 0ecadc2617 Merge pull request #2146 from dbeaver/EvgeniaBzzz-patch-1
CB_2325 chore: update README
2023-11-20 17:00:25 +03:00
Evgenia Bezborodova 9972c9aa60 CB_2325 chore: update README 2023-11-20 17:00:11 +03:00
Alexey 6179ed2202 Update devcontainer.json (#2141) 2023-11-18 01:44:54 +03:00
Alexey 3f5e9a45cd chore: devcontainer (#2140) 2023-11-18 02:09:38 +04:00
Alexey f997c09575 Create devcontainer.json (#2139) 2023-11-17 20:58:36 +03:00
a319b1fec3 CB-4196 add delete user functionality (#2121)
* CB-4196 add delete user functionality

* CB-4196 review fixes

* CB-4196 use div for Text component

* CB-4196 add onDelete callback

* CB-4197 delete user project after deleting user

* CB-4196 add project deletion error to session log

* CB-4196 make a disable dialog slightly larger

* CB-4196 change button styles

* CB-4197 add events for deleting user

* CB-4197 code style fix

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Ainur <yagudin10@yandex.ru>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-15 23:09:22 +03:00
dfd572aa4c CB-4173 configurable iam provider (#2126)
* CB-4174 configurable iam provider

* CB-4174 refactor: display only available auth providers

* CB-4174 refactor: display only available auth providers

* CB-4174 refactor: display only available auth providers

* CB-4174 chore: remove unused config properties

---------

Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-15 20:12:53 +03:00
Alexey c6e8d27e31 fix: deployment (#2134) 2023-11-15 18:41:47 +03:00
Alexander Skoblikov af19435e12 clean manifest (#2133) 2023-11-15 16:32:44 +03:00
AlexeyandDaria Marutkina 6299e73bcd CB-4091 fix: partial data loading with resource (#2132)
* CB-4091 fix: partial data loading with resource

* CB-4091 refactor: track outdated includes

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-15 15:44:01 +03:00
mayerro ec3ef25871 dbeaver/dbeaver-devops#867 added lang env var in image 2023-11-15 11:13:54 +01:00
39135e8cb4 CB-4114 Drag-n-drop for files to external file systems (#2109)
* CB-4212 fs copy gql api

* CB-4212 update fs objectId format

* CB-4114 feat: copy files in file systems

* Revert "CB-4114 feat: copy files in file systems"

This reverts commit e210dc29b7.

* CB-4212 use api with node path

* CB-4114 feat: task progress indication

---------

Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Ainur <yagudin10@yandex.ru>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-15 11:46:54 +03:00
DenisSinelnikovandDaria Marutkina da010a55ff CB-4152. Refactor after review (#2116)
* CB-4152. Refactor after review

* CB-4152. Fixed test

* CB-4152. Fixed test

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-14 19:46:35 +03:00
Serge Rider bc03a698b2 dbeaver/pro#2101 MySQL driver upgrade + mysql5 driver deprecated (#2130) 2023-11-14 19:42:14 +03:00
7de1d8ce66 CB-3777 api for getting row count (#2100)
* CB-3777 api for getting row count

* CB-4176 add rows total count

* CB-4177 count rows from sql queries

* CB-4176 review fixes

* CB-3777 refactor: use active task instead of currentTask in database datasource

* CB-3777 fix: don't use private params

* CB-4176 revert currentTask

* CB-4176 add error message

* CB-4176 add tooltip

* CB-4176 change locales

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-14 17:28:27 +03:00
d4f733ebd9 CB-3781 add metadata information (#2129)
* CB-3781 add metadata information

* CB-3781 use build in codemirror portal

* CB-3781 remove extra styles

* CB-3781 vscode like info

---------

Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-14 16:49:13 +03:00
mayer 63329ddfc5 Devops new docker base image (#2131)
* dbeaver/dbeaver-devops#867 changed docker base image

* dbeaver/dbeaver-devops#867 added java patch

* dbeaver/dbeaver-devops#867 latest base image
2023-11-14 13:07:40 +01:00
Serge Rider 78d680a736 dbeaver/pro#1895 NIO URI parser (#2119) 2023-11-14 11:25:33 +03:00
Alexey d087a4b5b0 refactor: use 8080 port for dev server (#2124) 2023-11-13 21:47:55 +03:00
Alexander Skoblikov 519c6ded3f Revert "Devops new docker base image (#2127)" (#2128)
This reverts commit a1c0ed439d.
2023-11-13 18:57:25 +01:00
mayer a1c0ed439d Devops new docker base image (#2127)
* dbeaver/dbeaver-devops#867 changed docker base image

* dbeaver/dbeaver-devops#867 added java patch
2023-11-13 17:48:07 +01:00
AinurandDaria Marutkina 756310d8ee CB-4015 get info after updating result set (#2122)
* CB-4015 key receiver use fix

* CB-4015 get rows info after updating table

* CB-4015 extract common class for row data receiver

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-13 19:33:16 +03:00
9949286788 Cb 4198 gcp file system support (#2115)
* CB-4198 uri fix for file systems

* CB-4114 feat: copy files in file systems

* CB-4198 fs api use node path

* CB-4198 apply changes in navigator node fix

* CB-4198 use node path for file systems

* CB-4198 add child node from servlet fix

* CB-4198 refactor: file system API

* CB-4198 fix: types

* CB-4198 fix: file rename behaviour

* CB-4198 rename node fix

---------

Co-authored-by: Aleksei Potsetsuev <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-13 14:18:02 +03:00
serge-rider 229281f0aa 23.2.5 version bump 2023-11-11 08:34:50 +01:00
AinurandEvgenia Bezborodova 3b27dd835d CB-4056 qm configuration (#2110)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-10 19:59:51 +03:00
AinurandDaria Marutkina 179751b34d CB-4154 rp add te role header and auth log (#2117)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-10 17:50:29 +01:00
alexandDaria Marutkina 212f4a1712 CB-3985 show password for all users if local provider is enabled (#2113)
* CB-3985 show password for all users if local provider is enabled

* CB-3985 remove extra imports

* CB-3985 review fixes

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-10 17:37:45 +03:00
Alexander SkoblikovandEvgenia Bezborodova f50df1f859 CB-4231 fix initial data migration (#2120)
Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-10 15:27:38 +03:00
Alexeyandmr-anton-t c60598104a CB-4201 fix: version update instructions (#2114)
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-11-10 13:06:32 +03:00
Alexander Skoblikov 792b2725e0 fix logging in tests (#2118) 2023-11-09 18:55:10 +03:00
DenisSinelnikovandEvgenia Bezborodova 067f79dca4 CB-4181. Remove default login password for admin (#2107)
* CB-4181. Remove default login password for admin

* CB-4181. Revert logic for delete old admin

---------

Co-authored-by: Evgenia Bezborodova <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-11-08 17:50:27 +03:00
Alexander SkoblikovandDaria Marutkina 9fce0c897b CB-3971 validate main session (#2106)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-07 17:33:15 +03:00
Daria Marutkina b451fb32d6 Merge pull request #2108 from dbeaver/dariamarutkina-patch-1
CB_2324 chore: update README
2023-11-06 16:00:49 +01:00
Daria Marutkina 6a3fd79858 CB_2324 chore: update README 2023-11-06 16:00:30 +01:00
serge-rider 1653f7709f 23.2.4 version bump 2023-11-01 21:10:12 +01:00
serge-rider e3608a2504 23.2.4 version bump 2023-11-01 20:21:03 +01:00
b3c1cebd69 CB-4097 fix: set user role when creation user (#2101)
* CB-4097 fix: set user role when creation user

* CB-4097 fix: validate role correctly

* CB-4097 validate team before deleting

* CB-4097 fix: detect auth role correctly

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
2023-11-01 22:09:20 +03:00
0610759ac2 CB-4049. Added support https on Jetty level (#2093)
* CB-4049. Added support https on Jetty level

* CB-4049. Update configuration files

* CB-4049. Added comments for SSl configuration

* CB-4049. Renamed configuration param

* CB-4049 use same port for ssl

---------

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
2023-11-01 20:05:16 +03:00
Serge RiderandDaria Marutkina ff770a1270 dbeaver/pro#2008 Patch server start scripts (#2094)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-01 18:39:34 +03:00
AinurandDaria Marutkina 4c7b9fca95 CB-4127 ssl show certificates (#2097)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-11-01 16:50:39 +03:00
AlexeyandEvgeniaBzzz f98b9aa989 CB-4149 fix: easy config localization (#2103)
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-31 18:57:34 +03:00
Alexander Skoblikov 1ecdced23e CB-4186 fix rm api (#2104) 2023-10-31 18:57:25 +03:00
cb60358ae6 Cb 4112 open scripts datasets from virtual file systems (#2089)
* CB-4125 use base path

* CB-4112 feat: read objectId

* CB-4145 add required auth to fs system api

* CB-4145 move feature

* CB-4112 feat: open scripts from file systems

* CB-4125 improve file reading

* CB-4112 refactor: naming

* CB-4112 update schema

* CB-4112 fs by id gql

* CB-4112 unique fs id

* CB-4112 fix gql schema

* CB-4112 fix gql schema

* CB-4112 update manifest

* CB-4112 feat: require authentication for nav-tree

---------

Co-authored-by: Aleksey Potsetsuev <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-31 17:18:32 +03:00
alexandEvgeniaBzzz 0f9e7b650c CB-4005 add wrap mode (#2081)
* CB-4005 add wrap mode

* CB-4005 save wrap state in user settings

* CB-4005 add tooltips

* CB-4005 review fixes

---------

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-31 17:16:09 +03:00
AlexeyandDaria Marutkina b2eab058c9 CB-3846 feat: allow an administrator to use data export (#2095)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-31 15:57:27 +03:00
4f0fa25d83 CB-4123 servlet for upload download fs files (#2078)
* CB-4123 servlet for upload download fs files

* CB-4123 use variables in fs servlet

* CB-4123 use parameter nodepath in get

* CB-4123 upload file fix

* CB-4123 use project id and uri

* CB-4124 add upload/download context actions

* CB-4124 move fs extension to EE

* CB-4124 export NavigationNodeControl styles

* CB-4123 validate project permissions

* CB-4123 code style fix

* CB-4124 keep loader close to the title in notification

* CB-4123 prettify error

* CB-4113 resolve conflicts

---------

Co-authored-by: naumov <iamemptyhuh@gmail.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-30 20:10:53 +03:00
a3bdfb68fe CB-3778-bug-use-oracle-as-internal-db (#1920)
* CB-3778 fetch limit fix for oracle and sql server

* CB-3778 get offset limit part from sql dialect

* CB-3778 offset limit order fix

* CB-3778 schemas fix

---------

Co-authored-by: Mikhailov Grigorii <49814763+ggxed@users.noreply.github.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-30 19:59:05 +03:00
AlexeyandEvgeniaBzzz 584dd1ce4f CB-4096 fix: synchronize user info data update (#2096)
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-27 20:11:39 +03:00
Serge Rider 5255ee96db Remove redundant config 2023-10-27 16:26:40 +02:00
alexandEvgeniaBzzz e68c44ed73 CB-4019 update output log icon (#2090)
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-27 12:32:36 +03:00
Alexander Skoblikov e4f01a3fa8 rm fix (#2091) 2023-10-26 17:23:20 +03:00
Alexey a5c9073e6f CB-4112-open-scripts-datasets-from-virtual-file-systems (#2088) 2023-10-25 19:23:54 +03:00
Alexander Skoblikov b7d32ad676 CB-4125 use base path (#2087) 2023-10-25 19:18:33 +03:00
Alexander Skoblikov a520aa1f20 CB-4125 add objectId to gql navigator model (#2085) 2023-10-25 18:19:03 +03:00
Serge Rider 8e4c0c11a4 dbeaver/pro#1978 SSO sign out (#2032) 2023-10-25 18:17:42 +03:00
Alexander Skoblikov 72b3838fa9 fix package folders (#2083) 2023-10-25 15:41:47 +03:00
alexandDaria Marutkina df9de51bda CB-4128 review fixes (#2082)
* CB-4128 review fixes

* CB-4128 declare styles once

---------

Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-25 13:34:59 +03:00
Alexander SkoblikovandEvgeniaBzzz 390f53f36b CB-4161 auth fix (#2084)
* CB-4161 auth fix

* CB-4161 validate custom config status

---------

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-24 19:54:28 +03:00
alexandDaria Marutkina d3cf9e3938 CB-4035 do not show confirm if it is only output tab (#2079)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-24 18:11:02 +03:00
alexandEvgeniaBzzz 97dc309bcb CB-4022 make filter case insensitive (#2080)
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-24 18:10:45 +03:00
AinurandDaria Marutkina 6c609d7f62 CB-4139 update clickhouse driver (#2070)
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-24 16:51:00 +03:00
AinurandEvgeniaBzzz f67835d2d2 CB-2700 delimeter support (#2068)
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-24 16:49:51 +03:00
DenisSinelnikovandEvgeniaBzzz 98197c8829 CB-4099. Create logic for save comfig and user for CB TE. (#2067)
* CB-4099. Create logic for save comfig and user for CB TE.

* CB-4099. Fixed checkstyle

* CB-4099. Refactor after review

---------

Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-24 15:46:55 +03:00
Alexey 997936328e fix(core-resource): error getter (#2077) 2023-10-23 22:53:24 +03:00
EvgeniaBzzz f7832b56fa Merge pull request #2076 from dbeaver/EvgeniaBzzz-patch-1
CB_2323 chore: update README
2023-10-23 13:32:50 +03:00
EvgeniaBzzz 81ce6b6ac7 CB_2323 chore: update README 2023-10-23 13:32:35 +03:00
Alexey 518410c2e8 Fix/cb-4141/localization (#2071) (#2075) 2023-10-20 19:51:04 +03:00
Alexander Skoblikov 4645a8e3d1 Cb 3959 UI file system navigator view (#2069)
* CB-4061 file systems feature

* CB-4061 return rm fs navigator nodes

* CB-3959 fix tests

* CB-3959 encode spaces in rm uri
2023-10-20 19:14:24 +03:00
DenisSinelnikov be59a4dab9 Hotfix 4144 validate blob (#2072)
* CB-4144. Fix regex
2023-10-20 16:29:31 +03:00
Alexander Skoblikov 3a92d7d23d CB-3930 use rm provider for rm fs (#2038) 2023-10-19 13:26:55 +03:00
d44e6b4e7a CB-3564 multi server license (#2062)
* CB-3564 fix: localization

* CB-3984 wip

* CB-3984 multi instance license

* CB-3564 feat: external users provider

* CB-3984 server init fix

* CB-3564 feat: load resource for administration users management

* CB-3984 force enable imported user

---------

Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-18 21:17:16 +03:00
DenisSinelnikov d87115d753 CB-3704. Validate file name (#2065)
* CB-3704. Validate file name

* CB-3704. Revert imports

* CB-3704. Refactor after review

* CB-3704. Fixed error message if files not created.

* CB-3074. Remove constant to Servlet
2023-10-18 15:42:29 +03:00
245d49b892 CB-4098 add prompt dialog to the sql editor (#2055)
* CB-4098 add prompt dialog to the sql editor

* CB-4098 add api integration

* CB-4046 add events

* CB-4046 fixes after review

* CB-3913 move AI feature to the ee

---------

Co-authored-by: Ainur <yagudin10@yandex.ru>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-18 13:37:23 +03:00
alexandmr-anton-t 3831abc880 CB-4038 add action icon button (#2064)
* CB-4038 add action icon button

* CB-4038 update styles in image value panel

* CB-4038 keep default styles export

---------

Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-10-17 18:34:52 +03:00
Serge Rider e818f1658c dbeaver/pro#1905 UTF-8 is the default file encoding (#2060) 2023-10-17 10:32:43 +03:00
Alexey 739a6f7f11 chore: update version 23.2.3 (#2066) 2023-10-16 23:06:07 +02:00
ab985673b0 CB-3704 feat(plugin-data-viewer): blob uploading (#2027)
* CB-3704 feat(plugin-data-viewer): blob uploading

* CB-3704 fix: check  truncated value correctly

* CB-4051. Added upload big files

* CB-4051. remove unusable files

* CB-3704 feat: upload blobs

* CB-4051. Refactor after discussion with front-end

* CB-4051. Merge develop

* CB-4051. Fixed imports

* CB-3704 fix: upload blobs for new rows

* CB-4051. Fixed added new row with file

* fix: reset editing state

* CB-4051. Fixed after review

* CB-4051. revert

* CB-4051. Fixed doc, imports, style

* CB-4051. Fixed checkstyle

* revert

* CB-4051. Refactor after review, added handler for delete temp folder

* CB-3704 chore: update ts project references

* CB-3704 fix: rename file upload name

* CB-3704. delete comments

* CB-3704. Refactor after review

* CB-3074. Rename job

* CB-3704. Fix save for json

* CB-3704 fix: boolean value representation

* CB-3704 fix: downloadable data detection

* CB-3704 fix: downloadable data detection

* CB-3704. Fixed boolean null value

* CB-3704 fix: truncate long strings for display data

* CB-3704 fix: transform complex values

* CB-3704. Fixed json update

* CB-3704 fix: display value

* CB-3704 fix: data set

* CB-3704 fix: keep content type when editing content values

* CB-3704 feat: add download button for

* CB-3704. Rename event

---------

Co-authored-by: Denis Sinelnikov <denis.sinelnikov@dbeaver.com>
Co-authored-by: DenisSinelnikov <142215442+DenisSinelnikov@users.noreply.github.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-16 16:47:11 +03:00
Alexey abf3e7247c chore: update yarn.lock (#2063) 2023-10-15 23:52:04 +02:00
49f321462e CB-3454 ai (#2033)
* CB-3999 add ai plugin

* CB-3454 review fixes

* CB-3454 gql since directive fix

* CB-3454 update tsconfig

* fix: npm dependencies

* CB-4045 add hint property

* CB-3454 add hints

---------

Co-authored-by: Ainur <yagudin10@yandex.ru>
Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-13 17:03:33 +03:00
Serge Rider d0a820d27b dbeaver/pro#1900 tasks virtual fs (#2040)
* dbeaver/pro#1900 Refactor DT and general UI

* dbeaver/pro#1900 Export to external FS implementation
2023-10-12 15:31:09 +03:00
Alexey bd9a18bc50 chore: update vs-code tasks (#2059) 2023-10-12 12:49:03 +02:00
Serge Rider 3fa1130608 23.2.3 version bump 2023-10-12 10:46:20 +02:00
fe2c7b76be feat: migrate form-controls to css modules (#2041)
* feat: migrate form-controls to css modules

* fix: checkbox field styles

* fix: remove old field styles

* fix: styles bugs

* CB-3773 fix: styles

* CB-3773 fix: field description styles

* CB-3773 fix: radio button styles

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com>
2023-10-10 20:19:40 +03:00
Serge Rider 4344dce700 dbeaver/pro#2000 Java 17 (#2057) 2023-10-10 19:50:48 +03:00
Alexey dc402f1940 fix: jest tests (#2056) 2023-10-10 17:44:39 +02:00
bdcda6a1fb CB-4028 delete/add api for permissions (#2024)
* CB-4028 delete/add api for permissions

* feat: add new subjects connection add and delete methods

* CB-4028 fix method name

* refactor: subject connection permissions

* fix: after review

* fix: after review

* CB-4028 fix: update ts project references

* fix: dependencies cycle

* chore: fix dependencies

* CB-4028 event for delete

* CB-4028 delete object permission event

---------

Co-authored-by: Dmitry Osipov <teunlao@gmail.com>
Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
2023-10-10 18:41:14 +03:00
Alexey baef7fbae6 build: configure browserslist config (#2054) 2023-10-10 11:54:51 +02:00
Serge RiderandAleksandr Skoblikov b52c2788b1 dbeaver/pro#1962 eclipse 2023 09 2 (#2036)
* dbeaver/pro#1962 Servlet API 4.x deps

* dbeaver/pro#1962 Redundant SLF4J dep removed

* dbeaver/pro#1962 SLF4J binding fix + servlet API version

* dbeaver/pro#1962 add cloudbeaver slf4j binding

* dbeaver/pro#1962 Logging

* dbeaver/pro#1962 Logging fix

---------

Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
2023-10-10 12:51:39 +03:00
48b9326336 CB-4065 safe context getter (#2043)
Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-10 00:06:34 +03:00
Alexey 37d76c428d feat: add more logging (#2052) 2023-10-09 18:26:26 +02:00
Alexey 01bcf9479d fix: resolve npm dependencies (#2050)
* fix: resolve npm dependencies

* fix: types

* chore: add manual frontend cache actin running

* fix: github workflows

* fix: types

* fix: types

* fix: types
2023-10-09 16:25:07 +03:00
Daria Marutkina 31355b81f8 Merge pull request #2051 from dbeaver/dariamarutkina-patch-1
CB_2322 chore: update README
2023-10-09 14:20:04 +02:00
Daria Marutkina 226762c5f9 CB_2322 chore: update README 2023-10-09 14:19:42 +02:00
Serge Rider 6b58613c83 Merge branch 'devel' of https://github.com/dbeaver/cloudbeaver into devel 2023-10-08 18:31:14 +02:00
Serge Rider e3f04bcbb0 23.2.2 version bump 2023-10-08 18:28:34 +02:00
Alexey c5d0e4bade chore: join build and test workflows (#2049)
* chore: join build and test workflows

* chore: add devel branch cache

* chore: cleanup github actions cache
2023-10-08 00:48:34 +03:00
45335f5dd7 Cb 4082 fix styles bugs (#2042)
* fix: transparent pane

* fix: connection dialog footer styles

* fix: logViewer background

* fix: execution plan style bugs

* fix: action button styles

* fix: action button styles

---------

Co-authored-by: Alexey <wrouds@gmail.com>
Co-authored-by: EvgeniaBzzz <139753579+EvgeniaBzzz@users.noreply.github.com>
Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com>
2023-10-07 23:41:48 +03:00
Alexey ff4c453f8d fix: webpack dev mode (#2048) 2023-10-06 17:29:29 +02:00
Alexey be5bb95154 fix: ts configs (#2047) 2023-10-06 15:35:07 +02:00
Alexey ece5e8f3f1 fix: unix paths (#2046) 2023-10-06 14:35:38 +02:00
Alexey 9dcd287c61 fix: double build (#2045) 2023-10-06 12:13:58 +03:00
Alexey 97b43c044f build: enable source maps (#2044) 2023-10-06 00:27:44 +03:00
Alexey 4550a71298 Refactor CB-3819 resources (#2031)
* CB-3819 refactor: split resources to modules

* CB-3819 refactor: move resource API to separate package

* CB-3819 refactor: move resource API to separate package

* CB-3819 refactor: split to submodules

* CB-3819 chore: update ts configuration

* CB-3819 refactor: move administration top bar to separate plugin

* CB-3819 feat: update tests

* CB-3819 chore: add pre scripts

* CB-3819 fix: prebuild tests-runner

* chore: restore cache for jest-tests github action

* chore: update configs

* chore: add frontend build action

* chore: rename build frontend github action

* chore: include test dependencies

* fix: default product build script

* chore: update github action

* chore: rename validation github action

* chore: update typescript cache key

* chore: update naming for github actions

* chore: run tests on ubuntu

* CB-3819 fix: pre build tasks

* CB-3819 fix: ignore order

* CB-3819 fix: remove prettier from gql sdk
2023-10-05 23:36:54 +03:00
1484 changed files with 27492 additions and 15445 deletions
+35
View File
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:1-17-bookworm",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {}
},
"hostRequirements": {
"cpus": 8,
"memory": "16gb",
"storage": "64gb"
}
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "java -version",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
+76
View File
@@ -0,0 +1,76 @@
name: frontend-cache
on:
push:
branches: ["devel"]
paths:
- "webapp/**"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build_and_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./webapp
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: restore yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: restore node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: restore typescript cache
uses: actions/cache@v3
with:
path: "**/packages/*/dist"
key: ${{ runner.os }}-dist-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-dist-
- name: yarn install
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: install
- name: yarn lerna bootstrap
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna bootstrap
- name: build
uses: borales/actions-yarn@v4
with:
dir: webapp/packages/product-default
cmd: build # build tyescript source code
- name: test
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna run test # build packages that have test script
+29
View File
@@ -0,0 +1,29 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
+80
View File
@@ -0,0 +1,80 @@
name: frontend
on:
# Triggers the workflow on push or pull request events but only for the "devel" branch
pull_request:
branches: ["devel"]
paths:
- "webapp/**" # monitor for the frontend changes
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Allows you to reuse workflows by referencing their YAML files
workflow_call:
jobs:
build_and_test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./webapp
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "20"
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: restore yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: restore node_modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: restore typescript cache
uses: actions/cache@v3
with:
path: "**/packages/*/dist"
key: ${{ runner.os }}-dist-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-dist-
- name: yarn install
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: install
- name: yarn lerna bootstrap
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna bootstrap
- name: build
uses: borales/actions-yarn@v4
with:
dir: webapp/packages/product-default
cmd: bundle
- name: test
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna run test
-72
View File
@@ -1,72 +0,0 @@
name: Run Jest Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "devel" branch
pull_request:
branches: ["devel"]
paths:
- "webapp/**" # monitor for the frontend changes
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
run-jest-tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./webapp
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Run install
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: install
- name: Run lerna bootstrap
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna bootstrap
- name: Run pre test
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: pretest
- name: Run test
uses: borales/actions-yarn@v4
with:
dir: webapp
cmd: lerna run test
@@ -1,4 +1,4 @@
name: "Commit Message Validation"
name: validation
on:
pull_request:
@@ -11,7 +11,7 @@ on:
- edited
- ready_for_review
- labeled
jobs:
validate-commit-message:
uses: dbeaver/dbeaver/.github/workflows/reused-commit-msgs-validator.yml@devel
commit-message:
uses: dbeaver/dbeaver/.github/workflows/reused-commit-msgs-validator.yml@devel
+13 -4
View File
@@ -5,9 +5,18 @@
"type": "chrome",
"request": "launch",
"name": "Chrome",
"url": "http://127.0.0.1:3100",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}/..",
"sourceMaps": true
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///*": "${workspaceFolder}/../*"
},
"skipFiles": [
"<node_internals>/**",
"**/node_modules/**",
"${workspaceFolder}/webapp/**/node_modules/**/*.js",
"${workspaceFolder}/webapp/**/dist/**/*.js"
]
},
{
"type": "java",
@@ -21,7 +30,7 @@
"request": "launch",
"mainClass": "org.eclipse.equinox.launcher.Main",
"classPaths": [
"${workspaceFolder}/../eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar"
"${workspaceFolder}/../eclipse/eclipse/plugins/org.eclipse.equinox.launcher_1.6.600.v20231106-1826.jar"
],
"args": [
"-product",
@@ -56,7 +65,7 @@
"request": "launch",
"mainClass": "org.eclipse.equinox.launcher.Main",
"classPaths": [
"${workspaceFolder}/../eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar"
"${workspaceFolder}/../eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.6.600.v20231106-1826.jar"
],
"args": [
"-product",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"license": {
"scope": "typescript,typescriptreact,javascript,javascriptreact",
"scope": "typescript,typescriptreact,javascript,javascriptreact,css,scss",
"prefix": "license",
"body": [
"/*",
+1 -1
View File
@@ -9,6 +9,7 @@
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx16G -Xms100m -Xlog:disable",
"java.compile.nullAnalysis.mode": "automatic",
"typescript.preferences.useAliasesForRenames": false,
"typescript.preferences.importModuleSpecifier": "relative",
"typescript.preferences.includePackageJsonAutoImports": "on",
"typescript.preferences.quoteStyle": "single",
@@ -21,7 +22,6 @@
"typescript",
"typescriptreact"
],
"eslint.packageManager": "yarn",
"eslint.workingDirectories": ["webapp"],
"editor.defaultFormatter": "esbenp.prettier-vscode",
+10 -16
View File
@@ -13,7 +13,7 @@
},
"tasks": [
{
"label": "Run Tests",
"label": "Run Tests CE",
"type": "shell",
"command": "yarn",
"group": "test",
@@ -53,19 +53,13 @@
{
"label": "Yarn Install",
"type": "shell",
"command": "yarn",
"args": []
},
{
"label": "Lerna Bootstrap",
"type": "shell",
"command": "yarn",
"args": ["lerna", "bootstrap"]
},
{
"label": "Bootstrap",
"dependsOrder": "sequence",
"dependsOn": ["Yarn Install", "Lerna Bootstrap"]
"command": "yarn install; yarn lerna bootstrap",
"args": [],
"presentation": {
"reveal": "silent",
"close": true,
"clear": false
}
}
],
"inputs": [
@@ -73,8 +67,8 @@
"type": "pickString",
"id": "stage.ce",
"description": "CE Stage servers",
"default": "http://127.0.0.1:8978/",
"options": ["http://127.0.0.1:8978/"]
"default": "http://localhost:8978/",
"options": ["http://localhost:8978/"]
}
]
}
+31 -37
View File
@@ -22,47 +22,41 @@ You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io
## Changelog
### CloudBeaver 23.2.1 - 2023-09-25
- The Output tab has been implemented, which includes warnings, info and notices generated by the database when executing user queries;
- Scrollbars have been made theme-independent, resolving interface issues with light theme;
- Fixed an issue in the SQL editor where it was not possible to switch the active schema when working with Oracle databases;
- Different bug fixes and enhancements have been made.
23.2.0 - 2023-09-04
### 23.3.1, 2023-12-25
- Performance:
- Pagination has been added to the Navigation tree and metadata viewer, allowing working with more than 1000 database items;
- Access Management:
- Access permissions can be specified for pre-configured connections via the configuration file;
- Reverse Proxy authentication now includes the option to provide users' First name and Last name;
- Authorization:
- The SSL option is now available for establishing connections in MySQL, PostgreSQL, Clickhouse;
- Connections:
- Connections are consistently displayed now when they are pre-configured into the workspace in the Global Configuration json file
- Navigation tree:
- The filters for the Navigation tree now allow hiding and showing schemas within the interface.
- The search request considers file names and excludes the .sql file extension for now;
- Data Editor:
- The ability to rearrange columns in the Data Editor has been added;
- The ability to use custom functions in the Grouping panel has been added;
- Administration:
- New Settings panel displays the product configuration settings such as Minimum fetch size, Maximum fetch size, and Default fetch size from the Data Editor;
- "Connection Management" tab has been renamed to "Connection Templates" - now only connection templates are displayed;
- SQL Editor:
- Users can simultaneously edit resources for now, allowing them to work together;
- Support for displaying tables with nested arrays of objects has been added;
- The ability to compress export files allowed to increase in download speed, especially for larger files;
- UX in the search bar has been improved - users can delete a query or request by clicking on the cross icon;
- Upgraded to Jetty 11, delivering improved performance, enhanced features, and better alignment with the latest Java specifications.
- Resource management:
- Read-only scripts now have a padlock icon.
- UX improvement:
- Added validation for mandatory fields in all forms for creating and editing entities.
- Driver management:
- Custom settings have been added to the interface for the following dialogue connections: SQLite, DB2, SQL Server, MySQL, Oracle and PostgreSQL;
- Trino driver has been updated;
- Security:
- Password autofill functionality was removed;
- The "eye" icon for password fields has been removed - the passwords entered into fields will not be displayed in the interface for now;
- Apache Derby driver has been removed because of the vulnerability issues.
- Many small bug fixes, enhancements, and improvements have been made
### Changes since 23.2.0:
- Security:
- Unauthorized access vulnerability was fixed;
- All embedded drivers are disabled by default. Administrators can re-enable them in the Server configuration.
- Access Management:
- Administrators have gained the ability to permanently delete users and their data.
- Authorization:
- The SSL option is available for establishing a connection in SQL Server.
- Connections:
- The 'Save credentials' checkbox has been removed from a template creating form as credentials are not stored in templates.
- SQL Editor:
- Support for using custom delimiters has been added in MySQL;
- The Output tab has been implemented, which includes warnings, info, and notices generated by the database when executing user queries;
- Fixed an issue in the SQL editor where it was impossible to switch the active schema when working with Oracle databases;
- Added ability to select shared connections for private scripts;
- Private connections can be chosen for shared scripts, but this change won’t be saved to the script file.
- Data Editor:
- Scrollbars have been made theme-independent;
- Added the ability to edit binary values in a table;
- Added the ability to count the total number of entries in the table.
- Driver management:
- Updated the version of the Clickhouse driver to 0.4.6.
- Many small bug fixes, enhancements, and improvements have been made
### Old CloudBeaver releases
+1 -1
View File
@@ -9,7 +9,7 @@
{
subjectId: "user",
name: "User",
description: "Standard user",
description: "All users, including anonymous.",
permissions: [ ]
}
]
+1 -4
View File
@@ -16,14 +16,11 @@
maxLogRecords: 2000,
maxFailedRequests: 3
}
},
authentication: {
primaryAuthProvider: 'local'
}
},
// Notifications config
core_events: {
notificationsPool: 5
notificationsPool: 20
},
plugin_data_spreadsheet_new: {
hidden: false
@@ -6,6 +6,8 @@
contentRoot: "web",
driversLocation: "drivers",
sslConfigurationPath:"${CLOUDBEAVER_SSL_CONF_PATH:workspace/.data/ssl-config.xml}",
rootURI: "/",
serviceURI: "/api/",
@@ -17,6 +19,13 @@
enableSecurityManager: false,
sm: {
enableBruteForceProtection: "${CLOUDBEAVER_BRUTE_FORCE_PROTECTION_ENABLED:true}",
maxFailedLogin: "${CLOUDBEAVER_MAX_FAILED_LOGINS:10}",
minimumLoginTimeout: "${CLOUDBEAVER_MINIMUM_LOGIN_TIMEOUT:1}",
blockLoginPeriod: "${CLOUDBEAVER_BLOCK_PERIOD:300}"
},
database: {
driver="h2_embedded_v2",
url: "jdbc:h2:${workspace}/.data/cb.h2v2.dat",
+61
View File
@@ -0,0 +1,61 @@
#!/bin/bash
set -Eeo pipefail
set +u
# #command line arguments
# CONFIGURATION_PATH=${1-"../config/sample-databases/DefaultConfiguration"}
# SAMPLE_DATABASE_PATH=${2-""}
# echo $CONFIGURATION_PATH
# echo $SAMPLE_DATABASE_PATH
echo "Clone and build Cloudbeaver"
rm -rf ./drivers
rm -rf ./cloudbeaver
mkdir ./cloudbeaver
mkdir ./cloudbeaver/server
mkdir ./cloudbeaver/conf
mkdir ./cloudbeaver/workspace
mkdir ./cloudbeaver/web
echo "Pull cloudbeaver platform"
cd ../..
echo "Pull dbeaver platform"
[ ! -d dbeaver ] && git clone https://github.com/dbeaver/dbeaver.git
cd cloudbeaver/deploy
echo "Build CloudBeaver server"
cd ../server/product/aggregate
mvn clean verify $MAVEN_COMMON_OPTS -Dheadless-platform
if [[ "$?" -ne 0 ]] ; then
echo 'Could not perform package'; exit $rc
fi
cd ../../../deploy
echo "Copy server packages"
cp -rp ../server/product/web-server/target/products/io.cloudbeaver.product/all/all/all/* ./cloudbeaver/server
cp -p ./scripts/* ./cloudbeaver
mkdir cloudbeaver/samples
if [[ -z $SAMPLE_DATABASE_PATH ]]; then
SAMPLE_DATABASE_PATH=""
else
mkdir cloudbeaver/samples/db
cp -rp "${SAMPLE_DATABASE_PATH}" cloudbeaver/samples/
fi
if [[ -z "$CONFIGURATION_PATH" ]]; then
CONFIGURATION_PATH="../config/sample-databases/DefaultConfiguration"
fi
cp -rp ../config/core/* cloudbeaver/conf
cp -rp "${CONFIGURATION_PATH}"/GlobalConfiguration/.dbeaver/data-sources.json cloudbeaver/conf/initial-data-sources.conf
cp -p "${CONFIGURATION_PATH}"/*.conf cloudbeaver/conf/
mv drivers cloudbeaver
echo "End of backend build"
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -Eeuo pipefail
echo "Build static content"
cd ../../cloudbeaver/webapp
yarn
yarn lerna run bootstrap
yarn lerna run bundle --no-bail --stream --scope=@cloudbeaver/product-default #-- -- --env source-map
if [[ "$?" -ne 0 ]] ; then
echo 'Application build failed'; exit $rc
fi
cd ../deploy
echo "Copy static content"
cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web
echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
+9 -1
View File
@@ -1 +1,9 @@
./build.sh '../config/sample-databases/SQLiteConfiguration' '../config/sample-databases/db'
#!/bin/bash
set -Eeuo pipefail
#command line arguments
CONFIGURATION_PATH='../config/sample-databases/SQLiteConfiguration'
SAMPLE_DATABASE_PATH='../config/sample-databases/db'
source build-backend.sh
source build-frontend.sh
+1 -1
View File
@@ -57,7 +57,7 @@ cd ..\cloudbeaver\webapp
call yarn
call yarn lerna bootstrap
call yarn lerna run build --no-bail --stream --scope=@cloudbeaver/product-default &::-- -- --env source-map
call yarn lerna run bundle --no-bail --stream --scope=@cloudbeaver/product-default &::-- -- --env source-map
cd ..\deploy
+4 -66
View File
@@ -2,70 +2,8 @@
set -Eeuo pipefail
#command line arguments
CONFIGURATION_PATH=${1-"../config/sample-databases/DefaultConfiguration"}
SAMPLE_DATABASE_PATH=${2-""}
CONFIGURATION_PATH="../config/sample-databases/DefaultConfiguration"
SAMPLE_DATABASE_PATH=""
echo "Clone and build Cloudbeaver"
rm -rf ./drivers
rm -rf ./cloudbeaver
mkdir ./cloudbeaver
mkdir ./cloudbeaver/server
mkdir ./cloudbeaver/conf
mkdir ./cloudbeaver/workspace
mkdir ./cloudbeaver/web
echo "Pull cloudbeaver platform"
cd ../..
echo "Pull dbeaver platform"
[ ! -d dbeaver ] && git clone https://github.com/dbeaver/dbeaver.git
cd cloudbeaver/deploy
echo "Build CloudBeaver server"
cd ../server/product/aggregate
mvn clean verify -U -Dheadless-platform
if [[ "$?" -ne 0 ]] ; then
echo 'Could not perform package'; exit $rc
fi
cd ../../../deploy
echo "Copy server packages"
cp -rp ../server/product/web-server/target/products/io.cloudbeaver.product/all/all/all/* ./cloudbeaver/server
cp -p ./scripts/* ./cloudbeaver
mkdir cloudbeaver/samples
if [[ ! -z "${SAMPLE_DATABASE_PATH}" ]]; then
mkdir cloudbeaver/samples/db
cp -rp "${SAMPLE_DATABASE_PATH}" cloudbeaver/samples/
fi
cp -rp ../config/core/* cloudbeaver/conf
cp -rp "${CONFIGURATION_PATH}"/GlobalConfiguration/.dbeaver/data-sources.json cloudbeaver/conf/initial-data-sources.conf
cp -p "${CONFIGURATION_PATH}"/*.conf cloudbeaver/conf/
mv drivers cloudbeaver
echo "Build static content"
cd ../
cd ../cloudbeaver/webapp
yarn
yarn lerna run bootstrap
yarn lerna run build --no-bail --stream --scope=@cloudbeaver/product-default #-- -- --env source-map
if [[ "$?" -ne 0 ]] ; then
echo 'Application build failed'; exit $rc
fi
cd ../deploy
echo "Copy static content"
cp -rp ../webapp/packages/product-default/lib/* cloudbeaver/web
echo "Cloudbeaver is ready. Run run-server.bat in cloudbeaver folder to start the server."
source build-backend.sh
source build-frontend.sh
+45 -1
View File
@@ -1,4 +1,48 @@
FROM eclipse-temurin:17.0.4.1_1-jre-focal
FROM ubuntu:23.04
MAINTAINER DBeaver Corp, devops@dbeaver.com
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# curl required for historical reasons, see https://github.com/adoptium/containers/issues/255
curl \
wget \
# java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
# java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
# https://github.com/docker-library/openjdk/pull/235#issuecomment-424466077
fontconfig \
# utilities for keeping Ubuntu and OpenJDK CA certificates in sync
# https://github.com/adoptium/containers/issues/293
ca-certificates p11-kit \
# jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
# Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
binutils \
tzdata \
# locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
locales \
nano \
; \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen en_US.UTF-8; \
rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8
ENV JAVA_HOME=/opt/java/openjdk
COPY --from=eclipse-temurin:17 $JAVA_HOME $JAVA_HOME
ENV PATH="${JAVA_HOME}/bin:${PATH}"
RUN set -eux; \
# https://github.com/docker-library/openjdk/issues/331#issuecomment-498834472
find "$JAVA_HOME/lib" -name '*.so' -exec dirname '{}' ';' | sort -u > /etc/ld.so.conf.d/docker-openjdk.conf; \
ldconfig; \
# https://github.com/docker-library/openjdk/issues/212#issuecomment-420979840
# https://openjdk.java.net/jeps/341
java -Xshare:dump;
### Patch java security
COPY java.security* ${JAVA_HOME}/conf/security/java.security
COPY cloudbeaver /opt/cloudbeaver
+35 -1
View File
@@ -10,4 +10,38 @@ IF NOT EXIST workspace\.metadata (
)
)
java %JAVA_OPTS% --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar %launcherJar% -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
SET VMARGS_OPTS = ""
If Not Defined JAVA_OPTS (
SET VMARGS_OPTS = "-Xmx2048M"
)
java %JAVA_OPTS% ^
-Dfile.encoding=UTF-8 ^
--add-modules=ALL-SYSTEM ^
--add-opens=java.base/java.io=ALL-UNNAMED ^
--add-opens=java.base/java.lang=ALL-UNNAMED ^
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED ^
--add-opens=java.base/java.net=ALL-UNNAMED ^
--add-opens=java.base/java.nio=ALL-UNNAMED ^
--add-opens=java.base/java.nio.charset=ALL-UNNAMED ^
--add-opens=java.base/java.text=ALL-UNNAMED ^
--add-opens=java.base/java.time=ALL-UNNAMED ^
--add-opens=java.base/java.util=ALL-UNNAMED ^
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED ^
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED ^
--add-opens=java.base/jdk.internal.vm=ALL-UNNAMED ^
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED ^
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED ^
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED ^
--add-opens=java.base/sun.security.action=ALL-UNNAMED ^
--add-opens=java.base/sun.security.util=ALL-UNNAMED ^
--add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED ^
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED ^
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED ^
--add-opens=java.sql/java.sql=ALL-UNNAMED ^
-jar %launcherJar% ^
-product io.cloudbeaver.product.ce.product ^
-data %workspacePath% ^
-web-config conf/cloudbeaver.conf ^
-nl en ^
-registryMultiLanguage
+33 -2
View File
@@ -4,6 +4,37 @@ launcherJar=( server/plugins/org.eclipse.equinox.launcher*.jar )
echo "Starting Cloudbeaver Server"
[ ! -d "workspace/.metadata" ] && mkdir -p workspace/.metadata && mkdir -p workspace/GlobalConfiguration/.dbeaver && [ ! -f "workspace/GlobalConfiguration/.dbeaver/data-sources.json" ] && cp conf/initial-data-sources.conf workspace/GlobalConfiguration/.dbeaver/data-sources.json
[ ! -d "workspace/.metadata" ] && mkdir -p workspace/.metadata \
&& mkdir -p workspace/GlobalConfiguration/.dbeaver \
&& [ ! -f "workspace/GlobalConfiguration/.dbeaver/data-sources.json" ] \
&& cp conf/initial-data-sources.conf workspace/GlobalConfiguration/.dbeaver/data-sources.json
java ${JAVA_OPTS} --add-modules=ALL-SYSTEM --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -jar ${launcherJar} -product io.cloudbeaver.product.ce.product -web-config conf/cloudbeaver.conf -nl en -registryMultiLanguage
java ${JAVA_OPTS} \
-Dfile.encoding=UTF-8 \
--add-modules=ALL-SYSTEM \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
--add-opens=java.base/java.nio=ALL-UNNAMED \
--add-opens=java.base/java.nio.charset=ALL-UNNAMED \
--add-opens=java.base/java.text=ALL-UNNAMED \
--add-opens=java.base/java.time=ALL-UNNAMED \
--add-opens=java.base/java.util=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.vm=ALL-UNNAMED \
--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens=java.base/sun.security.ssl=ALL-UNNAMED \
--add-opens=java.base/sun.security.action=ALL-UNNAMED \
--add-opens=java.base/sun.security.util=ALL-UNNAMED \
--add-opens=java.security.jgss/sun.security.jgss=ALL-UNNAMED \
--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED \
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \
--add-opens=java.sql/java.sql=ALL-UNNAMED \
-jar ${launcherJar} \
-product io.cloudbeaver.product.ce.product \
-web-config conf/cloudbeaver.conf \
-nl en \
-registryMultiLanguage
@@ -3,12 +3,12 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Model
Bundle-SymbolicName: io.cloudbeaver.model;singleton:=true
Bundle-Version: 1.0.38.qualifier
Bundle-Release-Date: 20230209
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Version: 1.0.44.qualifier
Bundle-Release-Date: 20240108
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
org.jkiss.dbeaver.model;visibility:=reexport,
org.jkiss.dbeaver.model.sm;visibility:=reexport,
org.jkiss.dbeaver.model.event;visibility:=reexport,
@@ -18,7 +18,7 @@ Require-Bundle: org.jkiss.dbeaver.data.gis;visibility:=reexport,
org.jkiss.bundle.graphql.java;visibility:=reexport,
org.jkiss.bundle.apache.dbcp,
com.google.gson;visibility:=reexport,
jakarta.servlet-api;visibility:=reexport
jakarta.servlet;visibility:=reexport
Export-Package: io.cloudbeaver,
io.cloudbeaver.auth,
io.cloudbeaver.auth.provider,
@@ -27,12 +27,13 @@ Export-Package: io.cloudbeaver,
io.cloudbeaver.websocket,
io.cloudbeaver.model,
io.cloudbeaver.model.app,
io.cloudbeaver.model.fs,
io.cloudbeaver.model.rm,
io.cloudbeaver.model.rm.local,
io.cloudbeaver.model.rm.lock,
io.cloudbeaver.model.rm.fs.nio,
io.cloudbeaver.model.session,
io.cloudbeaver.model.user,
io.cloudbeaver.model.utils,
io.cloudbeaver.registry,
io.cloudbeaver.server,
io.cloudbeaver.service,
@@ -19,4 +19,9 @@
</metaParameters>
</extension>
<extension point="com.dbeaver.secretController">
<controller id="void-secret" class="io.cloudbeaver.model.app.VoidSecretController"
label="Default secret controller" description="Default void secret controller"/>
</extension>
</plugin>
+1 -1
View File
@@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.model</artifactId>
<version>1.0.38-SNAPSHOT</version>
<version>1.0.44-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -14,11 +14,6 @@
<meta.element />
</appInfo>
</annotation>
<complexType>
<sequence>
<element ref="propertyGroup"/>
</sequence>
</complexType>
</element>
<element name="driver">
@@ -62,6 +62,12 @@ public class BaseWebProjectImpl extends BaseProjectImpl implements RMControllerP
return resourceController;
}
@NotNull
@Override
public RMProject getRMProject() {
return project;
}
@Override
public boolean isVirtual() {
return true;
@@ -41,6 +41,9 @@ public interface SMAuthProviderFederated {
@Nullable
String getMetadataLink(String id, @NotNull Map<String, Object> providerConfig) throws DBException;
@Nullable
String getAcsLink(String id, @NotNull Map<String, Object> providerConfig) throws DBException;
@Nullable
default String getRedirectLink(String id, @NotNull Map<String, Object> providerConfig) throws DBException {
return null;
@@ -0,0 +1,25 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.auth;
import org.jkiss.code.NotNull;
import java.util.Map;
public interface SMBruteForceProtected {
Object getInputUsername(@NotNull Map<String, Object> cred);
}
@@ -0,0 +1,30 @@
package io.cloudbeaver.model;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.DBPDataSourceHandler;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
public abstract class BaseDatasourceAccessCheckHandler implements DBPDataSourceHandler {
@Override
public void beforeConnect(
DBRProgressMonitor monitor,
@NotNull DBPDataSourceContainer dataSourceContainer
) throws DBException {
if (isDriverDisabled(dataSourceContainer.getDriver())) {
throw new DBException("Driver disabled");
}
}
@Override
public void beforeDisconnect(
DBRProgressMonitor monitor,
@NotNull DBPDataSourceContainer dataSourceContainer
) throws DBException {
}
protected abstract boolean isDriverDisabled(DBPDriver driver);
}
@@ -18,8 +18,14 @@ package io.cloudbeaver.model;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.net.DBWHandlerConfiguration;
import org.jkiss.dbeaver.model.net.DBWHandlerDescriptor;
import org.jkiss.dbeaver.model.net.DBWHandlerType;
import org.jkiss.dbeaver.model.net.ssh.SSHConstants;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.model.preferences.DBPPropertySource;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.registry.RegistryConstants;
import org.jkiss.dbeaver.runtime.properties.PropertySourceMap;
import org.jkiss.utils.CommonUtils;
import java.util.LinkedHashMap;
@@ -83,8 +89,11 @@ public class WebNetworkHandlerConfig {
@NotNull
public Map<String, String> getSecureProperties() {
Map<String, String> secureProperties = new LinkedHashMap<>(configuration.getSecureProperties());
for (Map.Entry<String, String> property : secureProperties.entrySet()) {
property.setValue(CommonUtils.isEmpty(property.getValue()) ? null : WebConnectionInfo.SECURED_VALUE);
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);
}
}
return secureProperties;
}
@@ -88,6 +88,11 @@ public class WebPropertyInfo {
}
}
@Property
public String getHint() {
return property.getHint();
}
@Property
public int getOrder() {
return property instanceof ObjectPropertyDescriptor ? ((ObjectPropertyDescriptor) property).getOrderNumber() : -1;
@@ -168,6 +173,11 @@ public class WebPropertyInfo {
return new String[0];
}
@Property
public boolean isRequired() {
return property.isRequired();
}
public boolean hasFeature(@NotNull String feature) {
return property.hasFeature(feature);
}
@@ -16,6 +16,8 @@
*/
package io.cloudbeaver.model.app;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.cloudbeaver.DataSourceFilter;
import io.cloudbeaver.WebProjectImpl;
import io.cloudbeaver.WebSessionProjectImpl;
@@ -33,6 +35,7 @@ import org.jkiss.dbeaver.model.DBFileController;
import org.jkiss.dbeaver.model.app.DBPPlatform;
import org.jkiss.dbeaver.model.app.DBPWorkspace;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.auth.SMSessionContext;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.model.impl.app.ApplicationRegistry;
import org.jkiss.dbeaver.model.rm.RMController;
@@ -142,6 +145,14 @@ public abstract class BaseWebApplication extends BaseApplicationImpl implements
return null;
}
public Path getLogbackConfigPath() {
Path configFilePath = getMainConfigurationFilePath().toAbsolutePath();
Path configFolder = configFilePath.getParent();
// Configure logging
return getLogbackConfigPath(configFolder);
}
private Path getMainConfigurationFilePath() {
String configPath = DEFAULT_CONFIG_FILE_PATH;
@@ -189,11 +200,14 @@ public abstract class BaseWebApplication extends BaseApplicationImpl implements
* Advanced apps may implement it differently.
*/
@Override
public DBSSecretController getSecretController(@NotNull SMCredentialsProvider credentialsProvider) throws DBException {
public DBSSecretController getSecretController(
@NotNull SMCredentialsProvider credentialsProvider,
SMSessionContext smSessionContext
) throws DBException {
return VoidSecretController.INSTANCE;
}
protected Map<String, Object> getServerConfigProps(Map<String, Object> configProps) {
protected static Map<String, Object> getServerConfigProps(Map<String, Object> configProps) {
return JSONUtils.getObject(configProps, "server");
}
@@ -221,6 +235,7 @@ public abstract class BaseWebApplication extends BaseApplicationImpl implements
@Override
public Object start(IApplicationContext context) {
initializeApplicationServices();
try {
startServer();
} catch (Exception e) {
@@ -255,4 +270,14 @@ public abstract class BaseWebApplication extends BaseApplicationImpl implements
return null;
}
protected Gson getGson() {
return getGsonBuilder().create();
}
protected abstract GsonBuilder getGsonBuilder();
@Override
public boolean isEnvironmentVariablesAccessible() {
return false;
}
}
@@ -19,12 +19,15 @@ package io.cloudbeaver.model.app;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.auth.SMSessionContext;
import org.jkiss.dbeaver.model.secret.DBSSecretController;
import org.jkiss.dbeaver.model.secret.DBSSecretControllerAuthorized;
/**
* Void secret controller.
*/
public class VoidSecretController implements DBSSecretController {
public class VoidSecretController implements DBSSecretController, DBSSecretControllerAuthorized {
public static final VoidSecretController INSTANCE = new VoidSecretController();
@@ -47,4 +50,11 @@ public class VoidSecretController implements DBSSecretController {
public void flushChanges() {
}
@Override
public void authorize(
@Nullable SMCredentialsProvider credentialsProvider,
@Nullable SMSessionContext smSessionContext
) throws DBException {
}
}
@@ -25,6 +25,7 @@ import org.jkiss.dbeaver.model.DBFileController;
import org.jkiss.dbeaver.model.app.DBPApplication;
import org.jkiss.dbeaver.model.app.DBPWorkspace;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.auth.SMSessionContext;
import org.jkiss.dbeaver.model.rm.RMController;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.secret.DBSSecretController;
@@ -60,7 +61,10 @@ public interface WebApplication extends DBPApplication {
SMAdminController getAdminSecurityController(@NotNull SMCredentialsProvider credentialsProvider) throws DBException;
DBSSecretController getSecretController(@NotNull SMCredentialsProvider credentialsProvider) throws DBException;
DBSSecretController getSecretController(
@NotNull SMCredentialsProvider credentialsProvider,
SMSessionContext smSessionContext
) throws DBException;
RMController createResourceController(
@NotNull SMCredentialsProvider credentialsProvider,
@@ -18,6 +18,7 @@
package io.cloudbeaver.model.app;
import io.cloudbeaver.auth.CBAuthConstants;
import org.jkiss.dbeaver.DBException;
public interface WebAuthApplication extends WebApplication {
WebAuthConfiguration getAuthConfiguration();
@@ -27,4 +28,6 @@ public interface WebAuthApplication extends WebApplication {
default long getMaxSessionIdleTime() {
return CBAuthConstants.MAX_SESSION_IDLE_TIME;
}
void flushConfiguration() throws DBException;
}
@@ -16,6 +16,7 @@
*/
package io.cloudbeaver.model.app;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.security.SMAuthProviderCustomConfiguration;
@@ -36,4 +37,6 @@ public interface WebAuthConfiguration {
@Nullable
SMAuthProviderCustomConfiguration getAuthProviderConfiguration(String configId);
void addAuthProviderConfiguration(@NotNull SMAuthProviderCustomConfiguration config);
}
@@ -0,0 +1,58 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.model.fs;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.fs.DBFVirtualFileSystem;
import org.jkiss.dbeaver.model.navigator.DBNModel;
import org.jkiss.dbeaver.model.navigator.DBNNode;
import org.jkiss.dbeaver.model.navigator.fs.DBNPathBase;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import java.nio.file.Path;
public class FSUtils {
@NotNull
public static String makeUniqueFsId(@NotNull DBFVirtualFileSystem fileSystem) {
return fileSystem.getType() + "://" + fileSystem.getId();
}
@NotNull
public static Path getPathFromNode(@NotNull WebSession webSession, @NotNull String nodePath) throws DBException {
DBNPathBase dbnPath = getNodeByPath(webSession, nodePath);
Path path = dbnPath.getPath();
if (path == null) {
throw new DBWebException("Path from node '" + nodePath + "' is empty");
}
return path;
}
@NotNull
public static DBNPathBase getNodeByPath(@NotNull WebSession webSession, @NotNull String nodePath) throws DBException {
DBRProgressMonitor monitor = webSession.getProgressMonitor();
DBNModel navigatorModel = webSession.getNavigatorModel();
DBNNode node = navigatorModel.getNodeByPath(monitor, nodePath);
if (!(node instanceof DBNPathBase dbnPath)) {
throw new DBWebException("Node '" + nodePath + "' is not found in File Systems");
}
return dbnPath;
}
}
@@ -56,19 +56,25 @@ public class DBNResourceManagerProject extends DBNAbstractResourceManagerNode {
return project.getId();
}
@NotNull
@Override
public String getNodeId() {
return project.getId();
}
@Override
public String getNodeType() {
return "rm.project";
}
@Override
public String getNodeName() {
public String getNodeDisplayName() {
return project.getDisplayName();
}
@Override
public String getLocalizedName(String locale) {
return getNodeName();
return getNodeDisplayName();
}
@Override
@@ -105,6 +111,7 @@ public class DBNResourceManagerProject extends DBNAbstractResourceManagerNode {
return ((DBNResourceManagerRoot) getParentNode()).getResourceController();
}
@Deprecated
@Override
public String getNodeItemPath() {
return getParentNode().getNodeItemPath() + "/" + getName();
@@ -118,7 +125,7 @@ public class DBNResourceManagerProject extends DBNAbstractResourceManagerNode {
@Override
public String toString() {
return getNodeName();
return getNodeDisplayName();
}
@@ -55,7 +55,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
}
@Override
public String getNodeName() {
public String getNodeDisplayName() {
return resource.getName();
}
@@ -80,7 +80,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
}
return DBIcon.TREE_FOLDER;
} else {
var fileExtension = IOUtils.getFileExtension(getNodeName());
var fileExtension = IOUtils.getFileExtension(getNodeDisplayName());
if (!CommonUtils.isEmpty(fileExtension)) {
RMProject project = getProjectNode();
if (project != null) {
@@ -154,9 +154,10 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
throw new DBException("Can't detect resource root node");
}
@Deprecated
@Override
public String getNodeItemPath() {
return getParentNode().getNodeItemPath() + "/" + getNodeName();
return getParentNode().getNodeItemPath() + "/" + getNodeDisplayName();
}
@Override
@@ -174,7 +175,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
String resourceName = resource.getName();
try {
if (newName.indexOf('.') == -1) {
String ext = IOUtils.getFileExtension(getNodeName());
String ext = IOUtils.getFileExtension(getNodeDisplayName());
if (!CommonUtils.isEmpty(ext)) {
newName += "." + ext;
}
@@ -193,7 +194,7 @@ public class DBNResourceManagerResource extends DBNAbstractResourceManagerNode {
@Override
public String toString() {
return getNodeName();
return getNodeDisplayName();
}
@Nullable
@@ -54,8 +54,14 @@ public class DBNResourceManagerRoot extends DBNNode implements DBPHiddenObject,
return "rm";
}
@NotNull
@Override
public String getNodeName() {
public String getNodeId() {
return "rm";
}
@Override
public String getNodeDisplayName() {
return "resources";
}
@@ -103,10 +109,11 @@ public class DBNResourceManagerRoot extends DBNNode implements DBPHiddenObject,
return projects;
}
@Deprecated
@Override
public String getNodeItemPath() {
// Path doesn't include project name
return NodePathType.ext.getPrefix() + getNodeName();
return NodePathType.ext.getPrefix() + getNodeDisplayName();
}
@Override
@@ -115,11 +122,6 @@ public class DBNResourceManagerRoot extends DBNNode implements DBPHiddenObject,
return this;
}
@Override
public String toString() {
return getNodeName();
}
@Override
public boolean isHidden() {
return true;
@@ -48,6 +48,7 @@ import org.jkiss.dbeaver.model.websocket.event.WSEventType;
import org.jkiss.dbeaver.model.websocket.event.WSSessionLogUpdatedEvent;
import org.jkiss.dbeaver.registry.*;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.utils.GeneralUtils;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.IOUtils;
@@ -56,6 +57,7 @@ import org.jkiss.utils.Pair;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.*;
import java.text.MessageFormat;
import java.time.OffsetDateTime;
import java.time.ZoneId;
import java.util.*;
@@ -280,7 +282,7 @@ public class LocalResourceController implements RMController {
throw new DBException("Error creating shared project path", e);
}
}
validateResourcePath(name, PROJECT_REGEX);
validateResourcePath(name);
RMProject project;
var projectPath = sharedProjectsPath.resolve(name);
if (Files.exists(projectPath)) {
@@ -309,7 +311,8 @@ public class LocalResourceController implements RMController {
RMProject project = makeProjectFromId(projectId, false);
Path targetPath = getProjectPath(projectId);
if (!Files.exists(targetPath)) {
throw new DBException("Project '" + project.getName() + "' doesn't exists");
log.debug(MessageFormat.format("Project folder ''{0}'' is not found", projectId));
return;
}
try {
log.debug("Deleting project '" + projectId + "'");
@@ -459,6 +462,7 @@ public class LocalResourceController implements RMController {
DBPDataSourceRegistry registry = project.getDataSourceRegistry();
var result = Path.of(folderPath);
var newName = result.getFileName().toString();
GeneralUtils.validateResourceName(newName);
var parent = result.getParent();
var parentFolder = parent == null ? null : registry.getFolder(parent.toString().replace("\\", "/"));
DBPDataSourceFolder newFolder = registry.addFolder(parentFolder, newName);
@@ -833,19 +837,10 @@ public class LocalResourceController implements RMController {
}
private void validateResourcePath(String resourcePath) throws DBException {
validateResourcePath(resourcePath, FILE_REGEX);
}
private void validateResourcePath(String resourcePath, String regex) throws DBException {
var fullPath = Paths.get(resourcePath);
for (Path path : fullPath) {
if (path.toString().startsWith(".")) {
throw new DBException("Resource path '" + resourcePath + "' can't start with dot");
}
}
if (!resourcePath.matches(regex)) {
String illegalCharacters = resourcePath.replaceAll(regex, " ").strip();
throw new DBException("Resource path '" + resourcePath + "' contains illegal characters: " + illegalCharacters);
String fileName = IOUtils.getFileNameWithoutExtension(path);
GeneralUtils.validateResourceName(fileName);
}
}
@@ -30,6 +30,7 @@ import org.jkiss.dbeaver.model.auth.SMSessionContext;
import org.jkiss.dbeaver.model.auth.impl.AbstractSessionPersistent;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.websocket.event.WSEvent;
import org.jkiss.dbeaver.model.websocket.event.WSEventDeleteTempFile;
import org.jkiss.dbeaver.model.websocket.event.session.WSSessionExpiredEvent;
import java.time.Instant;
@@ -132,6 +133,11 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
return workspace.getAuthContext();
}
protected void clearSessionContext() {
this.workspace.getAuthContext().clear();
this.workspace.getAuthContext().addSession(this);
}
@NotNull
@Property
public String getSessionId() {
@@ -166,6 +172,7 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
public void close() {
super.close();
var sessionExpiredEvent = new WSSessionExpiredEvent();
application.getEventController().addEvent(new WSEventDeleteTempFile(getSessionId()));
synchronized (sessionEventHandlers) {
for (CBWebSessionEventHandler sessionEventHandler : sessionEventHandlers) {
try {
@@ -178,6 +185,8 @@ public abstract class BaseWebSession extends AbstractSessionPersistent {
sessionEventHandlers.clear();
workspace.dispose();
clearSessionContext();
}
}
@@ -54,7 +54,8 @@ public class WebAuthInfo implements SMSessionPrincipal {
@NotNull WebAuthProviderDescriptor authProvider,
@NotNull DBWUserIdentity userIdentity,
@NotNull SMSession authSession,
@NotNull OffsetDateTime loginTime) {
@NotNull OffsetDateTime loginTime
) {
this.session = session;
this.user = user;
this.authProvider = authProvider;
@@ -33,6 +33,9 @@ import io.cloudbeaver.service.sql.WebSQLConstants;
import io.cloudbeaver.utils.CBModelConstants;
import io.cloudbeaver.utils.WebAppUtils;
import io.cloudbeaver.utils.WebDataSourceUtils;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -83,10 +86,6 @@ import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Web session.
* Is the main source of data in web application
@@ -99,7 +98,6 @@ public class WebSession extends BaseWebSession
public static final SMSessionType CB_SESSION_TYPE = new SMSessionType("CloudBeaver");
private static final String WEB_SESSION_AUTH_CONTEXT_TYPE = "web-session";
private static final String ATTR_LOCALE = "locale";
private static final AtomicInteger TASK_ID = new AtomicInteger();
private final AtomicInteger taskCount = new AtomicInteger();
@@ -275,28 +273,22 @@ public class WebSession extends BaseWebSession
continue;
}
switch (type) {
case DATASOURCE_CREATED: {
case DATASOURCE_CREATED -> {
WebConnectionInfo connectionInfo = new WebConnectionInfo(this, ds);
this.connections.put(connectionInfo.getId(), connectionInfo);
sendDataSourceUpdatedEvent = true;
break;
}
case DATASOURCE_UPDATED: {
// if settings were changed we need to send event
case DATASOURCE_UPDATED -> // if settings were changed we need to send event
sendDataSourceUpdatedEvent |= !ds.equalSettings(oldDataSources.get(dsId));
break;
}
case DATASOURCE_DELETED: {
case DATASOURCE_DELETED -> {
WebDataSourceUtils.disconnectDataSource(this, ds);
if (registry instanceof DBPDataSourceRegistryCache) {
((DBPDataSourceRegistryCache) registry).removeDataSourceFromList(ds);
if (registry instanceof DBPDataSourceRegistryCache dsrc) {
dsrc.removeDataSourceFromList(ds);
}
this.connections.remove(ds.getId());
sendDataSourceUpdatedEvent = true;
break;
}
default: {
break;
default -> {
}
}
}
@@ -313,6 +305,7 @@ public class WebSession extends BaseWebSession
log.error(e);
}
refreshUserData();
clearSessionContext();
}
private void initNavigatorModel() {
@@ -766,8 +759,8 @@ public class WebSession extends BaseWebSession
public <T> T getAttribute(String name) {
synchronized (attributes) {
Object value = attributes.get(name);
if (value instanceof PersistentAttribute) {
value = ((PersistentAttribute) value).getValue();
if (value instanceof PersistentAttribute persistentAttribute) {
value = persistentAttribute.getValue();
}
return (T) value;
}
@@ -782,8 +775,8 @@ public class WebSession extends BaseWebSession
public <T> T getAttribute(String name, Function<T, T> creator, Function<T, T> disposer) {
synchronized (attributes) {
Object value = attributes.get(name);
if (value instanceof PersistentAttribute) {
value = ((PersistentAttribute) value).getValue();
if (value instanceof PersistentAttribute persistentAttribute) {
value = persistentAttribute.getValue();
}
if (value == null) {
value = creator.apply(null);
@@ -967,9 +960,7 @@ public class WebSession extends BaseWebSession
private <T> boolean isAuthInfoInstanceOf(WebAuthInfo authInfo, Class<T> adapter) {
if (authInfo != null && authInfo.getAuthSession() != null) {
if (adapter.isInstance(authInfo.getAuthSession())) {
return true;
}
return adapter.isInstance(authInfo.getAuthSession());
}
return false;
}
@@ -17,7 +17,6 @@
package io.cloudbeaver.model.session;
import io.cloudbeaver.DBWConstants;
import io.cloudbeaver.DBWUserIdentity;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.auth.SMAuthProviderExternal;
@@ -38,7 +37,6 @@ import org.jkiss.utils.CommonUtils;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -114,15 +112,6 @@ public class WebSessionAuthProcessor {
SMAuthProviderExternal<?> authProviderExternal = authProviderInstance instanceof SMAuthProviderExternal<?> ?
(SMAuthProviderExternal<?>) authProviderInstance : null;
boolean providerDisabled = !isProviderEnabled(providerId);
if (configMode || webSession.hasPermission(DBWConstants.PERMISSION_ADMIN)) {
// 1. Admin can authorize in any providers
// 2. When it authorizes in non-local provider for the first time we force linkUser flag
if (providerDisabled && webSession.getUser() != null) {
linkWithActiveUser = true;
}
}
SMSession authSession;
if (authProviderExternal != null && !configMode && !alreadyLoggedIn) {
@@ -22,7 +22,6 @@ import org.jkiss.code.Nullable;
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.auth.SMSessionContext;
import org.jkiss.dbeaver.model.impl.auth.SessionContextImpl;
import org.jkiss.dbeaver.model.rm.RMUtils;
import org.jkiss.dbeaver.runtime.DBWorkbench;
@@ -103,7 +102,7 @@ public class WebSessionWorkspace implements DBPWorkspace {
@Nullable
@Override
public WebProjectImpl getProjectById(String projectId) {
public WebProjectImpl getProjectById(@NotNull String projectId) {
if (projectId == null) {
return activeProject;
}
@@ -117,21 +116,15 @@ public class WebSessionWorkspace implements DBPWorkspace {
@NotNull
@Override
public SMSessionContext getAuthContext() {
public SessionContextImpl getAuthContext() {
return workspaceAuthContext;
}
@Override
public void dispose() {
clearAuthData();
clearProjects();
}
void clearAuthData() {
workspaceAuthContext.close();
}
public void setActiveProject(DBPProject activeProject) {
this.activeProject = (WebProjectImpl) activeProject;
}
@@ -161,7 +161,7 @@ public class WebUserContext implements SMCredentialsProvider {
this.user = null;
this.securityController = application.createSecurityController(this);
this.adminSecurityController = null;
this.secretController = application.getSecretController(this);
this.secretController = null;
}
@NotNull
@@ -220,7 +220,10 @@ public class WebUserContext implements SMCredentialsProvider {
this.userPermissions = permissions;
}
public DBSSecretController getSecretController() {
public DBSSecretController getSecretController() throws DBException {
if (this.securityController == null) {
this.secretController = application.getSecretController(this, workspace.getAuthContext());
}
return secretController;
}
@@ -14,9 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.cloudbeaver.server;
package io.cloudbeaver.model.utils;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.utils.ArrayUtils;
@@ -24,19 +25,18 @@ public class ConfigurationUtils {
private ConfigurationUtils() {
}
public static boolean isDriverEnabled(@NotNull DBPDriver driver) {
var driverId = driver.getFullId();
String[] disabledDrivers = CBApplication.getInstance().getAppConfiguration().getDisabledDrivers();
if (ArrayUtils.contains(disabledDrivers, driverId)) {
public static boolean isDriverEnabled(
@NotNull DBPDriver driver,
@Nullable String[] enabledDrivers,
@Nullable String[] disabledDrivers
) {
if (ArrayUtils.contains(enabledDrivers, driver.getFullId())) {
return true;
}
if (ArrayUtils.contains(disabledDrivers, driver.getFullId())) {
return false;
}
String[] enabledDrivers = CBApplication.getInstance().getAppConfiguration().getEnabledDrivers();
if (enabledDrivers.length > 0 && !ArrayUtils.contains(enabledDrivers, driverId)) {
return false;
}
return true;
return !driver.isEmbedded();
}
}
@@ -102,6 +102,12 @@ public class WebAuthProviderConfiguration {
return instance instanceof SMAuthProviderFederated ? ((SMAuthProviderFederated) instance).getMetadataLink(getId(), config.getParameters()) : null;
}
@Property
public String getAcsLink() throws DBException {
SMAuthProvider<?> instance = providerDescriptor.getInstance();
return instance instanceof SMAuthProviderFederated ? ((SMAuthProviderFederated) instance).getAcsLink(getId(), config.getParameters()) : null;
}
@Override
public String toString() {
return getDisplayName();
@@ -55,6 +55,7 @@ public class WebAuthProviderDescriptor extends AbstractDescriptor {
private final boolean trusted;
private final boolean isPrivate;
private final String[] requiredFeatures;
private final boolean isRequired;
public WebAuthProviderDescriptor(IConfigurationElement cfg) {
super(cfg);
@@ -64,6 +65,7 @@ public class WebAuthProviderDescriptor extends AbstractDescriptor {
this.configurable = CommonUtils.toBoolean(cfg.getAttribute("configurable"));
this.trusted = CommonUtils.toBoolean(cfg.getAttribute("trusted"));
this.isPrivate = CommonUtils.toBoolean(cfg.getAttribute("private"));
this.isRequired = CommonUtils.toBoolean(cfg.getAttribute("required"));
for (IConfigurationElement cfgElement : cfg.getChildren("configuration")) {
for (IConfigurationElement propGroup : ArrayUtils.safeArray(cfgElement.getChildren(PropertyDescriptor.TAG_PROPERTY_GROUP))) {
@@ -124,6 +126,10 @@ public class WebAuthProviderDescriptor extends AbstractDescriptor {
return isPrivate;
}
public boolean isRequired() {
return isRequired;
}
public List<PropertyDescriptor> getConfigurationParameters() {
return new ArrayList<>(configurationParameters.values());
}
@@ -0,0 +1,23 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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;
public interface HttpConstants {
String CONTENT_TYPE = "Content-Type";
String TYPE_JSON = "application/json";
}
@@ -17,11 +17,11 @@
package io.cloudbeaver.service;
import io.cloudbeaver.model.app.WebAppConfiguration;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.app.DBPApplication;
/**
* Web service implementation
@@ -29,11 +29,15 @@ import org.jkiss.dbeaver.model.app.DBPApplication;
public interface DBWServiceServerConfigurator extends DBWServiceBinding {
void configureServer(
@NotNull DBPApplication application,
@NotNull WebApplication application,
@Nullable WebSession session,
@NotNull WebAppConfiguration appConfig
) throws DBException;
default void migrateConfigurationIfNeeded(@NotNull WebApplication application) throws DBException {
}
void reloadConfiguration(@NotNull WebAppConfiguration appConfig) throws DBException;
}
@@ -19,7 +19,7 @@ package io.cloudbeaver.service;
import org.jkiss.dbeaver.DBException;
import javax.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServlet;
public interface DBWServletContext {
void addServlet(String servletId, HttpServlet servlet, String mapping) throws DBException;
@@ -19,8 +19,8 @@ package io.cloudbeaver.service;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.dbeaver.DBException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
@@ -1,3 +1,19 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.security;
import io.cloudbeaver.DBWConstants;
@@ -10,6 +26,7 @@ import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.rm.RMConstants;
import org.jkiss.dbeaver.model.rm.RMProject;
import org.jkiss.dbeaver.model.rm.RMProjectPermission;
import org.jkiss.dbeaver.model.security.exception.SMAccessTokenExpiredException;
import org.jkiss.dbeaver.model.security.exception.SMRefreshTokenExpiredException;
import java.util.ArrayList;
@@ -55,7 +72,7 @@ public class SMUtils {
return permissionInfos;
}
public static boolean isTokenExpiredExceptionWasHandled(Throwable ex) {
public static boolean isRefreshTokenExpiredExceptionWasHandled(Throwable ex) {
if (ex instanceof SMRefreshTokenExpiredException) {
return true;
}
@@ -69,4 +86,17 @@ public class SMUtils {
return false;
}
public static boolean isAccessTokenExpiredExceptionWasHandled(Throwable ex) {
if (ex instanceof SMAccessTokenExpiredException) {
return true;
}
Throwable cause = ex;
while ((cause = cause.getCause()) != null) {
if (cause instanceof SMAccessTokenExpiredException) {
return true;
}
}
return false;
}
}
@@ -22,9 +22,7 @@ import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.data.DBDAttributeBinding;
import org.jkiss.dbeaver.model.data.DBDRowIdentifier;
import org.jkiss.dbeaver.model.struct.DBSAttributeBase;
import org.jkiss.dbeaver.model.struct.DBSDataContainer;
import org.jkiss.dbeaver.model.struct.DBSTypedObject;
import org.jkiss.dbeaver.model.struct.*;
import java.util.HashSet;
import java.util.List;
@@ -126,4 +124,12 @@ public class WebSQLResultsInfo {
return null;
}
public boolean canRefreshResults() {
DBSEntity entity = getDefaultRowIdentifier().getEntity();
// FIXME: do not refresh documents for now. Can be solved by extracting document ID attributes
// FIXME: but it will require to provide dynamic document metadata.
return entity == null || entity.getDataSource() == null ||
(!(entity instanceof DBSDocumentContainer) && !entity.getDataSource().getInfo().isDynamicMetadata());
}
}
@@ -16,9 +16,12 @@
*/
package io.cloudbeaver.utils;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.WebProjectImpl;
import io.cloudbeaver.auth.NoAuthCredentialsProvider;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.app.WebAuthApplication;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
@@ -30,11 +33,14 @@ import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.utils.GeneralUtils;
import org.jkiss.utils.CommonUtils;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.nio.file.Path;
import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class WebAppUtils {
private static final Log log = Log.getLog(WebAppUtils.class);
@@ -176,12 +182,11 @@ public class WebAppUtils {
String path = getWebApplication().getRootURI();
if (sameSite != null) {
if (sameSite.toLowerCase() == "none" && request.isSecure() == false) {
if (!request.isSecure()) {
log.debug("Attempt to set Cookie `" + cookieName + "` with `SameSite=None` failed, it require a secure context/HTTPS");
} else {
sessionCookie.setSecure(true);
path = path.concat("; SameSite=" + sameSite);
}
sessionCookie.setSecure(true);
path = path.concat("; SameSite=" + sameSite);
}
sessionCookie.setPath(path);
@@ -209,4 +214,12 @@ public class WebAppUtils {
return RMProjectType.GLOBAL.getPrefix() + "_" + globalConfigurationName;
}
public static WebProjectImpl getProjectById(WebSession webSession, String projectId) throws DBWebException {
WebProjectImpl project = webSession.getProjectById(projectId);
if (project == null) {
throw new DBWebException("Project '" + projectId + "' not found");
}
return project;
}
}
@@ -56,7 +56,7 @@ public class WebConnectionFolderUtils {
} else if (folderNode instanceof DBNLocalFolder) {
return ((DBNLocalFolder) folderNode).getFolder();
} else {
throw new DBWebException("Navigator node '" + folderNode.getNodeItemPath() + "' is not a folder node");
throw new DBWebException("Navigator node '" + folderNode.getNodeUri() + "' is not a folder node");
}
}
@@ -20,6 +20,7 @@ package io.cloudbeaver.utils;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.utils.GeneralUtils;
import java.io.File;
import java.net.URI;
@@ -55,6 +56,7 @@ public class WebTestUtils {
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create(apiUrl))
.POST(HttpRequest.BodyPublishers.ofString(input))
.setHeader("TE-Client-Version", GeneralUtils.getMajorVersion())
.header("Content-Type", "application/json");
if (!headers.isEmpty()) {
@@ -74,6 +76,7 @@ public class WebTestUtils {
public static boolean getServerStatus(HttpClient client, String apiUrl) {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(apiUrl))
.setHeader("TE-Client-Version", GeneralUtils.getMajorVersion())
.GET()
.build();
try {
@@ -23,4 +23,5 @@ public interface CBWebSessionEventHandler {
void handleWebSessionEvent(WSEvent event) throws DBException;
void close();
}
@@ -3,9 +3,9 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Community Product
Bundle-SymbolicName: io.cloudbeaver.product.ce;singleton:=true
Bundle-Version: 23.2.2.qualifier
Bundle-Release-Date: 20230209
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Version: 23.3.2.qualifier
Bundle-Release-Date: 20240108
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: io.cloudbeaver.server
@@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.product.ce</artifactId>
<version>23.2.2-SNAPSHOT</version>
<version>23.3.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -2,9 +2,8 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Base JDBC drivers
Bundle-SymbolicName: io.cloudbeaver.resources.drivers.base;singleton:=true
Bundle-Version: 1.0.83.qualifier
Bundle-Release-Date: 20230209
Bundle-Version: 1.0.89.qualifier
Bundle-Release-Date: 20240108
Bundle-Vendor: DBeaver Corp
Bundle-ActivationPolicy: lazy
Automatic-Module-Name: io.cloudbeaver.resources.drivers.base
Require-Bundle: io.cloudbeaver.server
@@ -10,7 +10,6 @@
<resource name="drivers/postgresql"/>
<resource name="drivers/clickhouse"/>
<resource name="drivers/clickhouse_com"/>
<resource name="drivers/derby"/>
<resource name="drivers/jaybird"/>
<resource name="drivers/h2"/>
<resource name="drivers/h2_v2"/>
@@ -29,7 +28,6 @@
<bundle id="drivers.postgresql" label="PostgreSQL drivers"/>
<bundle id="drivers.clickhouse" label="Clickhouse (legacy) drivers"/>
<bundle id="drivers.clickhouse_com" label="Clickhouse drivers"/>
<bundle id="drivers.derby" label="Derby drivers"/>
<bundle id="drivers.firebird" label="Firebird drivers"/>
<bundle id="drivers.h2" label="H2 drivers"/>
<bundle id="drivers.h2_v2" label="H2 v2 drivers"/>
@@ -49,7 +47,6 @@
<driver id="jaybird:jaybird"/>
<driver id="clickhouse:yandex_clickhouse"/>
<driver id="clickhouse:com_clickhouse"/>
<driver id="generic:derby_server"/>
<driver id="h2:h2_embedded"/>
<driver id="h2:h2_embedded_v2"/>
<driver id="sqlite:sqlite_jdbc"/>
@@ -9,6 +9,6 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.resources.drivers.base</artifactId>
<version>1.0.83-SNAPSHOT</version>
<version>1.0.89-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -3,9 +3,9 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: DBeaver Corp
Bundle-Name: Cloudbeaver Web Server
Bundle-SymbolicName: io.cloudbeaver.server;singleton:=true
Bundle-Version: 23.2.2.qualifier
Bundle-Release-Date: 20230209
Bundle-RequiredExecutionEnvironment: JavaSE-11
Bundle-Version: 23.3.2.qualifier
Bundle-Release-Date: 20240108
Bundle-RequiredExecutionEnvironment: JavaSE-17
Bundle-ActivationPolicy: lazy
Bundle-Activator: io.cloudbeaver.server.CBPlatformActivator
Bundle-ClassPath: .
@@ -6,14 +6,6 @@
<extension-point id="io.cloudbeaver.driver" name="Web drivers" schema="schema/io.cloudbeaver.driver.exsd"/>
<extension-point id="io.cloudbeaver.handler" name="Web handlers" schema="schema/io.cloudbeaver.handler.exsd"/>
<extension point="org.eclipse.core.runtime.adapters">
<factory adaptableType="org.jkiss.dbeaver.runtime.DBWorkbench" class="io.cloudbeaver.server.WebPlatformAdapterFactory">
<adapter type="org.jkiss.dbeaver.model.app.DBPPlatform"/>
<adapter type="org.jkiss.dbeaver.runtime.ui.DBPPlatformUI"/>
</factory>
</extension>
<!-- Needed to instantiate connections thru navigator model -->
<extension point="org.jkiss.dbeaver.service">
<service name="org.jkiss.dbeaver.runtime.DBServiceConnections" class="io.cloudbeaver.server.WebServiceConnectionsImpl"/>
@@ -47,7 +39,6 @@
<extension point="org.jkiss.dbeaver.ws.event.handler">
<eventHandler class="io.cloudbeaver.server.events.WSDefaultEventHandler">
<topic id="cb_config"/>
<topic id="cb_workspace_configuration"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSDataSourceUpdatedEventHandlerImpl">
<topic id="cb_datasource"/>
@@ -73,6 +64,15 @@
<eventHandler class="io.cloudbeaver.server.events.WSLogEventHandler">
<topic id="cb_session_log"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSEventHandlerWorkspaceConfigUpdate">
<topic id="cb_workspace_configuration"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSDeleteTempFileHandler">
<topic id="cb_delete_temp_folder"/>
</eventHandler>
<eventHandler class="io.cloudbeaver.server.events.WSUserDeletedEventHandler">
<topic id="cb_user"/>
</eventHandler>
</extension>
</plugin>
+1 -1
View File
@@ -10,7 +10,7 @@
<relativePath>../</relativePath>
</parent>
<artifactId>io.cloudbeaver.server</artifactId>
<version>23.2.2-SNAPSHOT</version>
<version>23.3.2-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
@@ -8,7 +8,7 @@ input PageInput {
offset: Int
}
directive @since(version: String!) on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION
directive @since(version: String!) repeatable on OBJECT|SCALAR|QUERY|MUTATION|FIELD|VARIABLE_DEFINITION|OBJECT|FIELD_DEFINITION|ARGUMENT_DEFINITION|INTERFACE|ENUM|ENUM_VALUE|INPUT_OBJECT|INPUT_FIELD_DEFINITION
type Query
@@ -12,6 +12,8 @@ type ObjectPropertyInfo {
displayName: String
# Property description
description: String
# Property hint
hint: String @since(version: "23.2.3")
# Property category (may be used if object has a lot of properties)
category: String
# Property data type (int, String, etc)
@@ -34,6 +36,8 @@ type ObjectPropertyInfo {
order: Int!
# Supported configuration types (for driver properties)
supportedConfigurationTypes: [ String! ]
# Required parameters
required: Boolean! @since(version: "23.3.1")
}
enum ObjectPropertyLength {
@@ -51,7 +51,8 @@ enum CBEventTopic {
cb_projects,
cb_object_permissions,
cb_subject_permissions,
cb_database_output_log
cb_database_output_log,
cb_delete_temp_folder
}
# Base server event interface
@@ -56,6 +56,8 @@ type DatabaseObjectInfo {
type NavigatorNodeInfo {
# Node ID - generally a full path to the node from root of tree
id: ID!
# # Node URI - a unique path to a node including all parent nodes
# uri: ID! @since(version: "23.3.1")
# Node human readable name
name: String
#Node full name
@@ -76,6 +78,10 @@ type NavigatorNodeInfo {
# Associated object. Maybe null for non-database objects
object: DatabaseObjectInfo
# Associated object. Return value depends on the node type - connectionId for connection node, resource path for resource node, etc.
# null - if node currently not support this property
objectId: String @since(version: "23.2.4")
# Supported features: item, container, leaf
# canDelete, canRename
features: [ String! ]
@@ -356,4 +356,12 @@ extend type Mutation {
# Returns SQLExecutionPlan
asyncSqlExplainExecutionPlanResult(taskId: ID!): SQLExecutionPlan !
asyncSqlRowDataCount(
projectId: ID,
connectionId: ID!,
contextId: ID!,
resultsId: ID!
): AsyncTaskInfo!
asyncSqlRowDataCountResult(taskId: ID!): Int!
}
@@ -19,7 +19,9 @@ package io.cloudbeaver.model;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.WebServiceUtils;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.server.ConfigurationUtils;
import io.cloudbeaver.model.utils.ConfigurationUtils;
import io.cloudbeaver.server.CBAppConfig;
import io.cloudbeaver.server.CBApplication;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.DBConstants;
@@ -236,7 +238,12 @@ public class WebDatabaseDriverInfo {
@Property
public boolean isEnabled() {
return ConfigurationUtils.isDriverEnabled(driver);
CBAppConfig config = CBApplication.getInstance().getAppConfiguration();
return ConfigurationUtils.isDriverEnabled(
driver,
config.getEnabledDrivers(),
config.getDisabledDrivers()
);
}
@Property
@@ -17,23 +17,18 @@
package io.cloudbeaver.model;
import io.cloudbeaver.server.ConfigurationUtils;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.DBPDataSourceHandler;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import io.cloudbeaver.model.utils.ConfigurationUtils;
import io.cloudbeaver.server.CBAppConfig;
import io.cloudbeaver.server.CBApplication;
import org.jkiss.dbeaver.model.connection.DBPDriver;
public class WebDatasourceAccessCheckHandler implements DBPDataSourceHandler {
public class WebDatasourceAccessCheckHandler extends BaseDatasourceAccessCheckHandler {
@Override
public void beforeConnect(DBRProgressMonitor monitor, @NotNull DBPDataSourceContainer dataSourceContainer) throws DBException {
if (!ConfigurationUtils.isDriverEnabled(dataSourceContainer.getDriver())) {
throw new DBException("Driver disabled");
}
}
@Override
public void beforeDisconnect(DBRProgressMonitor monitor, @NotNull DBPDataSourceContainer dataSourceContainer) throws DBException {
protected boolean isDriverDisabled(DBPDriver driver) {
CBAppConfig config = CBApplication.getInstance().getAppConfiguration();
return !ConfigurationUtils.isDriverEnabled(
driver,
config.getEnabledDrivers(),
config.getDisabledDrivers());
}
}
@@ -83,6 +83,10 @@ public class WebAuthProviderInfo {
return descriptor.isPrivate();
}
public boolean isRequired() {
return descriptor.isRequired();
}
public boolean isSupportProvisioning() {
return descriptor.getInstance() instanceof SMProvisioner;
}
@@ -18,23 +18,29 @@ package io.cloudbeaver.server;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import io.cloudbeaver.DBWebException;
import io.cloudbeaver.WebServiceUtils;
import io.cloudbeaver.model.app.BaseAuthWebAppConfiguration;
import io.cloudbeaver.model.app.WebAuthConfiguration;
import io.cloudbeaver.registry.WebAuthProviderDescriptor;
import io.cloudbeaver.registry.WebAuthProviderRegistry;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.connection.DBPDriver;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.registry.DataSourceNavigatorSettings;
import org.jkiss.utils.ArrayUtils;
import org.jkiss.utils.CommonUtils;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* Application configuration
*/
public class CBAppConfig extends BaseAuthWebAppConfiguration implements WebAuthConfiguration {
private static final Log log = Log.getLog(CBAppConfig.class);
public static final DataSourceNavigatorSettings.Preset PRESET_WEB = new DataSourceNavigatorSettings.Preset("web", "Web", "Default view");
public static final DataSourceNavigatorSettings DEFAULT_VIEW_SETTINGS = PRESET_WEB.getSettings();
@@ -161,10 +167,6 @@ public class CBAppConfig extends BaseAuthWebAppConfiguration implements WebAuthC
return enabledDrivers;
}
public void setEnabledDrivers(String[] enabledDrivers) {
this.enabledDrivers = enabledDrivers;
}
public String[] getDisabledDrivers() {
return disabledDrivers;
}
@@ -260,4 +262,39 @@ public class CBAppConfig extends BaseAuthWebAppConfiguration implements WebAuthC
return grantConnectionsAccessToAnonymousTeam;
}
// we disable embedded drivers by default and enable it in enabled drivers list
// that's why we need so complicated logic for disabling drivers
public void updateDisabledDriversConfig(String[] disabledDriversConfig) {
Set<String> disabledIds = new LinkedHashSet<>(Arrays.asList(disabledDriversConfig));
Set<String> enabledIds = new LinkedHashSet<>(Arrays.asList(this.enabledDrivers));
// remove all disabled embedded drivers from enabled drivers list
enabledIds.removeAll(disabledIds);
// enable embedded driver if it is not in disabled drivers list
for (String driverId : this.disabledDrivers) {
if (disabledIds.contains(driverId)) {
// driver is also disabled
continue;
}
// driver is removed from disabled list
// we need to enable if it is embedded
try {
DBPDriver driver = WebServiceUtils.getDriverById(driverId);
if (driver.isEmbedded()) {
enabledIds.add(driverId);
}
} catch (DBWebException e) {
log.error("Failed to find driver by id", e);
}
}
this.disabledDrivers = disabledDriversConfig;
this.enabledDrivers = enabledIds.toArray(String[]::new);
}
public boolean isDriverForceEnabled(@NotNull String driverId) {
return ArrayUtils.containsIgnoreCase(getEnabledDrivers(), driverId);
}
}
@@ -21,10 +21,10 @@ import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
import io.cloudbeaver.WebServiceUtils;
import io.cloudbeaver.auth.CBAuthConstants;
import io.cloudbeaver.auth.NoAuthCredentialsProvider;
import io.cloudbeaver.model.app.BaseWebApplication;
import io.cloudbeaver.model.app.WebAuthApplication;
import io.cloudbeaver.model.app.WebAuthConfiguration;
import io.cloudbeaver.model.session.WebAuthInfo;
import io.cloudbeaver.registry.WebDriverRegistry;
import io.cloudbeaver.registry.WebServiceRegistry;
import io.cloudbeaver.server.jetty.CBJettyServer;
@@ -43,18 +43,23 @@ import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.ModelPreferences;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import org.jkiss.dbeaver.model.app.DBPApplication;
import org.jkiss.dbeaver.model.app.DBPPlatform;
import org.jkiss.dbeaver.model.auth.AuthInfo;
import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.model.navigator.DBNBrowseSettings;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.security.*;
import org.jkiss.dbeaver.model.security.user.SMObjectPermissions;
import org.jkiss.dbeaver.model.security.SMAdminController;
import org.jkiss.dbeaver.model.security.SMAuthProviderCustomConfiguration;
import org.jkiss.dbeaver.model.security.SMConstants;
import org.jkiss.dbeaver.model.security.SMObjectType;
import org.jkiss.dbeaver.model.websocket.event.WSEventController;
import org.jkiss.dbeaver.model.websocket.event.WSServerConfigurationChangedEvent;
import org.jkiss.dbeaver.registry.BaseApplicationImpl;
import org.jkiss.dbeaver.registry.DataSourceNavigatorSettings;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.runtime.IVariableResolver;
import org.jkiss.dbeaver.runtime.ui.DBPPlatformUI;
import org.jkiss.dbeaver.utils.ContentUtils;
import org.jkiss.dbeaver.utils.GeneralUtils;
import org.jkiss.dbeaver.utils.PrefUtils;
@@ -90,6 +95,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
* In configuration mode sessions expire after a week
*/
private static final long CONFIGURATION_MODE_SESSION_IDLE_TIME = 60 * 60 * 1000 * 24 * 7;
public static final String HOST_LOCALHOST = "localhost";
public static final String HOST_127_0_0_1 = "127.0.0.1";
static {
@@ -106,6 +113,7 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
protected int serverPort = CBConstants.DEFAULT_SERVER_PORT;
private String serverHost = null;
private String serverName = null;
private String sslConfigurationPath = null;
private String contentRoot = CBConstants.DEFAULT_CONTENT_ROOT;
private String rootURI = CBConstants.DEFAULT_ROOT_URI;
private String servicesURI = CBConstants.DEFAULT_SERVICES_URI;
@@ -256,8 +264,9 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
if (CommonUtils.isEmpty(localHostAddress)) {
localHostAddress = System.getProperty(CBConstants.VAR_CB_LOCAL_HOST_ADDR);
}
if (CommonUtils.isEmpty(localHostAddress) || "127.0.0.1".equals(localHostAddress) || "::0".equals(localHostAddress)) {
localHostAddress = "localhost";
if (CommonUtils.isEmpty(localHostAddress) || HOST_127_0_0_1.equals(localHostAddress) || "::0".equals(
localHostAddress)) {
localHostAddress = HOST_LOCALHOST;
}
final Runtime runtime = Runtime.getRuntime();
@@ -278,8 +287,10 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
log.debug(GeneralUtils.getProductName() + " " + GeneralUtils.getProductVersion() + " is starting"); //$NON-NLS-1$
log.debug("\tOS: " + System.getProperty(StandardConstants.ENV_OS_NAME) + " " + System.getProperty(StandardConstants.ENV_OS_VERSION) + " (" + System.getProperty(StandardConstants.ENV_OS_ARCH) + ")");
log.debug("\tJava version: " + System.getProperty(StandardConstants.ENV_JAVA_VERSION) + " by " + System.getProperty(StandardConstants.ENV_JAVA_VENDOR) + " (" + System.getProperty(StandardConstants.ENV_JAVA_ARCH) + "bit)");
log.debug("\tOS: " + System.getProperty(StandardConstants.ENV_OS_NAME) + " " + System.getProperty(
StandardConstants.ENV_OS_VERSION) + " (" + System.getProperty(StandardConstants.ENV_OS_ARCH) + ")");
log.debug("\tJava version: " + System.getProperty(StandardConstants.ENV_JAVA_VERSION) + " by " + System.getProperty(
StandardConstants.ENV_JAVA_VENDOR) + " (" + System.getProperty(StandardConstants.ENV_JAVA_ARCH) + "bit)");
log.debug("\tInstall path: '" + SystemVariablesResolver.getInstallPath() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
log.debug("\tGlobal workspace: '" + instanceLoc.getURL() + "'"); //$NON-NLS-1$ //$NON-NLS-2$
log.debug("\tMemory available " + (runtime.totalMemory() / (1024 * 1024)) + "Mb/" + (runtime.maxMemory() / (1024 * 1024)) + "Mb");
@@ -309,7 +320,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
{
// Perform services initialization
for (DBWServiceInitializer wsi : WebServiceRegistry.getInstance().getWebServices(DBWServiceInitializer.class)) {
for (DBWServiceInitializer wsi : WebServiceRegistry.getInstance()
.getWebServices(DBWServiceInitializer.class)) {
try {
wsi.initializeService(this);
} catch (Exception e) {
@@ -319,14 +331,6 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
{
try {
initializeSecurityController();
} catch (Exception e) {
log.error("Error initializing database", e);
return;
}
}
try {
initializeServer();
} catch (DBException e) {
@@ -334,6 +338,14 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
return;
}
try {
initializeSecurityController();
} catch (Exception e) {
log.error("Error initializing database", e);
return;
}
if (configurationMode) {
// Try to configure automatically
performAutoConfiguration(configPath.toFile().getParentFile());
@@ -379,7 +391,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
String autoAdminName = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
String autoAdminPassword = System.getenv(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
if (CommonUtils.isEmpty(autoServerName) || CommonUtils.isEmpty(autoAdminName) || CommonUtils.isEmpty(autoAdminPassword)) {
if (CommonUtils.isEmpty(autoServerName) || CommonUtils.isEmpty(autoAdminName) || CommonUtils.isEmpty(
autoAdminPassword)) {
// Try to load from auto config file
if (configPath.exists()) {
File autoConfigFile = new File(configPath, CBConstants.AUTO_CONFIG_FILE_NAME);
@@ -393,13 +406,15 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
autoAdminName = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_NAME);
autoAdminPassword = autoProps.getProperty(CBConstants.VAR_AUTO_CB_ADMIN_PASSWORD);
} catch (IOException e) {
log.error("Error loading auto configuration file '" + autoConfigFile.getAbsolutePath() + "'", e);
log.error("Error loading auto configuration file '" + autoConfigFile.getAbsolutePath() + "'",
e);
}
}
}
}
if (CommonUtils.isEmpty(autoServerName) || CommonUtils.isEmpty(autoAdminName) || CommonUtils.isEmpty(autoAdminPassword)) {
if (CommonUtils.isEmpty(autoServerName) || CommonUtils.isEmpty(autoAdminName) || CommonUtils.isEmpty(
autoAdminPassword)) {
log.info("No auto configuration was found. Server must be configured manually");
return;
}
@@ -420,7 +435,14 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
protected void initializeServer() throws DBException {
for (DBWServiceServerConfigurator wsc : WebServiceRegistry.getInstance()
.getWebServices(DBWServiceServerConfigurator.class)) {
try {
wsc.migrateConfigurationIfNeeded(this);
} catch (Exception e) {
log.warn("Error migration configuration " + wsc.getClass().getName(), e);
}
}
}
private void determineLocalAddresses() {
@@ -495,6 +517,7 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
protected Path loadServerConfiguration() throws DBException {
Path path = super.loadServerConfiguration();
File runtimeConfigFile = getRuntimeAppConfigFile();
if (runtimeConfigFile.exists()) {
log.debug("Runtime configuration [" + runtimeConfigFile.getAbsolutePath() + "]");
@@ -514,7 +537,9 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
parseConfiguration(configPath.toFile());
}
// Set default preferences
PrefUtils.setDefaultPreferenceValue(ModelPreferences.getPreferences(), ModelPreferences.UI_DRIVERS_HOME, getDriversLocation());
PrefUtils.setDefaultPreferenceValue(ModelPreferences.getPreferences(),
ModelPreferences.UI_DRIVERS_HOME,
getDriversLocation());
}
private void parseConfiguration(File configFile) throws DBException {
@@ -536,12 +561,18 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
} else if (serverURL == null) {
String hostName = serverHost;
if (CommonUtils.isEmpty(hostName)) {
hostName = InetAddress.getLocalHost().getHostName();
try {
hostName = InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
log.debug("Error resolving localhost address: " + e.getMessage());
hostName = HOST_LOCALHOST;
}
}
serverURL = "http://" + hostName + ":" + serverPort;
}
serverName = JSONUtils.getString(serverConfig, CBConstants.PARAM_SERVER_NAME, serverName);
sslConfigurationPath = JSONUtils.getString(serverConfig, CBConstants.PARAM_SSL_CONFIGURATION_PATH, sslConfigurationPath);
contentRoot = WebAppUtils.getRelativePath(
JSONUtils.getString(serverConfig, CBConstants.PARAM_CONTENT_ROOT, contentRoot), homeFolder);
rootURI = readRootUri(serverConfig);
@@ -551,10 +582,14 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
workspaceLocation = WebAppUtils.getRelativePath(
JSONUtils.getString(serverConfig, CBConstants.PARAM_WORKSPACE_LOCATION, workspaceLocation), homeFolder);
maxSessionIdleTime = JSONUtils.getLong(serverConfig, CBConstants.PARAM_SESSION_EXPIRE_PERIOD, maxSessionIdleTime);
maxSessionIdleTime = JSONUtils.getLong(serverConfig,
CBConstants.PARAM_SESSION_EXPIRE_PERIOD,
maxSessionIdleTime);
develMode = JSONUtils.getBoolean(serverConfig, CBConstants.PARAM_DEVEL_MODE, develMode);
enableSecurityManager = JSONUtils.getBoolean(serverConfig, CBConstants.PARAM_SECURITY_MANAGER, enableSecurityManager);
enableSecurityManager = JSONUtils.getBoolean(serverConfig,
CBConstants.PARAM_SECURITY_MANAGER,
enableSecurityManager);
//SM config
gson.fromJson(
gson.toJsonTree(JSONUtils.getObject(serverConfig, CBConstants.PARAM_SM_CONFIGURATION)),
@@ -578,7 +613,7 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
}
parseAdditionalConfiguration(configProps);
} catch (IOException | DBException e) {
} catch (Exception e) {
throw new DBException("Error parsing server configuration", e);
}
@@ -636,7 +671,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
protected void readProductConfiguration(Map<String, Object> serverConfig, Gson gson, String homeFolder) throws DBException {
protected void readProductConfiguration(Map<String, Object> serverConfig, Gson gson, String homeFolder)
throws DBException {
String productConfigPath = WebAppUtils.getRelativePath(
JSONUtils.getString(
serverConfig,
@@ -652,7 +688,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
log.error("Product configuration file not found (" + productConfigFile.getAbsolutePath() + "'");
} else {
log.debug("Load product configuration from '" + productConfigFile.getAbsolutePath() + "'");
try (Reader reader = new InputStreamReader(new FileInputStream(productConfigFile), StandardCharsets.UTF_8)) {
try (Reader reader = new InputStreamReader(new FileInputStream(productConfigFile),
StandardCharsets.UTF_8)) {
productConfiguration.putAll(JSONUtils.parseMap(gson, reader));
} catch (Exception e) {
throw new DBException("Error reading product configuration", e);
@@ -673,11 +710,13 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
protected Map<String, Object> readConnectionsPermissionsConfiguration(Path parentPath) {
String permissionsConfigPath = WebAppUtils.getRelativePath(CBConstants.DEFAULT_DATASOURCE_PERMISSIONS_CONFIGURATION, parentPath);
String permissionsConfigPath = WebAppUtils.getRelativePath(CBConstants.DEFAULT_DATASOURCE_PERMISSIONS_CONFIGURATION,
parentPath);
File permissionsConfigFile = new File(permissionsConfigPath);
if (permissionsConfigFile.exists()) {
log.debug("Load permissions configuration from '" + permissionsConfigFile.getAbsolutePath() + "'");
try (Reader reader = new InputStreamReader(new FileInputStream(permissionsConfigFile), StandardCharsets.UTF_8)) {
try (Reader reader = new InputStreamReader(new FileInputStream(permissionsConfigFile),
StandardCharsets.UTF_8)) {
return JSONUtils.parseMap(getGson(), reader);
} catch (Exception e) {
log.error("Error reading permissions configuration", e);
@@ -728,18 +767,16 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
}
private Gson getGson() {
protected GsonBuilder getGsonBuilder() {
// Stupid way to populate existing objects but ok google (https://github.com/google/gson/issues/431)
InstanceCreator<CBAppConfig> appConfigCreator = type -> appConfiguration;
InstanceCreator<DataSourceNavigatorSettings> navSettingsCreator = type -> (DataSourceNavigatorSettings) appConfiguration.getDefaultNavigatorSettings();
InstanceCreator<SMControllerConfiguration> smConfigCreator = type -> securityManagerConfiguration;
return new GsonBuilder()
.setLenient()
.registerTypeAdapter(CBAppConfig.class, appConfigCreator)
.registerTypeAdapter(DataSourceNavigatorSettings.class, navSettingsCreator)
.registerTypeAdapter(SMControllerConfiguration.class, smConfigCreator)
.create();
.registerTypeAdapter(SMControllerConfiguration.class, smConfigCreator);
}
protected void readAdditionalConfiguration(Map<String, Object> rootConfig) throws DBException {
@@ -805,7 +842,7 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
@NotNull String newServerURL,
@NotNull String adminName,
@Nullable String adminPassword,
@NotNull List<WebAuthInfo> authInfoList,
@NotNull List<AuthInfo> authInfoList,
long sessionExpireTime,
@NotNull CBAppConfig appConfig,
@Nullable SMCredentialsProvider credentialsProvider
@@ -841,7 +878,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
configurationMode = CommonUtils.isEmpty(serverName);
// Reloading configuration by services
for (DBWServiceServerConfigurator wsc : WebServiceRegistry.getInstance().getWebServices(DBWServiceServerConfigurator.class)) {
for (DBWServiceServerConfigurator wsc : WebServiceRegistry.getInstance()
.getWebServices(DBWServiceServerConfigurator.class)) {
try {
wsc.reloadConfiguration(appConfig);
} catch (Exception e) {
@@ -865,11 +903,15 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
protected abstract void finishSecurityServiceConfiguration(
@NotNull String adminName,
@Nullable String adminPassword,
@NotNull List<WebAuthInfo> authInfoList
@NotNull List<AuthInfo> authInfoList
) throws DBException;
public synchronized void flushConfiguration(SMCredentialsProvider credentialsProvider) throws DBException {
saveRuntimeConfig(serverName, serverURL, maxSessionIdleTime, appConfiguration, credentialsProvider);
public synchronized void flushConfiguration(SMCredentialsProvider webSession) throws DBException {
saveRuntimeConfig(serverName, serverURL, maxSessionIdleTime, appConfiguration, webSession);
}
public synchronized void flushConfiguration() throws DBException {
saveRuntimeConfig(serverName, serverURL, maxSessionIdleTime, appConfiguration, new NoAuthCredentialsProvider());
}
@@ -878,7 +920,9 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
String anonymousTeamId = appConfig.getAnonymousUserTeam();
var securityController = getSecurityController();
for (DBPDataSourceContainer ds : WebServiceUtils.getGlobalDataSourceRegistry().getDataSources()) {
var datasourcePermissions = securityController.getObjectPermissions(anonymousTeamId, ds.getId(), SMObjectType.datasource);
var datasourcePermissions = securityController.getObjectPermissions(anonymousTeamId,
ds.getId(),
SMObjectType.datasource);
if (ArrayUtils.isEmpty(datasourcePermissions.getPermissions())) {
securityController.setObjectPermissions(
Set.of(ds.getId()),
@@ -897,7 +941,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
private void grantPermissionsToConnections() {
try {
var globalRegistry = WebDataSourceUtils.getGlobalDataSourceRegistry();
var permissionsConfiguration = readConnectionsPermissionsConfiguration(globalRegistry.getProject().getMetadataFolder(false));
var permissionsConfiguration = readConnectionsPermissionsConfiguration(globalRegistry.getProject()
.getMetadataFolder(false));
if (permissionsConfiguration == null) {
return;
}
@@ -905,7 +950,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
var dataSourceId = entry.getKey();
var ds = globalRegistry.getDataSource(dataSourceId);
if (ds == null) {
log.error("Connection " + dataSourceId + " is not found in project " + globalRegistry.getProject().getName());
log.error("Connection " + dataSourceId + " is not found in project " + globalRegistry.getProject()
.getName());
}
List<String> permissions = JSONUtils.getStringList(permissionsConfiguration, dataSourceId);
var securityController = getSecurityController();
@@ -971,7 +1017,10 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
var originServerConfig = getServerConfigProps(this.originalConfigurationProperties); // get server properties from original configuration file
rootConfig.put("server", serverConfigProperties);
if (!CommonUtils.isEmpty(newServerName)) {
copyConfigValue(originServerConfig, serverConfigProperties, CBConstants.PARAM_SERVER_NAME, newServerName);
copyConfigValue(originServerConfig,
serverConfigProperties,
CBConstants.PARAM_SERVER_NAME,
newServerName);
}
if (!CommonUtils.isEmpty(newServerURL)) {
copyConfigValue(
@@ -979,10 +1028,14 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
if (sessionExpireTime > 0) {
copyConfigValue(
originServerConfig, serverConfigProperties, CBConstants.PARAM_SESSION_EXPIRE_PERIOD, sessionExpireTime);
originServerConfig,
serverConfigProperties,
CBConstants.PARAM_SESSION_EXPIRE_PERIOD,
sessionExpireTime);
}
var databaseConfigProperties = new LinkedHashMap<String, Object>();
Map<String, Object> oldRuntimeDBConfig = JSONUtils.getObject(originServerConfig, CBConstants.PARAM_DB_CONFIGURATION);
Map<String, Object> oldRuntimeDBConfig = JSONUtils.getObject(originServerConfig,
CBConstants.PARAM_DB_CONFIGURATION);
if (!CommonUtils.isEmpty(databaseConfiguration) && !isDistributed()) {
for (Map.Entry<String, Object> mp : databaseConfiguration.entrySet()) {
copyConfigValue(oldRuntimeDBConfig, databaseConfigProperties, mp.getKey(), mp.getValue());
@@ -998,23 +1051,41 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
copyConfigValue(
oldAppConfig, appConfigProperties, "anonymousAccessEnabled", appConfig.isAnonymousAccessEnabled());
copyConfigValue(
oldAppConfig, appConfigProperties, "supportsCustomConnections", appConfig.isSupportsCustomConnections());
oldAppConfig,
appConfigProperties,
"supportsCustomConnections",
appConfig.isSupportsCustomConnections());
copyConfigValue(
oldAppConfig, appConfigProperties, "publicCredentialsSaveEnabled", appConfig.isPublicCredentialsSaveEnabled());
oldAppConfig,
appConfigProperties,
"publicCredentialsSaveEnabled",
appConfig.isPublicCredentialsSaveEnabled());
copyConfigValue(
oldAppConfig, appConfigProperties, "adminCredentialsSaveEnabled", appConfig.isAdminCredentialsSaveEnabled());
oldAppConfig,
appConfigProperties,
"adminCredentialsSaveEnabled",
appConfig.isAdminCredentialsSaveEnabled());
copyConfigValue(
oldAppConfig, appConfigProperties, "enableReverseProxyAuth", appConfig.isEnabledReverseProxyAuth());
copyConfigValue(
oldAppConfig, appConfigProperties, "forwardProxy", appConfig.isEnabledForwardProxy());
copyConfigValue(
oldAppConfig, appConfigProperties, "linkExternalCredentialsWithUser", appConfig.isLinkExternalCredentialsWithUser());
oldAppConfig,
appConfigProperties,
"linkExternalCredentialsWithUser",
appConfig.isLinkExternalCredentialsWithUser());
copyConfigValue(
oldAppConfig, appConfigProperties, "redirectOnFederatedAuth", appConfig.isRedirectOnFederatedAuth());
copyConfigValue(
oldAppConfig, appConfigProperties, CBConstants.PARAM_RESOURCE_MANAGER_ENABLED, appConfig.isResourceManagerEnabled());
oldAppConfig,
appConfigProperties,
CBConstants.PARAM_RESOURCE_MANAGER_ENABLED,
appConfig.isResourceManagerEnabled());
copyConfigValue(
oldAppConfig, appConfigProperties, CBConstants.PARAM_SHOW_READ_ONLY_CONN_INFO, appConfig.isShowReadOnlyConnectionInfo());
oldAppConfig,
appConfigProperties,
CBConstants.PARAM_SHOW_READ_ONLY_CONN_INFO,
appConfig.isShowReadOnlyConnectionInfo());
copyConfigValue(
oldAppConfig,
appConfigProperties,
@@ -1022,7 +1093,8 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
appConfig.isGrantConnectionsAccessToAnonymousTeam());
Map<String, Object> resourceQuotas = new LinkedHashMap<>();
Map<String, Object> originResourceQuotas = JSONUtils.getObject(oldAppConfig, CBConstants.PARAM_RESOURCE_QUOTAS);
Map<String, Object> originResourceQuotas = JSONUtils.getObject(oldAppConfig,
CBConstants.PARAM_RESOURCE_QUOTAS);
for (Map.Entry<String, Object> mp : appConfig.getResourceQuotas().entrySet()) {
copyConfigValue(originResourceQuotas, resourceQuotas, mp.getKey(), mp.getValue());
}
@@ -1136,7 +1208,12 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
// gets info about patterns from original configuration file and saves it to runtime config
private void copyConfigValue(Map<String, Object> oldConfig, Map<String, Object> newConfig, String key, Object defaultValue) {
private void copyConfigValue(
Map<String, Object> oldConfig,
Map<String, Object> newConfig,
String key,
Object defaultValue
) {
Object value = oldConfig.get(key);
if (value instanceof Map && defaultValue instanceof Map) {
Map<String, Object> subValue = new LinkedHashMap<>();
@@ -1167,4 +1244,24 @@ public abstract class CBApplication extends BaseWebApplication implements WebAut
}
return containerId;
}
@Nullable
public Path getSslConfigurationPath() {
if (sslConfigurationPath == null) {
return null;
}
var sslConfiguration = Path.of(sslConfigurationPath);
return sslConfiguration.isAbsolute() ? sslConfiguration : getHomeDirectory().resolve(sslConfiguration);
}
@NotNull
@Override
public Class<? extends DBPPlatform> getPlatformClass() {
return CBPlatform.class;
}
@Override
public Class<? extends DBPPlatformUI> getPlatformUIClass() {
return CBPlatformUI.class;
}
}
@@ -16,9 +16,9 @@
*/
package io.cloudbeaver.server;
import org.jkiss.dbeaver.model.auth.AuthInfo;
import io.cloudbeaver.auth.NoAuthCredentialsProvider;
import io.cloudbeaver.model.rm.local.LocalResourceController;
import io.cloudbeaver.model.session.WebAuthInfo;
import io.cloudbeaver.service.security.CBEmbeddedSecurityController;
import io.cloudbeaver.service.security.EmbeddedSecurityControllerFactory;
import org.jkiss.code.NotNull;
@@ -31,7 +31,6 @@ import org.jkiss.dbeaver.model.auth.SMCredentialsProvider;
import org.jkiss.dbeaver.model.rm.RMController;
import org.jkiss.dbeaver.model.security.SMAdminController;
import org.jkiss.dbeaver.model.security.SMController;
import org.jkiss.dbeaver.registry.BasePlatformImpl;
import org.jkiss.dbeaver.registry.LocalFileController;
import org.jkiss.dbeaver.runtime.DBWorkbench;
@@ -94,7 +93,7 @@ public class CBApplicationCE extends CBApplication {
protected void finishSecurityServiceConfiguration(
@NotNull String adminName,
@Nullable String adminPassword,
@NotNull List<WebAuthInfo> authInfoList
@NotNull List<AuthInfo> authInfoList
) throws DBException {
if (securityController instanceof CBEmbeddedSecurityController) {
((CBEmbeddedSecurityController) securityController).finishConfiguration(adminName, adminPassword, authInfoList);
@@ -28,6 +28,7 @@ public class CBConstants {
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_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";
@@ -22,8 +22,10 @@ import io.cloudbeaver.server.jobs.SessionStateJob;
import io.cloudbeaver.server.jobs.WebSessionMonitorJob;
import io.cloudbeaver.service.session.WebSessionManager;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
@@ -39,6 +41,7 @@ import org.jkiss.dbeaver.model.impl.app.DefaultCertificateStorage;
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.qm.QMRegistry;
import org.jkiss.dbeaver.model.qm.QMUtils;
import org.jkiss.dbeaver.model.runtime.AbstractJob;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.registry.BasePlatformImpl;
@@ -49,13 +52,13 @@ import org.jkiss.dbeaver.runtime.qm.QMLogFileWriter;
import org.jkiss.dbeaver.runtime.qm.QMRegistryImpl;
import org.jkiss.dbeaver.utils.ContentUtils;
import org.jkiss.dbeaver.utils.GeneralUtils;
import org.jkiss.utils.IOUtils;
import org.osgi.framework.Bundle;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@@ -67,6 +70,7 @@ public class CBPlatform extends BasePlatformImpl {
public static final String PLUGIN_ID = "io.cloudbeaver.server"; //$NON-NLS-1$
private static final Log log = Log.getLog(CBPlatform.class);
private static final String TEMP_FILE_FOLDER = "temp-sql-upload-files";
public static final String WORK_DATA_FOLDER_NAME = ".work-data";
@@ -121,7 +125,7 @@ public class CBPlatform extends BasePlatformImpl {
return WebPlatformActivator.getInstance().getPreferences();
}
private CBPlatform() {
CBPlatform() {
}
public static void setApplication(CBApplication application) {
@@ -153,12 +157,25 @@ public class CBPlatform extends BasePlatformImpl {
refreshApplicableDrivers();
refreshDisabledDriversConfig();
new WebSessionMonitorJob(this)
.scheduleMonitor();
new SessionStateJob(this)
.scheduleMonitor();
new AbstractJob("Delete temp folder") {
@Override
protected IStatus run(DBRProgressMonitor monitor) {
try {
IOUtils.deleteDirectory(getTempFolder(monitor, TEMP_FILE_FOLDER));
} catch (IOException e) {
throw new RuntimeException(e);
}
return Status.OK_STATUS;
}
}.schedule();
log.info("Web platform initialized (" + (System.currentTimeMillis() - startTime) + "ms)");
}
@@ -312,6 +329,18 @@ public class CBPlatform extends BasePlatformImpl {
log.info("Available drivers: " + applicableDrivers.stream().map(DBPDriver::getFullName).collect(Collectors.joining(",")));
}
private void refreshDisabledDriversConfig() {
CBAppConfig config = application.getAppConfiguration();
Set<String> disabledDrivers = new LinkedHashSet<>(Arrays.asList(config.getDisabledDrivers()));
for (DBPDriver driver : applicableDrivers) {
if (!driver.isEmbedded() || config.isDriverForceEnabled(driver.getFullId())) {
continue;
}
disabledDrivers.add(driver.getFullId());
}
config.setDisabledDrivers(disabledDrivers.toArray(new String[0]));
}
@NotNull
@Override
public DBFileController createFileController() {
@@ -25,4 +25,8 @@ public class CBPlatformUI extends ConsoleUserInterface {
public static final CBPlatformUI INSTANCE = new CBPlatformUI();
protected void initialize() {
// just a placeholder for injection
}
}
@@ -1,46 +0,0 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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;
import org.eclipse.core.runtime.IAdapterFactory;
import org.jkiss.dbeaver.model.app.DBPPlatform;
import org.jkiss.dbeaver.runtime.DBWorkbench;
import org.jkiss.dbeaver.runtime.ui.DBPPlatformUI;
public class WebPlatformAdapterFactory implements IAdapterFactory {
private static final Class<?>[] CLASSES = new Class[] { DBPPlatform.class, DBPPlatformUI.class };
@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (adaptableObject instanceof DBWorkbench) {
if (adapterType == DBPPlatform.class) {
return adapterType.cast(CBPlatform.getInstance());
} else if (adapterType == DBPPlatformUI.class) {
return adapterType.cast(CBPlatformUI.INSTANCE);
}
}
return null;
}
@Override
public Class<?>[] getAdapterList() {
return CLASSES;
}
}
@@ -20,9 +20,9 @@ import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.service.DBWServletHandler;
import org.jkiss.dbeaver.DBException;
import javax.servlet.Servlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Servlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
@@ -20,8 +20,8 @@ import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.service.DBWSessionHandler;
import org.jkiss.dbeaver.DBException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
public abstract class AbstractActionSessionHandler implements DBWSessionHandler {
@@ -0,0 +1,53 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.server.CBPlatform;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.runtime.VoidProgressMonitor;
import org.jkiss.dbeaver.model.websocket.WSEventHandler;
import org.jkiss.dbeaver.model.websocket.event.WSEventDeleteTempFile;
import org.jkiss.utils.IOUtils;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class WSDeleteTempFileHandler implements WSEventHandler<WSEventDeleteTempFile> {
private static final Log log = Log.getLog(WSDeleteTempFileHandler.class);
private static final String TEMP_FILE_FOLDER = "temp-sql-upload-files";
public void resetTempFolder(String sessionId) {
Path path = CBPlatform.getInstance()
.getTempFolder(new VoidProgressMonitor(), TEMP_FILE_FOLDER)
.resolve(sessionId);
if (Files.exists(path)) {
try {
IOUtils.deleteDirectory(path);
} catch (IOException e) {
log.error("Error deleting temp path", e);
}
}
}
@Override
public void handleEvent(@NotNull WSEventDeleteTempFile event) {
resetTempFolder(event.getSessionId());
}
}
@@ -0,0 +1,35 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.events;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.WorkspaceConfigEventManager;
import org.jkiss.dbeaver.model.websocket.event.WSEventType;
import org.jkiss.dbeaver.model.websocket.event.WSWorkspaceConfigurationChangedEvent;
public class WSEventHandlerWorkspaceConfigUpdate extends WSDefaultEventHandler<WSWorkspaceConfigurationChangedEvent> {
private static final Log log = Log.getLog(WSEventHandlerWorkspaceConfigUpdate.class);
@Override
public void handleEvent(@NotNull WSWorkspaceConfigurationChangedEvent event) {
String configFileName = event.getConfigFilePath();
WorkspaceConfigEventManager.fireConfigChangedEvent(configFileName);
super.handleEvent(event);
}
}
@@ -18,21 +18,18 @@ package io.cloudbeaver.server.events;
import io.cloudbeaver.model.session.BaseWebSession;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.server.CBPlatform;
import io.cloudbeaver.utils.WebAppUtils;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.security.SMObjectPermissionsGrant;
import org.jkiss.dbeaver.model.security.SMObjectType;
import org.jkiss.dbeaver.model.websocket.event.WSEventType;
import org.jkiss.dbeaver.model.websocket.event.WSProjectUpdateEvent;
import org.jkiss.dbeaver.model.websocket.event.datasource.WSDataSourceEvent;
import org.jkiss.dbeaver.model.websocket.event.datasource.WSDataSourceProperty;
import org.jkiss.dbeaver.model.websocket.event.permissions.WSObjectPermissionEvent;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class WSObjectPermissionUpdatedEventHandler extends WSDefaultEventHandler<WSObjectPermissionEvent> {
private static final Log log = Log.getLog(WSObjectPermissionUpdatedEventHandler.class);
@@ -44,24 +41,16 @@ public class WSObjectPermissionUpdatedEventHandler extends WSDefaultEventHandler
if (event.getSmObjectType() == SMObjectType.datasource && !(activeUserSession instanceof WebSession)) {
return;
}
var user = activeUserSession.getUserContext().getUser();
var objectId = event.getObjectId();
var userSubjects = new HashSet<>(Set.of(user.getTeams()));
userSubjects.add(user.getUserId());
var smController = CBPlatform.getInstance().getApplication().getSecurityController();
var shouldBeAccessible = smController.getObjectPermissionGrants(event.getObjectId(), event.getSmObjectType())
.stream()
.map(SMObjectPermissionsGrant::getSubjectId)
.anyMatch(userSubjects::contains);
boolean isAccessibleNow;
switch (event.getSmObjectType()) {
case project:
var accessibleProjectIds = activeUserSession.getUserContext().getAccessibleProjectIds();
isAccessibleNow = accessibleProjectIds.contains(objectId);
if (shouldBeAccessible && !isAccessibleNow) {
// adding project to session cache
if (WSEventType.OBJECT_PERMISSIONS_UPDATED.getEventId().equals(event.getId())) {
var accessibleProjectIds = activeUserSession.getUserContext().getAccessibleProjectIds();
if (accessibleProjectIds.contains(event.getObjectId())) {
return;
}
activeUserSession.addSessionProject(objectId);
activeUserSession.addSessionEvent(
WSProjectUpdateEvent.create(
@@ -70,8 +59,7 @@ public class WSObjectPermissionUpdatedEventHandler extends WSDefaultEventHandler
objectId
)
);
} else if (!shouldBeAccessible && isAccessibleNow) {
// removing project from session cache
} else if (WSEventType.OBJECT_PERMISSIONS_DELETED.getEventId().equals(event.getId())) {
activeUserSession.removeSessionProject(objectId);
activeUserSession.addSessionEvent(
WSProjectUpdateEvent.delete(
@@ -80,19 +68,23 @@ public class WSObjectPermissionUpdatedEventHandler extends WSDefaultEventHandler
objectId
)
);
};
}
break;
case datasource:
var webSession = (WebSession) activeUserSession;
var dataSources = List.of(objectId);
var project = webSession.getProjectById(WebAppUtils.getGlobalProjectId());
if (project == null) {
log.error("Project " + WebAppUtils.getGlobalProjectId() +
" is not found in session " + activeUserSession.getSessionId());
return;
}
isAccessibleNow = webSession.findWebConnectionInfo(objectId) != null;
var dataSources = List.of(objectId);
if (shouldBeAccessible && !isAccessibleNow) {
if (WSEventType.OBJECT_PERMISSIONS_UPDATED.getEventId().equals(event.getId())) {
isAccessibleNow = webSession.findWebConnectionInfo(objectId) != null;
if (isAccessibleNow) {
return;
}
webSession.addAccessibleConnectionToCache(objectId);
webSession.addSessionEvent(
WSDataSourceEvent.create(
@@ -103,7 +95,7 @@ public class WSObjectPermissionUpdatedEventHandler extends WSDefaultEventHandler
WSDataSourceProperty.CONFIGURATION
)
);
} else if (!shouldBeAccessible && isAccessibleNow) {
} else if (WSEventType.OBJECT_PERMISSIONS_DELETED.getEventId().equals(event.getId())) {
webSession.removeAccessibleConnectionFromCache(objectId);
webSession.addSessionEvent(
WSDataSourceEvent.delete(
@@ -0,0 +1,29 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2023 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.server.CBPlatform;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.websocket.WSEventHandler;
import org.jkiss.dbeaver.model.websocket.event.WSUserDeletedEvent;
public class WSUserDeletedEventHandler<EVENT extends WSUserDeletedEvent> implements WSEventHandler<EVENT> {
@Override
public void handleEvent(@NotNull EVENT event) {
CBPlatform.getInstance().getSessionManager().closeUserSessions(event.getDeletedUserId());
}
}
@@ -31,15 +31,17 @@ import io.cloudbeaver.WebServiceUtils;
import io.cloudbeaver.model.session.WebSession;
import io.cloudbeaver.registry.WebServiceRegistry;
import io.cloudbeaver.server.CBApplication;
import io.cloudbeaver.server.HttpConstants;
import io.cloudbeaver.service.DBWServiceBindingGraphQL;
import io.cloudbeaver.service.WebServiceBindingBase;
import org.jkiss.dbeaver.Log;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.IOUtils;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -152,6 +154,14 @@ public class GraphQLEndpoint extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String contentType = request.getContentType();
if (CommonUtils.isEmpty(contentType) || !contentType.startsWith(HttpConstants.TYPE_JSON)) {
String error = "Bad request," + (CommonUtils.isEmpty(contentType)
? " content type is missing"
: " incorrect content type:" + contentType);
response.sendError(400, error);
return;
}
String postBody = IOUtils.readToString(request.getReader());
JsonElement json = gson.fromJson(postBody, JsonElement.class);
if (json instanceof JsonArray) {
@@ -33,7 +33,9 @@ import org.eclipse.jetty.servlet.ErrorPageErrorHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlet.ServletMapping;
import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;
import org.eclipse.jetty.xml.XmlConfiguration;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
@@ -71,11 +73,25 @@ public class CBJettyServer {
JettyServer server;
int serverPort = application.getServerPort();
String serverHost = application.getServerHost();
if (CommonUtils.isEmpty(serverHost)) {
server = new JettyServer(serverPort);
Path sslPath = application.getSslConfigurationPath();
boolean sslConfigurationExists = sslPath != null && Files.exists(sslPath);
if (sslConfigurationExists) {
server = new JettyServer();
XmlConfiguration sslConfiguration = new XmlConfiguration(new PathResource(sslPath));
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
// method sslConfiguration.configure() does not see the context class of the Loader,
// so we have to configure it manually, then return the old classLoader.
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
sslConfiguration.configure(server);
Thread.currentThread().setContextClassLoader(classLoader);
} else {
server = new JettyServer(
InetSocketAddress.createUnresolved(serverHost, serverPort));
if (CommonUtils.isEmpty(serverHost)) {
server = new JettyServer(serverPort);
} else {
server = new JettyServer(
InetSocketAddress.createUnresolved(serverHost, serverPort));
}
}
{
@@ -112,8 +128,6 @@ public class CBJettyServer {
server.setHandler(servletContextHandler);
var serverConnector = new ServerConnector(server);
server.addConnector(serverConnector);
JettyWebSocketServletContainerInitializer.configure(servletContextHandler,
(context, wsContainer) -> {
wsContainer.setIdleTimeout(Duration.ofMinutes(5));
@@ -205,11 +219,14 @@ public class CBJettyServer {
servletContextHandler.setSessionHandler(sessionHandler);
}
private static class JettyServer extends Server {
public static class JettyServer extends Server {
public JettyServer(int serverPort) {
super(serverPort);
}
public JettyServer() {
super();
}
public JettyServer(InetSocketAddress addr) {
super(addr);
}
@@ -22,7 +22,7 @@ import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.jkiss.dbeaver.DBException;
import javax.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServlet;
public class CBJettyServletContext implements DBWServletContext {
private final ServletContextHandler contextHandler;
@@ -19,9 +19,9 @@ package io.cloudbeaver.server.jetty;
import io.cloudbeaver.server.CBApplication;
import io.cloudbeaver.server.CBConstants;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.SessionCookieConfig;
import jakarta.servlet.ServletContextEvent;
import jakarta.servlet.ServletContextListener;
import jakarta.servlet.SessionCookieConfig;
public class CBServerContextListener implements ServletContextListener {
@@ -83,31 +83,31 @@ public class SqlOutputLogReaderJob extends AbstractJob {
private void dumpOutput(DBRProgressMonitor monitor) {
if (!monitor.isCanceled()) {
if (dbcServerOutputReader.isAsyncOutputReadSupported()) {
try {
if (!dbcStatement.isStatementClosed()) {
List<WSOutputLogInfo> messages = new ArrayList<>();
dbcServerOutputReader.readServerOutput(monitor, dbcExecutionContext, null, dbcStatement, new DBCOutputWriter() {
@Override
public void println(@Nullable DBCOutputSeverity severity, @Nullable String message) {
if (message != null && severity != null) {
messages.add(new WSOutputLogInfo(severity.getName(), message));
}
}
@Override
public void flush() {
messages.clear();
}
});
webSession.addSessionEvent(new WSOutputDBLogEvent(
contextInfoId,
messages,
System.currentTimeMillis()));
List<WSOutputLogInfo> messages = new ArrayList<>();
final DBCOutputWriter writer = new DBCOutputWriter() {
@Override
public void println(@Nullable DBCOutputSeverity severity, @Nullable String message) {
if (message != null) {
messages.add(new WSOutputLogInfo(severity == null ? null : severity.getName(), message));
}
} catch (DBCException e) {
log.error(e);
}
@Override
public void flush() {
messages.clear();
}
};
try {
dbcServerOutputReader.readServerOutput(monitor, dbcExecutionContext, null, null, writer);
if (dbcServerOutputReader.isAsyncOutputReadSupported() && !dbcStatement.isStatementClosed()) {
dbcServerOutputReader.readServerOutput(monitor, dbcExecutionContext, null, dbcStatement, writer);
}
webSession.addSessionEvent(new WSOutputDBLogEvent(
contextInfoId,
messages,
System.currentTimeMillis()));
} catch (DBCException e) {
log.error(e);
}
}
}
@@ -5,10 +5,10 @@ import org.jkiss.dbeaver.Log;
import org.jkiss.utils.CommonUtils;
import org.jkiss.utils.IOUtils;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -47,10 +47,10 @@ import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Enumeration;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = "/")
public class CBStaticServlet extends DefaultServlet {
@@ -7,10 +7,10 @@ import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.data.json.JSONUtils;
import org.jkiss.dbeaver.utils.GeneralUtils;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -101,7 +101,6 @@ public class CBEventsWebSocket extends CBAbstractWebSocket implements CBWebSessi
public void handleWebSessionEvent(WSEvent event) {
super.handleEvent(event);
}
@Override
protected void handleEventException(Exception e) {
super.handleEventException(e);
@@ -29,7 +29,7 @@ import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.security.exception.SMAccessTokenExpiredException;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.List;

Some files were not shown because too many files have changed in this diff Show More