mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-10-16 14:50:15 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c9d9c3511 | ||
|
|
81c22d9ae6 | ||
|
|
21aabc7343 | ||
|
|
a8c32f0a17 |
@@ -4,7 +4,7 @@ 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-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
-11
@@ -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) {
|
||||
|
||||
@@ -4,7 +4,7 @@ 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-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
@@ -3,7 +3,7 @@ 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-Release-Date: 20231009
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Automatic-Module-Name: io.cloudbeaver.resources.drivers.base
|
||||
|
||||
@@ -4,7 +4,7 @@ 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-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-Activator: io.cloudbeaver.server.CBPlatformActivator
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Administration
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.admin;singleton:=true
|
||||
Bundle-Version: 1.0.82.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Authentication
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.auth;singleton:=true
|
||||
Bundle-Version: 1.0.82.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
+5
@@ -68,6 +68,11 @@ public class WebServiceAuthImpl implements DBWServiceAuth {
|
||||
if (CommonUtils.isEmpty(providerId)) {
|
||||
throw new DBWebException("Missing auth provider parameter");
|
||||
}
|
||||
WebAuthProviderDescriptor authProviderDescriptor = WebAuthProviderRegistry.getInstance()
|
||||
.getAuthProvider(providerId);
|
||||
if (authProviderDescriptor.isTrusted()) {
|
||||
throw new DBWebException(authProviderDescriptor.getLabel() + " not allowed for authorization via GQL API");
|
||||
}
|
||||
if (authParameters == null) {
|
||||
authParameters = Map.of();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Data Transfer
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.data.transfer;singleton:=true
|
||||
Bundle-Version: 1.0.83.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Metadata
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.metadata;singleton:=true
|
||||
Bundle-Version: 1.0.86.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: DBeaver Corp
|
||||
Bundle-Name: Cloudbeaver Web Service - Resource manager
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.rm;singleton:=true
|
||||
Bundle-Version: 1.0.35.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
@@ -4,7 +4,7 @@ Bundle-Vendor: Cloudbeaver Web Service - Security
|
||||
Bundle-Vendor: DBeaver Corp
|
||||
Bundle-SymbolicName: io.cloudbeaver.service.security;singleton:=true
|
||||
Bundle-Version: 1.0.38.qualifier
|
||||
Bundle-Release-Date: 20230209
|
||||
Bundle-Release-Date: 20231009
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Bundle-ClassPath: .
|
||||
|
||||
+16
-2
@@ -1200,6 +1200,9 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen
|
||||
|
||||
@Override
|
||||
public SMAuthInfo authenticateAnonymousUser(@NotNull String appSessionId, @NotNull Map<String, Object> sessionParameters, @NotNull SMSessionType sessionType) throws DBException {
|
||||
if (!application.getAppConfiguration().isAnonymousAccessEnabled()) {
|
||||
throw new SMException("Anonymous access restricted");
|
||||
}
|
||||
try (Connection dbCon = database.openConnection()) {
|
||||
try (JDBCTransaction txn = new JDBCTransaction(dbCon)) {
|
||||
var smSessionId = createSmSession(appSessionId, null, sessionParameters, sessionType, dbCon);
|
||||
@@ -1235,6 +1238,9 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen
|
||||
@Nullable String authProviderConfigurationId,
|
||||
@NotNull Map<String, Object> userCredentials
|
||||
) throws DBException {
|
||||
if (isProviderDisabled(authProviderId, authProviderConfigurationId)) {
|
||||
throw new SMException("Unsupported authentication provider: " + authProviderId);
|
||||
}
|
||||
var authProgressMonitor = new LoggingProgressMonitor(log);
|
||||
try (Connection dbCon = database.openConnection()) {
|
||||
try (JDBCTransaction txn = new JDBCTransaction(dbCon)) {
|
||||
@@ -2589,9 +2595,17 @@ public class CBEmbeddedSecurityController implements SMAdminController, SMAuthen
|
||||
return activeUserCredentials.getUserId();
|
||||
}
|
||||
|
||||
private boolean isProviderEnabled(@NotNull String providerId) {
|
||||
private boolean isProviderDisabled(@NotNull String providerId, @Nullable String authConfigurationId) {
|
||||
WebAuthConfiguration appConfiguration = application.getAuthConfiguration();
|
||||
return appConfiguration.isAuthProviderEnabled(providerId);
|
||||
if (!appConfiguration.isAuthProviderEnabled(providerId)) {
|
||||
return true;
|
||||
}
|
||||
if (authConfigurationId != null) {
|
||||
SMAuthProviderCustomConfiguration configuration =
|
||||
appConfiguration.getAuthProviderConfiguration(authConfigurationId);
|
||||
return configuration == null || configuration.isDisabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void clearOldAuthAttemptInfo() throws DBException {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
composes: theme-background-surface theme-text-on-surface from global;
|
||||
display: flex;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.loader {
|
||||
height: 100%;
|
||||
|
||||
@@ -34,20 +34,20 @@ export const Main = observer(function Main() {
|
||||
mode={leftBarDisabled ? 'minimize' : splitMainState.mode}
|
||||
disable={leftBarDisabled}
|
||||
>
|
||||
<Pane basis="250px" main>
|
||||
<Pane className={s(styles, { pane: true })} basis="250px" main>
|
||||
<Loader suspense>
|
||||
<SideBarPanel container={leftBarPanelService.tabsContainer} />
|
||||
</Loader>
|
||||
</Pane>
|
||||
<ResizerControls />
|
||||
<Pane>
|
||||
<Pane className={s(styles, { pane: true })}>
|
||||
<Split {...splitRightState} mode={sideBarDisabled ? 'minimize' : splitRightState.mode} disable={sideBarDisabled} sticky={30}>
|
||||
<Pane className={s(styles, { pane: true })}>
|
||||
<RightArea />
|
||||
</Pane>
|
||||
<ResizerControls />
|
||||
<Pane basis="250px" main >
|
||||
<Loader suspense className={s(styles, { loader: true })}>
|
||||
<Pane className={s(styles, { pane: true })} basis="250px" main>
|
||||
<Loader className={s(styles, { loader: true })} suspense>
|
||||
<SideBarPanel container={sideBarPanelService.tabsContainer} />
|
||||
</Loader>
|
||||
</Pane>
|
||||
|
||||
@@ -4,3 +4,7 @@
|
||||
.slideBox {
|
||||
flex: 1;
|
||||
}
|
||||
.pane {
|
||||
display: flex;
|
||||
composes: theme-background-surface theme-text-on-surface from global;
|
||||
}
|
||||
|
||||
@@ -39,13 +39,13 @@ export const RightArea = observer<Props>(function RightArea({ className }) {
|
||||
</SlideElement>
|
||||
<SlideElement>
|
||||
<Split {...splitState} sticky={30} split="horizontal" mode={toolsDisabled ? 'minimize' : splitState.mode} disable={toolsDisabled} keepRatio>
|
||||
<Pane>
|
||||
<Pane className={s(styles, { pane: true })}>
|
||||
<Loader className={s(styles, { loader: true })} suspense>
|
||||
<NavigationTabsBar />
|
||||
</Loader>
|
||||
</Pane>
|
||||
<ResizerControls />
|
||||
<Pane basis="30%" main>
|
||||
<Pane className={s(styles, { pane: true })} basis="30%" main>
|
||||
<Loader className={s(styles, { loader: true })} suspense>
|
||||
<ToolsPanel container={toolsPanelService.tabsContainer} />
|
||||
</Loader>
|
||||
|
||||
@@ -100,11 +100,11 @@ export const Button = observer<ButtonProps>(function Button({
|
||||
>
|
||||
<div className={s(styles, { ripple: true })} />
|
||||
{icon && (
|
||||
<div className={s(styles, { buttonIcon: true, disabled }, className)}>
|
||||
<div className={s(styles, { buttonIcon: true, disabled })}>
|
||||
<IconOrImage icon={icon} viewBox={viewBox} />
|
||||
</div>
|
||||
)}
|
||||
<span className={s(styles, { buttonLabel: true }, className)}>{children}</span>
|
||||
<span className={s(styles, { buttonLabel: true })}>{children}</span>
|
||||
<Loader className={s(styles, { loader: true })} small />
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -2,5 +2,4 @@
|
||||
flex: 1 1 0%;
|
||||
overflow: auto;
|
||||
z-index: 0;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
+2
-4
@@ -29,10 +29,8 @@ const styles = css`
|
||||
actions {
|
||||
composes: theme-border-color-background from global;
|
||||
border-right: solid 1px;
|
||||
|
||||
& Button {
|
||||
margin-right: 16px;
|
||||
}
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
actions,
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
.controls {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
margin: auto;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.fill {
|
||||
flex: 1;
|
||||
}
|
||||
+7
-23
@@ -6,27 +6,10 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { observer } from 'mobx-react-lite';
|
||||
import styled, { css } from 'reshadow';
|
||||
|
||||
import { Button, useTranslate } from '@cloudbeaver/core-blocks';
|
||||
import { Button, useS, useTranslate } from '@cloudbeaver/core-blocks';
|
||||
|
||||
const styles = css`
|
||||
controls {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
fill {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
Button:not(:first-child) {
|
||||
margin-left: 24px;
|
||||
}
|
||||
`;
|
||||
import style from './ConnectionDialogFooter.m.css';
|
||||
|
||||
interface Props {
|
||||
isConnecting: boolean;
|
||||
@@ -35,16 +18,17 @@ interface Props {
|
||||
}
|
||||
|
||||
export const ConnectionDialogFooter = observer<Props>(function ConnectionDialogFooter({ isConnecting, onConnect, onBack }) {
|
||||
const styles = useS(style);
|
||||
const translate = useTranslate();
|
||||
return styled(styles)(
|
||||
<controls>
|
||||
<fill />
|
||||
return (
|
||||
<div className={styles.controls}>
|
||||
<div className={styles.fill} />
|
||||
<Button type="button" mod={['outlined']} disabled={isConnecting} onClick={onBack}>
|
||||
{translate('ui_stepper_back')}
|
||||
</Button>
|
||||
<Button type="button" mod={['unelevated']} disabled={isConnecting} onClick={onConnect}>
|
||||
{isConnecting ? translate('basicConnection_connectionDialog_connecting') : translate('connections_connection_connect')}
|
||||
</Button>
|
||||
</controls>,
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -17,15 +17,12 @@ const styles = css`
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
margin: auto;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
fill {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
Button:not(:first-child) {
|
||||
margin-left: 24px;
|
||||
}
|
||||
`;
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.logViewWrapper,
|
||||
.pane {
|
||||
z-index: 0;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex: 1;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
composes: theme-background-surface theme-text-on-surface from global;
|
||||
}
|
||||
|
||||
+11
@@ -1,3 +1,14 @@
|
||||
.pane {
|
||||
composes: theme-background-surface theme-text-on-surface from global;
|
||||
}
|
||||
.split {
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
}
|
||||
.resizerControls {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
}
|
||||
.textarea > :global(textarea) {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
+4
-4
@@ -42,8 +42,8 @@ export const ExecutionPlanTreeBlock = observer<Props>(function ExecutionPlanTree
|
||||
const state = useExecutionPlanTreeState(nodeList, onNodeSelect);
|
||||
|
||||
return (
|
||||
<Split {...splitState} sticky={30} split="horizontal" keepRatio>
|
||||
<Pane>
|
||||
<Split className={s(styles, { split: true }, className)} {...splitState} sticky={30} split="horizontal" keepRatio>
|
||||
<Pane className={styles.pane}>
|
||||
{state.nodes.length && state.columns.length ? (
|
||||
<Table selectedItems={state.selectedNodes} onSelect={state.selectNode}>
|
||||
<TableHeader fixed>
|
||||
@@ -67,8 +67,8 @@ export const ExecutionPlanTreeBlock = observer<Props>(function ExecutionPlanTree
|
||||
<TextPlaceholder>{translate('sql_execution_plan_placeholder')}</TextPlaceholder>
|
||||
)}
|
||||
</Pane>
|
||||
<ResizerControls />
|
||||
<Pane basis="30%" main>
|
||||
<ResizerControls className={styles.resizerControls} />
|
||||
<Pane className={styles.pane} basis="30%" main>
|
||||
<Textarea className={s(styles, { textarea: true }, className)} name="value" rows={3} value={query} readOnly embedded />
|
||||
</Pane>
|
||||
</Split>
|
||||
|
||||
Reference in New Issue
Block a user