@@ -23,14 +23,13 @@ import (
23
23
"testing"
24
24
"time"
25
25
26
- "golang.org/x/crypto/ssh"
27
-
28
26
"github.com/go-chi/chi"
29
27
"github.com/smallstep/certificates/authority"
30
28
"github.com/smallstep/certificates/authority/provisioner"
31
29
"github.com/smallstep/certificates/logging"
32
30
"github.com/smallstep/cli/crypto/tlsutil"
33
31
"github.com/smallstep/cli/jose"
32
+ "golang.org/x/crypto/ssh"
34
33
)
35
34
36
35
const (
@@ -498,6 +497,7 @@ type mockAuthority struct {
498
497
root func (shasum string ) (* x509.Certificate , error )
499
498
sign func (cr * x509.CertificateRequest , opts provisioner.Options , signOpts ... provisioner.SignOption ) (* x509.Certificate , * x509.Certificate , error )
500
499
singSSH func (key ssh.PublicKey , opts provisioner.SSHOptions , signOpts ... provisioner.SignOption ) (* ssh.Certificate , error )
500
+ singSSHAddUser func (key ssh.PublicKey , cert * ssh.Certificate ) (* ssh.Certificate , error )
501
501
renew func (cert * x509.Certificate ) (* x509.Certificate , * x509.Certificate , error )
502
502
loadProvisionerByCertificate func (cert * x509.Certificate ) (provisioner.Interface , error )
503
503
getProvisioners func (nextCursor string , limit int ) (provisioner.List , string , error )
@@ -547,6 +547,13 @@ func (m *mockAuthority) SignSSH(key ssh.PublicKey, opts provisioner.SSHOptions,
547
547
return m .ret1 .(* ssh.Certificate ), m .err
548
548
}
549
549
550
+ func (m * mockAuthority ) SignSSHAddUser (key ssh.PublicKey , cert * ssh.Certificate ) (* ssh.Certificate , error ) {
551
+ if m .singSSHAddUser != nil {
552
+ return m .singSSHAddUser (key , cert )
553
+ }
554
+ return m .ret1 .(* ssh.Certificate ), m .err
555
+ }
556
+
550
557
func (m * mockAuthority ) Renew (cert * x509.Certificate ) (* x509.Certificate , * x509.Certificate , error ) {
551
558
if m .renew != nil {
552
559
return m .renew (cert )
0 commit comments