mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
Dbeaver/pro#5168 avoid leakage of lincense (#3343)
* dbeaver/pro#5168 avoid leakage of license * dbeaver/pro#5168 avoid leakage of license * dbeaver/pro#5168 avoid leakage of license * dbeaver/pro#5168 avoid leakage of license * CB-5168 fix schema * [#113] Add clsx dependency to UI kit (#3335) * chore: add clsx dependency to ui-kit * chore: import clsx from ui-kit * refactor: use clsx for class management in Button * refactor: use clsx in Checkbox * refactor: use clsx in Input component * feat: use clsx in radio and radiogroup * feat: use clsx in Select component * feat: reexport VisuallyHidden and Focus trap components from ariakit * CB-5839 fix: resource blocking (#3199) * CB-5839 fix: resource blocking * CB-5839 fix: unlock nav resources * fix: connections loading * feat: select new folder or connection * chore: localization * chore: revert improvements * fix: load connections list for connection selector * fix: error * fix: wrong action handler * CB-5839 fix: resources tree validation * fix: reaction concurrency * CB-5839 fixes build for new CellFormatter (ObjectMenuCell) after merge conflicts * СB-5839 changes delay for menu item loaders * CB-5839 fix: keys intersection detection in resources * CB-5839 fix: keys intersection detection in resources --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com> Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> Co-authored-by: sergeyteleshev <iamsergeyteleshev@gmail.com> Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> * CB-6308 fix: grid auto-size (#3298) * CB-6308 fix: grid auto-size * CB-6308 fix: grid auto size * CB-6308 fix: icons sizing in grid * CB-6308 fix: grid header * CB-6308 fix: types * fix: min-width for columns --------- Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com> Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> * CB 6296 Delete row shortcut not working (#3340) * CB-6296 fix: delete keystroke marks selected row for deletion * CB-6296 fix: focus first element on load, remove extra handler It was noticed that just after the open, onKeyDown event doesn't reach DataGrid, because focus was not in sync with lib. Also fixes CB-6229 since they have the same root problem with encountered bag * CB-6286 refactor: change onCellKeyDown handler interface inside DataGridProps * CB-6296 refactor: set initial focus differently * CB-6296 refactor: remove manual scroll control We use grid inner scrollToCell method and don't need additional native scrolling * refactor: don't expose inner data-grid type --------- Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> Co-authored-by: Alexey <wrouds@gmail.com> * CB-5168 fix * CB-5168 fix schema * dbeaver#pro5168 hide product config for anonym * dbeaver/pro#5168 avoid leakage of lincense * dbeaver/pro#5168 avoid leakage of lincense * dbeaver/pro#5168 avoid leakage of lincense --------- Co-authored-by: Sychev Andrey <44414066+SychevAndrey@users.noreply.github.com> Co-authored-by: Alexey <wrouds@gmail.com> Co-authored-by: mr-anton-t <42037741+mr-anton-t@users.noreply.github.com> Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> Co-authored-by: sergeyteleshev <iamsergeyteleshev@gmail.com> Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> Co-authored-by: naumov <iamemptyhuh@gmail.com>
This commit is contained in:
co-authored by
Evgenia
Alexey
Sychev Andrey
mr-anton-t
Daria Marutkina
sergeyteleshev
naumov
parent
873861c759
commit
dfbb2846a5
@@ -32,6 +32,12 @@ import java.util.Date;
|
||||
*/
|
||||
public class WebProductInfo {
|
||||
|
||||
private final boolean provideSensitiveInformation;
|
||||
|
||||
public WebProductInfo(boolean provideSensitiveInformation) {
|
||||
this.provideSensitiveInformation = provideSensitiveInformation;
|
||||
}
|
||||
|
||||
@Property
|
||||
public String getId() {
|
||||
return CommonUtils.notEmpty(Platform.getProduct().getId());
|
||||
@@ -68,7 +74,9 @@ public class WebProductInfo {
|
||||
|
||||
@Property
|
||||
public String getLicenseInfo() {
|
||||
return ServletAppUtils.getServletApplication().getInfoDetails(new VoidProgressMonitor());
|
||||
return provideSensitiveInformation
|
||||
? ServletAppUtils.getServletApplication().getInfoDetails(new VoidProgressMonitor())
|
||||
: "";
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -83,4 +91,5 @@ public class WebProductInfo {
|
||||
return CommonUtils.notEmpty(product.getProperty("productPurchaseURL"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import java.util.Map;
|
||||
public class WebServerConfig {
|
||||
|
||||
private final WebApplication application;
|
||||
private boolean provideSensitiveInformation = true;
|
||||
|
||||
public WebServerConfig(@NotNull WebApplication application) {
|
||||
this.application = application;
|
||||
@@ -92,7 +93,7 @@ public class WebServerConfig {
|
||||
|
||||
@Property
|
||||
public String getLicenseStatus() {
|
||||
return application.getLicenseStatus();
|
||||
return provideSensitiveInformation ? application.getLicenseStatus() : "";
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -168,7 +169,7 @@ public class WebServerConfig {
|
||||
|
||||
@Property
|
||||
public WebProductInfo getProductInfo() {
|
||||
return new WebProductInfo();
|
||||
return new WebProductInfo(provideSensitiveInformation);
|
||||
}
|
||||
|
||||
@Property
|
||||
@@ -180,4 +181,8 @@ public class WebServerConfig {
|
||||
public Boolean isDistributed() {
|
||||
return application.isDistributed();
|
||||
}
|
||||
|
||||
public void setProvideSensitiveInformation(boolean provideSensitiveInformation) {
|
||||
this.provideSensitiveInformation = provideSensitiveInformation;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ import java.util.Map;
|
||||
public interface DBWServiceCore extends DBWService {
|
||||
|
||||
@WebAction(authRequired = false, initializationRequired = false)
|
||||
WebServerConfig getServerConfig() throws DBWebException;
|
||||
WebServerConfig getServerConfig(@Nullable WebSession webSession) throws DBWebException;
|
||||
|
||||
/**
|
||||
* Returns information of system.
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class WebServiceBindingCore extends WebServiceBindingBase<DBWServiceCore>
|
||||
public void bindWiring(DBWBindingContext model) throws DBWebException {
|
||||
WebAppSessionManager sessionManager = WebAppUtils.getWebApplication().getSessionManager();
|
||||
model.getQueryType()
|
||||
.dataFetcher("serverConfig", env -> getService(env).getServerConfig())
|
||||
.dataFetcher("serverConfig", env -> getService(env).getServerConfig(findWebSession(env)))
|
||||
.dataFetcher("systemInfo", env -> getService(env).getSystemInformationProperties(getWebSession(env)))
|
||||
.dataFetcher("productSettings", env -> getService(env).getProductSettings(getWebSession(env)))
|
||||
|
||||
|
||||
+5
-2
@@ -69,8 +69,11 @@ public class WebServiceCore implements DBWServiceCore {
|
||||
private static final Log log = Log.getLog(WebServiceCore.class);
|
||||
|
||||
@Override
|
||||
public WebServerConfig getServerConfig() {
|
||||
return WebAppUtils.getWebApplication().getWebServerConfig();
|
||||
public WebServerConfig getServerConfig(@Nullable WebSession webSession) {
|
||||
WebServerConfig webServerConfig = WebAppUtils.getWebApplication().getWebServerConfig();
|
||||
webServerConfig.setProvideSensitiveInformation(webServerConfig.isConfigurationMode() ||
|
||||
(webSession != null && webSession.getUser() != null));
|
||||
return webServerConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -9,7 +9,7 @@ import { injectable } from '@cloudbeaver/core-di';
|
||||
import { CachedDataResource } from '@cloudbeaver/core-resource';
|
||||
import { GraphQLService, type ProductInfoFragment } from '@cloudbeaver/core-sdk';
|
||||
|
||||
import { ServerConfigResource } from './ServerConfigResource.js';
|
||||
import { SessionDataResource } from './SessionDataResource.js';
|
||||
|
||||
export type ProductInfo = ProductInfoFragment['productInfo'];
|
||||
|
||||
@@ -17,10 +17,10 @@ export type ProductInfo = ProductInfoFragment['productInfo'];
|
||||
export class ProductInfoResource extends CachedDataResource<ProductInfo | null> {
|
||||
constructor(
|
||||
private readonly graphQLService: GraphQLService,
|
||||
serverConfigResource: ServerConfigResource,
|
||||
sessionDataResource: SessionDataResource,
|
||||
) {
|
||||
super(() => null, undefined, []);
|
||||
this.sync(serverConfigResource);
|
||||
this.sync(sessionDataResource);
|
||||
}
|
||||
|
||||
protected async loader(): Promise<ProductInfo> {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
"validate-dependencies": "core-cli-validate-dependencies"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cloudbeaver/core-authentication": "workspace:*",
|
||||
"@cloudbeaver/core-blocks": "workspace:*",
|
||||
"@cloudbeaver/core-di": "workspace:*",
|
||||
"@cloudbeaver/core-dialogs": "workspace:*",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -10,6 +10,7 @@ import { Bootstrap, injectable } from '@cloudbeaver/core-di';
|
||||
import { CommonDialogService } from '@cloudbeaver/core-dialogs';
|
||||
import { ProductInfoResource } from '@cloudbeaver/core-root';
|
||||
import { MenuBaseItem, MenuService } from '@cloudbeaver/core-view';
|
||||
import { UserInfoResource } from '@cloudbeaver/core-authentication';
|
||||
import { TOP_NAV_BAR_SETTINGS_MENU } from '@cloudbeaver/plugin-settings-menu';
|
||||
|
||||
const ProductInfoDialog = importLazyComponent(() => import('./ProductInfoDialog.js').then(m => m.ProductInfoDialog));
|
||||
@@ -18,6 +19,7 @@ const ProductInfoDialog = importLazyComponent(() => import('./ProductInfoDialog.
|
||||
export class ProductBootstrap extends Bootstrap {
|
||||
constructor(
|
||||
private readonly productInfoResource: ProductInfoResource,
|
||||
private readonly userInfoResource: UserInfoResource,
|
||||
private readonly commonDialogService: CommonDialogService,
|
||||
private readonly menuService: MenuService,
|
||||
) {
|
||||
@@ -27,7 +29,7 @@ export class ProductBootstrap extends Bootstrap {
|
||||
override register(): void {
|
||||
this.menuService.addCreator({
|
||||
menus: [TOP_NAV_BAR_SETTINGS_MENU],
|
||||
isApplicable: () => !!this.productInfoResource.data,
|
||||
isApplicable: () => !this.userInfoResource.isAnonymous() && !!this.productInfoResource.data,
|
||||
getItems: (context, items) => [
|
||||
...items,
|
||||
new MenuBaseItem(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2024 DBeaver Corp and others
|
||||
* Copyright (C) 2020-2025 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
Link,
|
||||
s,
|
||||
TextPlaceholder,
|
||||
useResource,
|
||||
useS,
|
||||
useTranslate,
|
||||
} from '@cloudbeaver/core-blocks';
|
||||
@@ -34,12 +35,12 @@ import ProductInfoDialogStyles from './ProductInfoDialog.module.css';
|
||||
|
||||
export const ProductInfoDialog = observer<DialogComponentProps<null>>(function ProductInfoDialog(props) {
|
||||
const translate = useTranslate();
|
||||
const serverConfigResource = useService(ProductInfoResource);
|
||||
const productInfoResource = useResource(ProductInfoDialog, ProductInfoResource, undefined);
|
||||
const themeService = useService(ThemeService);
|
||||
|
||||
const version = useAppVersion();
|
||||
|
||||
const productInfo = serverConfigResource.data;
|
||||
const productInfo = productInfoResource.data;
|
||||
const logoIcon = themeService.themeId === 'light' ? '/icons/product-logo_light.svg' : '/icons/product-logo_dark.svg';
|
||||
|
||||
const styles = useS(ProductInfoDialogStyles);
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
"composite": true
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"path": "../core-authentication"
|
||||
},
|
||||
{
|
||||
"path": "../core-blocks"
|
||||
},
|
||||
|
||||
@@ -3480,6 +3480,7 @@ __metadata:
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@cloudbeaver/plugin-product@workspace:packages/plugin-product"
|
||||
dependencies:
|
||||
"@cloudbeaver/core-authentication": "workspace:*"
|
||||
"@cloudbeaver/core-blocks": "workspace:*"
|
||||
"@cloudbeaver/core-cli": "workspace:*"
|
||||
"@cloudbeaver/core-di": "workspace:*"
|
||||
|
||||
Reference in New Issue
Block a user