Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Update vendoring to allow ssh package use outside of fleet #1477

Closed
jasonmoo opened this issue Mar 7, 2016 · 2 comments
Closed

Update vendoring to allow ssh package use outside of fleet #1477

jasonmoo opened this issue Mar 7, 2016 · 2 comments

Comments

@jasonmoo
Copy link

jasonmoo commented Mar 7, 2016

github.com/coreos/fleet/ssh has a nice known hosts check that is compatible with golang.org/x/crypto/ssh, but vendoring with Godeps creates a namespacing problem which prevents it from being used outside the fleet library fwict.

func EnsureKnownHosts(hostsFile string, config *ssh.ClientConfig) {
    key := fleetssh.NewHostKeyFile(hostsFile)
    check := fleetssh.NewHostKeyChecker(key)
    config.HostKeyCallback = check.Check
}
./ssh_config.go:36: cannot use check.Check (type func(string, net.Addr, "github.com/coreos/fleet/Godeps/_workspace/src/golang.org/x/crypto/ssh".PublicKey) error) as type func(string, net.Addr, "golang.org/x/crypto/ssh".PublicKey) error in assignment

It's possible I'm misusing this library somehow, but it seems like the Go vendor experiment that has been adopted in go 1.6 might enable this type of use.

@dongsupark
Copy link
Contributor

I think this issue is already resolved since fleet started using govendor instead of Godeps. As far as I tested it shortly, it's already possible to call methods of github.com/coreos/fleet/ssh, even outside of fleet.
So I'm closing it. Thanks!

@jasonmoo
Copy link
Author

Cool I actually went ahead and wrote a slightly more robust version. But glad you guys are making this available.

https://github.com/emptyinterface/knownhosts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants