From 6ce6408b25ab4a4ed21205d077c9086a543f14d2 Mon Sep 17 00:00:00 2001 From: STeve Huang Date: Fri, 10 Jan 2025 11:00:58 -0500 Subject: [PATCH] fix ut after sshca change --- lib/srv/git/forward_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/srv/git/forward_test.go b/lib/srv/git/forward_test.go index 669e6c411b016..c5812c1e64911 100644 --- a/lib/srv/git/forward_test.go +++ b/lib/srv/git/forward_test.go @@ -44,6 +44,7 @@ import ( "github.com/gravitational/teleport/lib/services" "github.com/gravitational/teleport/lib/services/local" "github.com/gravitational/teleport/lib/srv" + "github.com/gravitational/teleport/lib/sshca" "github.com/gravitational/teleport/lib/sshutils" "github.com/gravitational/teleport/lib/utils" ) @@ -198,15 +199,17 @@ func makeUserCert(t *testing.T, caSigner ssh.Signer) ssh.Signer { keygen := testauthority.New() clientPrivateKey, err := cryptosuites.GeneratePrivateKeyWithAlgorithm(cryptosuites.ECDSAP256) require.NoError(t, err) - clientCertBytes, err := keygen.GenerateUserCert(services.UserCertParams{ + clientCertBytes, err := keygen.GenerateUserCert(sshca.UserCertificateRequest{ CASigner: caSigner, PublicUserKey: clientPrivateKey.MarshalSSHPublicKey(), - Username: "alice", - AllowedLogins: []string{"does-not-matter"}, - GitHubUserID: "1234567", CertificateFormat: constants.CertificateFormatStandard, - Traits: wrappers.Traits{}, - Roles: []string{"editor"}, + Identity: sshca.Identity{ + Username: "alice", + AllowedLogins: []string{"does-not-matter"}, + GitHubUserID: "1234567", + Traits: wrappers.Traits{}, + Roles: []string{"editor"}, + }, }) require.NoError(t, err) clientAuthorizedCert, _, _, _, err := ssh.ParseAuthorizedKey(clientCertBytes)