Skip to content

Commit

Permalink
fix ut after sshca change
Browse files Browse the repository at this point in the history
  • Loading branch information
greedy52 committed Jan 10, 2025
1 parent ec56f21 commit 6ce6408
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/srv/git/forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6ce6408

Please sign in to comment.