Skip to content

Commit

Permalink
Merge branch 'devel' into dbeaver/pro#2403-gs-auth-model
Browse files Browse the repository at this point in the history
  • Loading branch information
kseniaguzeeva authored Feb 6, 2024
2 parents aaa295c + 98d7d1f commit 3ea19dc
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 17 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ You can see live demo of CloudBeaver here: https://demo.cloudbeaver.io

## Changelog

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

### 23.3.3. 2024-01-22
- Added password policy for the local authorization. Password parameters can be set in the configuration file;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ALTER TABLE {table_prefix}CB_AUTH_TOKEN ADD COLUMN AUTH_ROLE VARCHAR(32);
ALTER TABLE {table_prefix}CB_AUTH_TOKEN ADD AUTH_ROLE VARCHAR(32);

ALTER TABLE {table_prefix}CB_USER ADD COLUMN DEFAULT_AUTH_ROLE VARCHAR(32) NULL;
ALTER TABLE {table_prefix}CB_USER ADD DEFAULT_AUTH_ROLE VARCHAR(32) NULL;

CREATE TABLE {table_prefix}CB_TEAM
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE {table_prefix}CB_USER_SECRETS
ADD COLUMN ENCODING_TYPE VARCHAR(32) DEFAULT 'PLAINTEXT' NOT NULL;
ADD ENCODING_TYPE VARCHAR(32) DEFAULT 'PLAINTEXT' NOT NULL;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE {table_prefix}CB_AUTH_ATTEMPT
ADD COLUMN IS_MAIN_AUTH CHAR(1) DEFAULT 'Y' NOT NULL;
ADD IS_MAIN_AUTH CHAR(1) DEFAULT 'Y' NOT NULL;
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE {table_prefix}CB_AUTH_ATTEMPT
ADD COLUMN AUTH_USERNAME VARCHAR(128) NULL;
ADD AUTH_USERNAME VARCHAR(128) NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ SELECT USER_ID, SECRET_ID, SECRET_VALUE, ENCODING_TYPE, UPDATE_TIME, UPDATE_TIME
DROP TABLE {table_prefix}CB_USER_SECRETS;

ALTER TABLE {table_prefix}CB_AUTH_SUBJECT
ADD COLUMN IS_SECRET_STORAGE CHAR(1) DEFAULT 'Y' NOT NULL;
ADD IS_SECRET_STORAGE CHAR(1) DEFAULT 'Y' NOT NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -1410,10 +1410,12 @@ private String createNewAuthAttempt(
String authAttemptId = UUID.randomUUID().toString();
try (Connection dbCon = database.openConnection()) {
try (JDBCTransaction txn = new JDBCTransaction(dbCon)) {
if (smConfig.isCheckBruteforce()
&& this.getAuthProvider(authProviderId).getInstance() instanceof SMBruteForceProtected bruteforceProtected) {
BruteForceUtils.checkBruteforce(smConfig,
getLatestUserLogins(dbCon, authProviderId, bruteforceProtected.getInputUsername(authData).toString()));
if (smConfig.isCheckBruteforce() && this.getAuthProvider(authProviderId).getInstance() instanceof SMBruteForceProtected bruteforceProtected) {
Object inputUsername = bruteforceProtected.getInputUsername(authData);
if (inputUsername != null) {
BruteForceUtils.checkBruteforce(smConfig,
getLatestUserLogins(dbCon, authProviderId, inputUsername.toString()));
}
}
try (PreparedStatement dbStat = dbCon.prepareStatement(
database.normalizeTableNames(
Expand All @@ -1435,7 +1437,12 @@ private String createNewAuthAttempt(
}
dbStat.setString(7, isMainSession ? CHAR_BOOL_TRUE : CHAR_BOOL_FALSE);
if (this.getAuthProvider(authProviderId).getInstance() instanceof SMBruteForceProtected bruteforceProtected) {
dbStat.setString(8, bruteforceProtected.getInputUsername(authData).toString());
Object inputUsername = bruteforceProtected.getInputUsername(authData);
if (inputUsername != null) {
dbStat.setString(8, inputUsername.toString());
} else {
dbStat.setString(8, null);
}
} else {
dbStat.setString(8, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public class CBDatabase {
public static final String SCHEMA_UPDATE_SQL_PATH = "db/cb_schema_update_";

private static final int LEGACY_SCHEMA_VERSION = 1;
private static final int CURRENT_SCHEMA_VERSION = 17;
private static final int CURRENT_SCHEMA_VERSION = 16;

private static final String DEFAULT_DB_USER_NAME = "cb-data";
private static final String DEFAULT_DB_PWD_FILE = ".database-credentials.dat";
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/plugin-sql-editor/src/SqlEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export const SqlEditor = observer<Props>(function SqlEditor({ state }) {
<Loader suspense>
<CaptureView className={s(styles, { captureView: true })} view={sqlEditorView}>
<Split {...splitState} split="horizontal" sticky={30}>
<Pane className={s(styles, { pane: true })}>
<Pane className={s(styles, { pane: true })} basis="50%" main>
<SqlEditorLoader state={state} />
</Pane>
<ResizerControls />
<Pane className={s(styles, { pane: true })} basis="50%" main>
<Pane className={s(styles, { pane: true })}>
<Loader suspense>
<SqlResultTabs state={state} />
</Loader>
Expand Down
5 changes: 2 additions & 3 deletions webapp/packages/plugin-sql-editor/src/SqlEditor/SqlEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ export const SqlEditor = observer<ISqlEditorProps>(function SqlEditor({ state, c

useEffect(() => {
if (isEditorEmpty) {
split.fixate('maximize', true);
split.state.setDisable(true);
} else if (split.state.disable) {
split.fixate('resize', false);
split.state.setSize(-1);
split.state.setDisable(false);
}
}, [isEditorEmpty]);

Expand Down

0 comments on commit 3ea19dc

Please sign in to comment.