Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复inception/goinception 连接ssh隧道bug #858

Merged
merged 3 commits into from
Aug 30, 2020
Merged

Conversation

EliasChiang
Copy link
Contributor

我发现没有查询权限的用户在申请查询权限后,会通过inception/goinception审核权限类型,此时的instance如果配置了隧道,并不会通过隧道连接,导致连接失败。
为此我在sql/engines/inception.py/ sql/engines/goinception.py 对instance增加了隧道判断和连接隧道的代码,修复该bug。

@codecov
Copy link

codecov bot commented Aug 28, 2020

Codecov Report

Merging #858 into master will decrease coverage by 0.01%.
The diff coverage is 74.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #858      +/-   ##
==========================================
- Coverage   78.29%   78.28%   -0.02%     
==========================================
  Files          77       77              
  Lines       11004    11024      +20     
==========================================
+ Hits         8616     8630      +14     
- Misses       2388     2394       +6     
Impacted Files Coverage Δ
sql/engines/__init__.py 69.11% <64.28%> (-1.26%) ⬇️
sql/engines/goinception.py 87.05% <66.66%> (-0.45%) ⬇️
sql/engines/inception.py 85.88% <100.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7687049...b93a9f8. Read the comment docs.

@LeoQuote
Copy link
Collaborator

感谢提交,这部分的功能能不能考虑放在engine的共同部分实现,类似get_connection的部分,我看你每个engine都改有点累

@EliasChiang
Copy link
Contributor Author

感谢提交,这部分的功能能不能考虑放在engine的共同部分实现,类似get_connection的部分,我看你每个engine都改有点累

着部分代码只需要修改inception/goinception,其他engine是不需要修改的,因为只有审核是先连接审核库,再连接目标MySQL,所以我就没有把代码放在共同部分里面。

@EliasChiang
Copy link
Contributor Author

我重新设计了函数,现在在EngineBase中实现了连接远程主机的方法,并在inception,goinception中调用。

@hhyo hhyo merged commit 5d4cf56 into hhyo:master Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants