From fdbc30365dd83f9360a1098112658229a70ae001 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Mon, 3 Aug 2020 17:31:18 -0500 Subject: [PATCH] Use the correct field when encoding groups into the certificate. Signed-off-by: Matt Moyer --- internal/registry/loginrequest/rest.go | 4 ++-- internal/registry/loginrequest/rest_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/registry/loginrequest/rest.go b/internal/registry/loginrequest/rest.go index fa5b95a1..c4bc4ed9 100644 --- a/internal/registry/loginrequest/rest.go +++ b/internal/registry/loginrequest/rest.go @@ -127,8 +127,8 @@ func (r *REST) Create(ctx context.Context, obj runtime.Object, createValidation certPEM, keyPEM, err := r.issuer.IssuePEM( pkix.Name{ - CommonName: authResponse.User.GetName(), - OrganizationalUnit: authResponse.User.GetGroups(), + CommonName: authResponse.User.GetName(), + Organization: authResponse.User.GetGroups(), }, []string{}, clientCertificateTTL, diff --git a/internal/registry/loginrequest/rest_test.go b/internal/registry/loginrequest/rest_test.go index add537be..0d89152b 100644 --- a/internal/registry/loginrequest/rest_test.go +++ b/internal/registry/loginrequest/rest_test.go @@ -141,8 +141,8 @@ func TestCreateSucceedsWhenGivenATokenAndTheWebhookAuthenticatesTheToken(t *test issuer := mockcertissuer.NewMockCertIssuer(ctrl) issuer.EXPECT().IssuePEM( pkix.Name{ - CommonName: "test-user", - OrganizationalUnit: []string{"test-group-1", "test-group-2"}}, + CommonName: "test-user", + Organization: []string{"test-group-1", "test-group-2"}}, []string{}, 1*time.Hour, ).Return([]byte("test-cert"), []byte("test-key"), nil)