Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel' into fix/cb-5749/metadata…
Browse files Browse the repository at this point in the history
…-table-loading
  • Loading branch information
Wroud committed Oct 11, 2024
2 parents cc946a6 + eb41e61 commit b182c04
Show file tree
Hide file tree
Showing 57 changed files with 2,947 additions and 2,991 deletions.
7 changes: 4 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ currently being supported with security updates.
| ------- | --------- |
| 22.x | yes |
| 23.x | yes |
| 24.x | yes |

## Reporting a Vulnerability

Please report (suspected) security vulnerabilities to [email protected].
You will receive a response from us within 48 hours.
If the issue is confirmed, we will release a patch as soon as possible depending on complexity but historically within a few days.
Please report (suspected) security vulnerabilities to [email protected].
You will receive a response from us within 48 hours.
If the issue is confirmed, we will release a patch as soon as possible, depending on complexity, but historically, within a few days.
24 changes: 2 additions & 22 deletions config/GlobalConfiguration/.dbeaver/data-sources.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
{
"folders": {},
"connections": {
"postgresql-template-1": {
"provider": "postgresql",
"driver": "postgres-jdbc",
"name": "PostgreSQL (Template)",
"save-password": false,
"show-system-objects": false,
"read-only": true,
"template": true,
"configuration": {
"host": "localhost",
"port": "5432",
"database": "postgres",
"url": "jdbc:postgresql://localhost:5432/postgres",
"type": "dev",
"provider-properties": {
"@dbeaver-show-non-default-db@": "false"
}
}
}
}
"folders": {},
"connections": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public Gson getGson() {
return getGsonBuilder().create();
}

@NotNull
protected abstract GsonBuilder getGsonBuilder();

public abstract T getServerConfiguration();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
import com.google.gson.Strictness;
import io.cloudbeaver.model.WebConnectionConfig;
import io.cloudbeaver.model.WebNetworkHandlerConfigInput;
import io.cloudbeaver.model.WebPropertyInfo;
Expand Down Expand Up @@ -294,7 +295,7 @@ public static void saveAuthProperties(
// Make new Gson parser with type adapters to deserialize into existing credentials
InstanceCreator<DBAAuthCredentials> credTypeAdapter = type -> credentials;
Gson credGson = new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.registerTypeAdapter(credentials.getClass(), credTypeAdapter)
.create();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
*/
package io.cloudbeaver.server;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.InstanceCreator;
import com.google.gson.*;
import io.cloudbeaver.model.app.BaseServerConfigurationController;
import io.cloudbeaver.model.app.BaseWebApplication;
import io.cloudbeaver.model.config.CBAppConfig;
Expand Down Expand Up @@ -326,6 +324,7 @@ public Map<String, Object> readConfigurationFile(Path path) throws DBException {
}
}

@NotNull
protected GsonBuilder getGsonBuilder() {
// Stupid way to populate existing objects but ok google (https://github.com/google/gson/issues/431)
InstanceCreator<CBAppConfig> appConfigCreator = type -> appConfiguration;
Expand All @@ -336,7 +335,8 @@ protected GsonBuilder getGsonBuilder() {
InstanceCreator<PasswordPolicyConfiguration> smPasswordPoliceConfigCreator =
type -> securityManagerConfiguration.getPasswordPolicyConfiguration();
return new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.setObjectToNumberStrategy(ToNumberPolicy.LONG_OR_DOUBLE)
.registerTypeAdapter(getServerConfiguration().getClass(), serverConfigCreator)
.registerTypeAdapter(CBAppConfig.class, appConfigCreator)
.registerTypeAdapter(DataSourceNavigatorSettings.class, navSettingsCreator)
Expand Down Expand Up @@ -372,7 +372,7 @@ private synchronized void writeRuntimeConfig(Path runtimeConfigPath, Map<String,

try (Writer out = new OutputStreamWriter(Files.newOutputStream(runtimeConfigPath), StandardCharsets.UTF_8)) {
Gson gson = new GsonBuilder()
.setLenient()
.setStrictness(Strictness.LENIENT)
.setPrettyPrinting()
.create();
gson.toJson(configurationProperties, out);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void savePasswordPolicyConfig(Map<String, Object> originServerConfig, Ma
}
}

@NotNull
@Override
protected GsonBuilder getGsonBuilder() {
GsonBuilder gsonBuilder = super.getGsonBuilder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.Strictness;
import io.cloudbeaver.auth.provider.local.LocalAuthProviderConstants;
import io.cloudbeaver.model.app.WebApplication;
import io.cloudbeaver.model.config.WebDatabaseConfig;
Expand Down Expand Up @@ -301,7 +302,9 @@ CBDatabaseInitialData getInitialData() throws DBException {
initialDataPath = WebAppUtils.getRelativePath(
databaseConfiguration.getInitialDataConfiguration(), application.getHomeDirectory());
try (Reader reader = new InputStreamReader(new FileInputStream(initialDataPath), StandardCharsets.UTF_8)) {
Gson gson = new GsonBuilder().setLenient().create();
Gson gson = new GsonBuilder()
.setStrictness(Strictness.LENIENT)
.create();
return gson.fromJson(reader, CBDatabaseInitialData.class);
} catch (Exception e) {
throw new DBException("Error loading initial data configuration", e);
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@testing-library/user-event": "^14",
"@types/react": "^18",
"@types/react-dom": "^18",
"concurrently": "^8",
"concurrently": "^9",
"husky": "^9",
"lerna": "^5",
"mobx": "^6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
}

.dialogBodyContent {
composes: theme-typography--body1 from global;
flex: 1;
letter-spacing: normal;
position: relative;
display: flex;
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
}

.headerTitle {
composes: theme-typography--headline6 from global;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/src/FormControls/Filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const Filter = observer<ControlledProps | ObjectsProps<any, any>>(functio
autoComplete="off"
className={s(styles, { inputField: true })}
placeholder={placeholder}
disabled={disabled}
readOnly={disabled}
name={name}
value={value}
onChange={handleChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,8 @@
align-items: center;
justify-content: center;
}

.input[disabled] + .iconContainer {
cursor: auto;
opacity: 0.8;
}
.input:not(:only-child) {
padding-right: 32px !important;
Expand Down
7 changes: 7 additions & 0 deletions webapp/packages/core-blocks/src/InfoItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@
align-items: center;
flex: 0 0 auto;
}

.iconOrImage {
width: 24px;
height: 24px;
margin-right: 16px;

&.compact {
width: 18px;
height: 18px;
margin-right: 8px;
}
}
5 changes: 3 additions & 2 deletions webapp/packages/core-blocks/src/InfoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ import { useS } from './useS.js';
export interface IInfoItem {
info: TLocalizationToken;
icon?: string;
compact?: boolean;
}

interface Props extends IInfoItem {
className?: string;
}

export const InfoItem = observer<Props>(function InfoItem({ info, icon = '/icons/info_icon.svg', className }) {
export const InfoItem = observer<Props>(function InfoItem({ info, compact, icon = '/icons/info_icon.svg', className }) {
const styles = useS(style);

const translate = useTranslate();
return (
<div className={s(styles, { infoItem: true }, className)}>
<IconOrImage className={s(styles, { iconOrImage: true })} icon={icon} />
<IconOrImage className={s(styles, { iconOrImage: true, compact })} icon={icon} />
{translate(info)}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
placeholder={passwordSavedMessage}
name={property.id!}
value={value}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
className={className}
>
{property.displayName ?? ''}
Expand All @@ -243,8 +242,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
autoHide={autoHide}
description={property.hint}
placeholder={passwordSavedMessage}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`}
className={className}
canShowPassword={canShowPassword}
Expand All @@ -266,8 +264,7 @@ export const RenderField = observer<RenderFieldProps>(function RenderField({
defaultValue={defaultValue}
description={property.hint}
placeholder={passwordSavedMessage}
disabled={disabled}
readOnly={readOnly}
readOnly={readOnly || disabled}
autoComplete={RESERVED_KEYWORDS.includes(autofillToken) ? autofillToken : `${autofillToken} ${property.id}`}
className={className}
canShowPassword={canShowPassword}
Expand Down
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ export default [

['core_connections_settings_disable', 'Отключить'],
['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'],
['connections_templates_deprecated_message', 'Шаблоны подключений больше не поддерживаются и будут удалены в будущих релизах'],
];
8 changes: 3 additions & 5 deletions webapp/packages/core-connections/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export default [
['connections_connection_authentication_save_credentials_for_session', '当前会话不再询问'],
['connections_connection_authentication_save_credentials_for_session_tooltip', '注销后将移除凭证'],
['connections_connection_edit_save_credentials_shared', '为所有访问用户保存凭证'],
[
'connections_connection_edit_save_credentials_shared_tooltip',
'凭证将用于为所有访问用户自动连接数据库',
],
['connections_connection_edit_save_credentials_shared_tooltip', '凭证将用于为所有访问用户自动连接数据库'],
['connections_connection_share_credentials', '分享凭证至团队'],
['connections_connection_share_credentials_tooltip', '凭证将用于为所有团队用户自动连接数据库'],
['connections_connection_credentials_provisioning', '认证凭据'],
Expand All @@ -52,7 +49,7 @@ export default [
['connections_connection_edit_search_hosts', '主机名称'],
['connections_connection_address', '地址'],
['connections_connection_folder', '文件夹'],
['connections_connection_folder_validation', "文件夹名称不得包含以下符号 / : \" \\ ' <> | ? * 且不能以点开头"],
['connections_connection_folder_validation', '文件夹名称不得包含以下符号 / : " \\ \' <> | ? * 且不能以点开头'],
['connections_connection_name', '连接名称'],
['connections_connection_access_admin_info', '管理员可以查看除其他用户的私有连接之外的所有连接。'],
['connections_connection_description', '描述'],
Expand Down Expand Up @@ -95,4 +92,5 @@ export default [

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
['connections_templates_deprecated_message', 'Template connections are deprecated and will be removed in future releases'],
];
2 changes: 1 addition & 1 deletion webapp/packages/core-theming/src/styles/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ $mdc-checkbox-icon-size: 16px;
@extend .mdc-checkbox__native-control;

&:disabled {
opacity: 0;
opacity: 0 !important;
}
}
.theme-checkbox__background {
Expand Down
15 changes: 4 additions & 11 deletions webapp/packages/core-theming/src/styles/_form-controls.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,26 +73,19 @@
@include mdc-theme-prop(border-color, primary, false);
}

&:not([data-select='true'])[readonly] {
&:not([data-select='true'])[readonly],
&:not([data-select='true'])[disabled] {
@include mdc-theme-prop(color, input-color-readonly, false);
@include mdc-theme-prop(border-color, input-border-readonly, false);
@include mdc-theme-prop(background-color, input-background-readonly, false);
opacity: 1;
cursor: text;
pointer-events: all;
&:-internal-autofill-selected,
&:-internal-autofill-previewed {
box-shadow: 0 0 0 50px $input-background-readonly inset;
}
}
&[disabled] {
@include mdc-theme-prop(color, input-color-disabled, false);
@include mdc-theme-prop(border-color, input-border-disabled, false);
@include mdc-theme-prop(background-color, input-background-disabled, false);
opacity: 1;
&:-internal-autofill-selected,
&:-internal-autofill-previewed {
box-shadow: 0 0 0 50px $input-background-disabled inset;
}
}
&[data-embedded='true'] {
&[disabled],
&:not([data-select='true'])[readonly] {
Expand Down
6 changes: 3 additions & 3 deletions webapp/packages/core-theming/src/styles/_theme-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ $input-color-readonly: darken($input-color, 5%);
$input-border: #585958;
$input-border-disabled: darken($input-border, 10%);
$input-border-readonly: darken($input-border, 5%);
$input-background: $mdc-theme-secondary;
$input-background-disabled: $input-background;
$input-background-readonly: $input-background;
$input-background: $mdc-theme-surface;
$input-background-disabled: #3e3e3e;
$input-background-readonly: #3e3e3e;

$mdc-theme-text-colors: (
dark: (
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-theming/src/styles/main/color.pure.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* you may not use this file except in compliance with the License.
*/

:disabled, [aria-disabled="true"] {
:disabled,
[aria-disabled='true'] {
pointer-events: none;
cursor: default;
opacity: 0.5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export const TeamOptions: TabContainerPanelComponent<ITeamFormProps> = observer(
return (
<Container overflow>
<Group small gap>
<InputField name="teamId" state={state.config} readOnly={state.readonly || edit} disabled={state.disabled} required tiny fill>
<InputField name="teamId" state={state.config} readOnly={state.readonly || edit || state.disabled} required tiny fill>
{translate('administration_teams_team_id')}
</InputField>
<InputField name="teamName" state={state.config} readOnly={state.readonly} disabled={state.disabled} tiny fill>
<InputField name="teamName" state={state.config} readOnly={state.readonly || state.disabled} tiny fill>
{translate('administration_teams_team_name')}
</InputField>
<Textarea name="description" state={state.config} readOnly={state.readonly} disabled={state.disabled} tiny fill>
<Textarea name="description" state={state.config} readOnly={state.readonly || state.disabled} tiny fill>
{translate('administration_teams_team_description')}
</Textarea>
</Group>
Expand Down
Loading

0 comments on commit b182c04

Please sign in to comment.