From f082cbc421daf6c42c29e79c9b1fed2b1da41cf3 Mon Sep 17 00:00:00 2001 From: Herman Slatman Date: Wed, 8 Nov 2023 20:09:52 +0100 Subject: [PATCH] Denormalize provisioner name in SCEP webhook --- authority/provisioner/scep.go | 3 +-- authority/provisioner/scep_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/authority/provisioner/scep.go b/authority/provisioner/scep.go index 4d087de3..a48d11cc 100644 --- a/authority/provisioner/scep.go +++ b/authority/provisioner/scep.go @@ -9,7 +9,6 @@ import ( "encoding/pem" "fmt" "net/http" - "strings" "time" "github.com/pkg/errors" @@ -153,7 +152,7 @@ func (c *challengeValidationController) Validate(ctx context.Context, csr *x509. if err != nil { return fmt.Errorf("failed creating new webhook request: %w", err) } - req.ProvisionerName = strings.ToLower(provisionerName) + req.ProvisionerName = provisionerName req.SCEPChallenge = challenge req.SCEPTransactionID = transactionID resp, err := wh.DoWithContext(ctx, c.client, req, nil) // TODO(hs): support templated URL? Requires some refactoring diff --git a/authority/provisioner/scep_test.go b/authority/provisioner/scep_test.go index 1b4ca1d8..2e9f3419 100644 --- a/authority/provisioner/scep_test.go +++ b/authority/provisioner/scep_test.go @@ -254,7 +254,7 @@ func TestSCEP_ValidateChallenge(t *testing.T) { req := &request{} err := json.NewDecoder(r.Body).Decode(req) require.NoError(t, err) - assert.Equal(t, "scep", req.ProvisionerName) + assert.Equal(t, "SCEP", req.ProvisionerName) assert.Equal(t, "webhook-challenge", req.Challenge) assert.Equal(t, "webhook-transaction-1", req.TransactionID) if assert.NotNil(t, req.Request) {