Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
eed5f6f0
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eed5f6f0
编写于
8月 06, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/devel' into devel
上级
551ed84d
b840c551
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
77 addition
and
31 deletion
+77
-31
features/org.jkiss.dbeaver.standalone.feature/feature.xml
features/org.jkiss.dbeaver.standalone.feature/feature.xml
+5
-5
plugins/org.jkiss.dbeaver.ext.snowflake.core/META-INF/MANIFEST.MF
...org.jkiss.dbeaver.ext.snowflake.core/META-INF/MANIFEST.MF
+1
-1
plugins/org.jkiss.dbeaver.net.ssh.jsch/META-INF/MANIFEST.MF
plugins/org.jkiss.dbeaver.net.ssh.jsch/META-INF/MANIFEST.MF
+3
-2
plugins/org.jkiss.dbeaver.net.ssh.jsch/src/org/jkiss/dbeaver/model/net/ssh/SSHImplementationJsch.java
...rg/jkiss/dbeaver/model/net/ssh/SSHImplementationJsch.java
+62
-23
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
...src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
+6
-0
未找到文件。
features/org.jkiss.dbeaver.standalone.feature/feature.xml
浏览文件 @
eed5f6f0
...
...
@@ -55,11 +55,11 @@
<plugin
id=
"org.eclipse.ui.ide.application"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
unpack=
"false"
/>
<!-- EGit and other requirements -->
<
import
plugin=
"org.eclipse.ui.net
"
/>
<
import
plugin=
"org.eclipse.jsch.core
"
/>
<
import
plugin=
"org.eclipse.jsch.ui
"
/>
<
import
plugin=
"org.eclipse.core.variables
"
/>
<
import
plugin=
"org.eclipse.ui.cheatsheets
"
/>
<
plugin
id=
"org.eclipse.ui.net"
download-size=
"0"
install-size=
"0"
version=
"0.0.0
"
/>
<
plugin
id=
"org.eclipse.jsch.core"
download-size=
"0"
install-size=
"0"
version=
"0.0.0
"
/>
<
plugin
id=
"org.eclipse.jsch.ui"
download-size=
"0"
install-size=
"0"
version=
"0.0.0
"
/>
<
plugin
id=
"org.eclipse.core.variables"
download-size=
"0"
install-size=
"0"
version=
"0.0.0
"
/>
<
plugin
id=
"org.eclipse.ui.cheatsheets"
download-size=
"0"
install-size=
"0"
version=
"0.0.0
"
/>
<!-- Include org.eclipse.ui.themes because it was added only in 4.4 -->
<plugin
id=
"org.eclipse.ui.themes"
download-size=
"0"
install-size=
"0"
version=
"0.0.0"
/>
...
...
plugins/org.jkiss.dbeaver.ext.snowflake.core/META-INF/MANIFEST.MF
浏览文件 @
eed5f6f0
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.ext.snowflake.core
Bundle-SymbolicName: org.jkiss.dbeaver.ext.snowflake.core
;singleton:=true
Bundle-Version: 1.0.13.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
...
...
plugins/org.jkiss.dbeaver.net.ssh.jsch/META-INF/MANIFEST.MF
浏览文件 @
eed5f6f0
...
...
@@ -3,12 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Vendor: %Bundle-Vendor
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.jkiss.dbeaver.net.ssh.jsch;singleton:=true
Bundle-Version: 1.
0.11
.qualifier
Bundle-Version: 1.
1.0
.qualifier
Bundle-Release-Date: 20180813
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.jkiss.dbeaver.model,
org.jkiss.dbeaver.net.ssh,
com.jcraft.jsch
com.jcraft.jsch,
org.eclipse.jsch.ui
Bundle-Localization: OSGI-INF/l10n/bundle
plugins/org.jkiss.dbeaver.net.ssh.jsch/src/org/jkiss/dbeaver/model/net/ssh/SSHImplementationJsch.java
浏览文件 @
eed5f6f0
...
...
@@ -17,6 +17,7 @@
package
org.jkiss.dbeaver.model.net.ssh
;
import
com.jcraft.jsch.*
;
import
org.eclipse.jsch.ui.UserInfoPrompter
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.net.DBWHandlerConfiguration
;
...
...
@@ -40,15 +41,14 @@ public class SSHImplementationJsch extends SSHImplementationAbstract {
@Override
protected
void
setupTunnel
(
DBRProgressMonitor
monitor
,
DBWHandlerConfiguration
configuration
,
String
dbHost
,
String
sshHost
,
String
aliveInterval
,
int
sshPortNum
,
File
privKeyFile
,
int
connectTimeout
,
int
dbPort
,
int
localPort
)
throws
DBException
,
IOException
{
UserInfo
ui
=
new
UIUserInfo
(
configuration
);
try
{
if
(
jsch
==
null
)
{
jsch
=
new
JSch
();
JSch
.
setLogger
(
new
LoggerProxy
());
}
if
(
privKeyFile
!=
null
)
{
if
(!
CommonUtils
.
isEmpty
(
ui
.
getPassphrase
()))
{
jsch
.
addIdentity
(
privKeyFile
.
getAbsolutePath
(),
ui
.
getPassphrase
());
if
(!
CommonUtils
.
isEmpty
(
configuration
.
getPassword
()))
{
jsch
.
addIdentity
(
privKeyFile
.
getAbsolutePath
(),
configuration
.
getPassword
());
}
else
{
jsch
.
addIdentity
(
privKeyFile
.
getAbsolutePath
());
}
...
...
@@ -59,8 +59,12 @@ public class SSHImplementationJsch extends SSHImplementationAbstract {
session
.
setConfig
(
"StrictHostKeyChecking"
,
"no"
);
//session.setConfig("PreferredAuthentications", "password,publickey,keyboard-interactive");
session
.
setConfig
(
"PreferredAuthentications"
,
privKeyFile
!=
null
?
"publickey"
:
"password
"
);
privKeyFile
!=
null
?
"publickey"
:
"password,keyboard-interactive
"
);
session
.
setConfig
(
"ConnectTimeout"
,
String
.
valueOf
(
connectTimeout
));
// Use Eclipse standard prompter
UserInfoCustom
ui
=
new
UserInfoCustom
(
configuration
);
session
.
setUserInfo
(
ui
);
if
(!
CommonUtils
.
isEmpty
(
aliveInterval
))
{
session
.
setServerAliveInterval
(
Integer
.
parseInt
(
aliveInterval
));
...
...
@@ -118,48 +122,48 @@ public class SSHImplementationJsch extends SSHImplementationAbstract {
}
}
private
class
UIUserInfo
implements
UserInfo
{
private
class
UIUserInfo
implements
UserInfo
,
UIKeyboardInteractive
{
DBWHandlerConfiguration
configuration
;
private
UIUserInfo
(
DBWHandlerConfiguration
configuration
)
{
private
UIUserInfo
(
DBWHandlerConfiguration
configuration
)
{
this
.
configuration
=
configuration
;
}
@Override
public
String
getPassphrase
()
{
public
String
getPassphrase
()
{
return
configuration
.
getPassword
();
}
@Override
public
String
getPassword
()
{
public
String
getPassword
()
{
return
configuration
.
getPassword
();
}
@Override
public
boolean
promptPassword
(
String
message
)
{
public
boolean
promptPassword
(
String
message
)
{
return
true
;
}
@Override
public
boolean
promptPassphrase
(
String
message
)
{
public
boolean
promptPassphrase
(
String
message
)
{
return
true
;
}
@Override
public
boolean
promptYesNo
(
String
message
)
{
public
boolean
promptYesNo
(
String
message
)
{
return
false
;
}
@Override
public
void
showMessage
(
String
message
)
{
public
void
showMessage
(
String
message
)
{
log
.
info
(
message
);
}
@Override
public
String
[]
promptKeyboardInteractive
(
String
destination
,
String
name
,
String
instruction
,
String
[]
prompt
,
boolean
[]
echo
)
{
System
.
out
.
printf
(
"Keyboard interactive auth"
);
return
new
String
[]
{
configuration
.
getPassword
()
}
;
}
}
private
class
LoggerProxy
implements
Logger
{
...
...
@@ -172,10 +176,18 @@ public class SSHImplementationJsch extends SSHImplementationAbstract {
public
void
log
(
int
level
,
String
message
)
{
String
levelStr
;
switch
(
level
)
{
case
INFO:
levelStr
=
"INFO"
;
break
;
case
WARN:
levelStr
=
"WARN"
;
break
;
case
ERROR:
levelStr
=
"ERROR"
;
break
;
case
FATAL:
levelStr
=
"FATAL"
;
break
;
case
INFO:
levelStr
=
"INFO"
;
break
;
case
WARN:
levelStr
=
"WARN"
;
break
;
case
ERROR:
levelStr
=
"ERROR"
;
break
;
case
FATAL:
levelStr
=
"FATAL"
;
break
;
case
DEBUG:
default
:
levelStr
=
"DEBUG"
;
...
...
@@ -185,4 +197,31 @@ public class SSHImplementationJsch extends SSHImplementationAbstract {
}
}
private
class
UserInfoCustom
extends
UserInfoPrompter
{
private
final
DBWHandlerConfiguration
configuration
;
UserInfoCustom
(
DBWHandlerConfiguration
configuration
)
{
super
(
SSHImplementationJsch
.
this
.
session
);
this
.
configuration
=
configuration
;
}
@Override
public
boolean
promptPassword
(
String
message
)
{
if
(
configuration
.
isSavePassword
())
{
setPassword
(
configuration
.
getPassword
());
return
true
;
}
return
super
.
promptPassword
(
message
);
}
@Override
public
boolean
promptPassphrase
(
String
message
)
{
if
(
configuration
.
isSavePassword
())
{
setPassphrase
(
configuration
.
getPassword
());
return
true
;
}
return
super
.
promptPassphrase
(
message
);
}
}
}
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/dialogs/StandardErrorDialog.java
浏览文件 @
eed5f6f0
...
...
@@ -65,6 +65,12 @@ public class StandardErrorDialog extends ErrorDialog {
lastMessage
=
e
.
getMessage
();
}
}
if
(
CommonUtils
.
isEmpty
(
lastMessage
))
{
lastMessage
=
rootStatus
.
getMessage
();
if
(
CommonUtils
.
isEmpty
(
lastMessage
))
{
lastMessage
=
status
.
getMessage
();
}
}
this
.
message
=
TextUtils
.
cutExtraLines
(
lastMessage
,
20
);
}
else
{
this
.
message
=
TextUtils
.
cutExtraLines
(
rootStatus
.
getMessage
(),
20
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录