Skip to content

Commit

Permalink
change cert handling function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Nov 27, 2023
1 parent 402e87d commit 75ffc6a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flow/cmd/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func APIMain(args *APIServerParams) error {
if args.TemporalCert != "" && args.TemporalKey != "" {
log.Info("Using temporal certificate/key for authentication")

certs, err := ProcessCertAndKey(args.TemporalCert, args.TemporalKey)
certs, err := Base64DecodeCertAndKey(args.TemporalCert, args.TemporalKey)
if err != nil {
return fmt.Errorf("unable to process certificate and key: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion flow/cmd/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
)

func ProcessCertAndKey(cert string, key string) ([]tls.Certificate, error) {
func Base64DecodeCertAndKey(cert string, key string) ([]tls.Certificate, error) {
temporalCert := strings.TrimSpace(cert)
certBytes, err := base64.StdEncoding.DecodeString(temporalCert)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion flow/cmd/snapshot_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func SnapshotWorkerMain(opts *SnapshotWorkerOptions) error {
}

if opts.TemporalCert != "" && opts.TemporalKey != "" {
certs, err := ProcessCertAndKey(opts.TemporalCert, opts.TemporalKey)
certs, err := Base64DecodeCertAndKey(opts.TemporalCert, opts.TemporalKey)
if err != nil {
return fmt.Errorf("unable to process certificate and key: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion flow/cmd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func WorkerMain(opts *WorkerOptions) error {

if opts.TemporalCert != "" && opts.TemporalKey != "" {
log.Info("Using temporal certificate/key for authentication")
certs, err := ProcessCertAndKey(opts.TemporalCert, opts.TemporalKey)
certs, err := Base64DecodeCertAndKey(opts.TemporalCert, opts.TemporalKey)
if err != nil {
return fmt.Errorf("unable to process certificate and key: %w", err)
}
Expand Down

0 comments on commit 75ffc6a

Please sign in to comment.