@@ -22,7 +22,6 @@ import (
22
22
"github.com/smallstep/certificates/authority"
23
23
"github.com/smallstep/certificates/authority/provisioner"
24
24
"github.com/smallstep/certificates/logging"
25
- "github.com/smallstep/certificates/sshutil"
26
25
"github.com/smallstep/certificates/templates"
27
26
"golang.org/x/crypto/ssh"
28
27
)
@@ -569,29 +568,29 @@ func Test_caHandler_SSHCheckHost(t *testing.T) {
569
568
}
570
569
571
570
func Test_caHandler_SSHGetHosts (t * testing.T ) {
572
- hosts := []sshutil .Host {
573
- {HostID : "1" , HostTags : []sshutil .HostTag {{ID : "1" , Name : "group" , Value : "1" }}, Hostname : "host1" },
574
- {HostID : "2" , HostTags : []sshutil .HostTag {{ID : "1" , Name : "group" , Value : "1" }, {ID : "2" , Name : "group" , Value : "2" }}, Hostname : "host2" },
571
+ hosts := []authority .Host {
572
+ {HostID : "1" , HostTags : []authority .HostTag {{ID : "1" , Name : "group" , Value : "1" }}, Hostname : "host1" },
573
+ {HostID : "2" , HostTags : []authority .HostTag {{ID : "1" , Name : "group" , Value : "1" }, {ID : "2" , Name : "group" , Value : "2" }}, Hostname : "host2" },
575
574
}
576
575
hostsJSON , err := json .Marshal (hosts )
577
576
assert .FatalError (t , err )
578
577
579
578
tests := []struct {
580
579
name string
581
- hosts []sshutil .Host
580
+ hosts []authority .Host
582
581
err error
583
582
body []byte
584
583
statusCode int
585
584
}{
586
585
{"ok" , hosts , nil , []byte (fmt .Sprintf (`{"hosts":%s}` , hostsJSON )), http .StatusOK },
587
- {"empty (array)" , []sshutil .Host {}, nil , []byte (`{"hosts":[]}` ), http .StatusOK },
586
+ {"empty (array)" , []authority .Host {}, nil , []byte (`{"hosts":[]}` ), http .StatusOK },
588
587
{"empty (nil)" , nil , nil , []byte (`{"hosts":null}` ), http .StatusOK },
589
588
{"error" , nil , fmt .Errorf ("an error" ), nil , http .StatusInternalServerError },
590
589
}
591
590
for _ , tt := range tests {
592
591
t .Run (tt .name , func (t * testing.T ) {
593
592
h := New (& mockAuthority {
594
- getSSHHosts : func (context.Context , * x509.Certificate ) ([]sshutil .Host , error ) {
593
+ getSSHHosts : func (context.Context , * x509.Certificate ) ([]authority .Host , error ) {
595
594
return tt .hosts , tt .err
596
595
},
597
596
}).(* caHandler )
0 commit comments