Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: client cert decoding is not required #4558

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions internal/kms/azure_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package kms

import (
"context"
"encoding/base64"
"errors"
"fmt"

Expand Down Expand Up @@ -106,19 +105,11 @@ func initAzureKeyVaultKMS(args ProviderInitArgs) (EncryptionKMS, error) {
return nil, fmt.Errorf("failed to get secrets for %T, %w", kms, err)
}

var encodedClientCertificate string
err = setConfigString(&encodedClientCertificate, secrets, azureClientCertificate)
err = setConfigString(&kms.clientCertificate, secrets, azureClientCertificate)
if err != nil {
return nil, err
}

clientCertificate, err := base64.StdEncoding.DecodeString(encodedClientCertificate)
if err != nil {
return nil, fmt.Errorf("failed to decode client certificate: %w", err)
}

kms.clientCertificate = string(clientCertificate)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assignment is not required anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not required.
assigning it here

err = setConfigString(&kms.clientCertificate, secrets, azureClientCertificate)


return kms, nil
}

Expand Down