8000 使用crypto/ssh代替本地ssh命令行工具的依赖 by yunlzheng · Pull Request #162 · alibaba/kt-connect · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

使用crypto/ssh代替本地ssh命令行工具的依赖 #162

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

Merged
merged 9 commits into from
Sep 8, 2020

Conversation

yunlzheng
Copy link
Collaborator

No description provided.

@CLAassistant
Copy link
CLAassistant commented Sep 8, 2020

CLA assistant check
All committers have signed the CLA.

}

// ForwardRemoteToLocal indicates an expected call of ForwardRemoteToLocal
func (mr *MockChannelMockRecorder) ForwardRemoteToLocal(certificate, sshAddress, remoteEndpoint, localEndpoint interface{}) *gomock.Call {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 4 locations. Consider refactoring.

)
}

func startVPNConnection(rootCtx context.Context, cli exec.CliInterface, credential *util.SSHCredential,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function startVPNConnection has 7 arguments (exceeds 4 allowed). Consider refactoring.

}

// StartSocks5Proxy indicates an expected call of StartSocks5Proxy
func (mr *MockChannelMockRecorder) StartSocks5Proxy(certificate, sshAddress, socks5Address interface{}) *gomock.Call {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 6 locations. Consider refactoring.

}

// DynamicPortForward create socks5 proxy
func DynamicPortForward(username string, password string, address string, socks5Address string) error {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function DynamicPortForward has 5 return statements (exceeds 4 allowed).

}

// ForwardRemoteToLocal forward remote request to local
func ForwardRemoteToLocal(username string, password string, address string, remoteEndpoint string, localEndpoint string) (err error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ForwardRemoteToLocal has 5 arguments (exceeds 4 allowed). Consider refactoring.

type SSHChannel struct{}

// StartSocks5Proxy start socks5 proxy
func (c *SSHChannel) StartSocks5Proxy(certificate *Certificate, sshAddress string, socks5Address string) (err error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method SSHChannel.StartSocks5Proxy has 5 return statements (exceeds 4 allowed).

wg.Wait()
}

func exposeLocalPortToRemote(wg sync.WaitGroup, ssh channel.Channel, remotePort string, localPort string, localSSHPort int) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function exposeLocalPortToRemote has 5 arguments (exceeds 4 allowed). Consider refactoring.

return nil
}

func portForward(rootCtx context.Context, kubernetesCli kubectl.CliInterface, podName string, localSSHPort int,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function portForward has 6 arguments (exceeds 4 allowed). Consider refactoring.

return outbound(s, name, podIP, credential, cidrs, cli, &ssh)
}

func outbound(s *Shadow, name, podIP string, credential *util.SSHCredential, cidrs []string, cli exec.CliInterface, ssh channel.Channel) (err error) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function outbound has 6 arguments (exceeds 4 allowed). Consider refactoring.

@codeclimate
Copy link
codeclimate bot commented Sep 8, 2020

Code Climate has analyzed commit fe8ee2f and detected 51 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 6
Duplication 45

View more on Code Climate.

@yunlzheng yunlzheng merged commit c0a3f64 into master Sep 8, 2020
@linfan linfan deleted the feature/ssh-channel branch July 13, 2021 01:32
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.

2 participants
0