Denormalize provisioner name in SCEP webhook

pull/1617/head
Herman Slatman 6 months ago
parent 9ebc8779f5
commit f082cbc421
No known key found for this signature in database
GPG Key ID: F4D8A44EA0A75A4F

@ -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

@ -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) {

Loading…
Cancel
Save