Skip to content

Commit dedf6b1

Browse files
marainodopey
authored andcommitted
Addapt tests to the api change.
1 parent c6f6493 commit dedf6b1

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

api/api_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ type mockAuthority struct {
565565
getSSHRoots func() (*authority.SSHKeys, error)
566566
getSSHFederation func() (*authority.SSHKeys, error)
567567
getSSHConfig func(typ string, data map[string]string) ([]templates.Output, error)
568-
checkSSHHost func(principal string) (bool, error)
568+
checkSSHHost func(ctx context.Context, principal, token string) (bool, error)
569569
getSSHBastion func(user string, hostname string) (*authority.Bastion, error)
570570
version func() authority.Version
571571
}
@@ -715,9 +715,9 @@ func (m *mockAuthority) GetSSHConfig(typ string, data map[string]string) ([]temp
715715
return m.ret1.([]templates.Output), m.err
716716
}
717717

718-
func (m *mockAuthority) CheckSSHHost(principal string) (bool, error) {
718+
func (m *mockAuthority) CheckSSHHost(ctx context.Context, principal, token string) (bool, error) {
719719
if m.checkSSHHost != nil {
720-
return m.checkSSHHost(principal)
720+
return m.checkSSHHost(ctx, principal, token)
721721
}
722722
return m.ret1.(bool), m.err
723723
}

api/ssh_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package api
22

33
import (
44
"bytes"
5+
"context"
56
"crypto/ecdsa"
67
"crypto/elliptic"
78
"crypto/rand"
@@ -539,7 +540,7 @@ func Test_caHandler_SSHCheckHost(t *testing.T) {
539540
for _, tt := range tests {
540541
t.Run(tt.name, func(t *testing.T) {
541542
h := New(&mockAuthority{
542-
checkSSHHost: func(_ string) (bool, error) {
543+
checkSSHHost: func(ctx context.Context, principal, token string) (bool, error) {
543544
return tt.exists, tt.err
544545
},
545546
}).(*caHandler)

0 commit comments

Comments
 (0)