projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix more golint warnings.
[arvados.git]
/
lib
/
dispatchcloud
/
test
/
ssh_service.go
diff --git
a/lib/dispatchcloud/test/ssh_service.go
b/lib/dispatchcloud/test/ssh_service.go
index ed5995f4c5f0faa84356c01f2777d1e0a366cbc1..f1fde4f422ce55198742871883f8a0bbd7c682d3 100644
(file)
--- a/
lib/dispatchcloud/test/ssh_service.go
+++ b/
lib/dispatchcloud/test/ssh_service.go
@@
-39,6
+39,7
@@
type SSHExecFunc func(env map[string]string, command string, stdin io.Reader, st
type SSHService struct {
Exec SSHExecFunc
HostKey ssh.Signer
type SSHService struct {
Exec SSHExecFunc
HostKey ssh.Signer
+ AuthorizedUser string
AuthorizedKeys []ssh.PublicKey
listener net.Listener
AuthorizedKeys []ssh.PublicKey
listener net.Listener
@@
-64,6
+65,11
@@
func (ss *SSHService) Address() string {
return ln.Addr().String()
}
return ln.Addr().String()
}
+// RemoteUser returns the username that will be accepted.
+func (ss *SSHService) RemoteUser() string {
+ return ss.AuthorizedUser
+}
+
// Close shuts down the server and releases resources. Established
// connections are unaffected.
func (ss *SSHService) Close() {
// Close shuts down the server and releases resources. Established
// connections are unaffected.
func (ss *SSHService) Close() {
@@
-103,7
+109,7
@@
func (ss *SSHService) run() {
}
config.AddHostKey(ss.HostKey)
}
config.AddHostKey(ss.HostKey)
- listener, err := net.Listen("tcp", ":")
+ listener, err := net.Listen("tcp", "
127.0.0.1
:")
if err != nil {
ss.err = err
return
if err != nil {
ss.err = err
return