From 761bd7c5f28c2d2965545ea3830d3e0f9407bb7c Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Tue, 14 May 2024 16:38:05 +1000 Subject: [PATCH] fix: Revert "fix: revert RawURLEncoding for 1Password" This reverts commit a8224b3d3aecfb7ab7586ce42ae967138945a5ad. --- common/configuration/1password_provider.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/configuration/1password_provider.go b/common/configuration/1password_provider.go index e4817a8dd4..e053fac282 100644 --- a/common/configuration/1password_provider.go +++ b/common/configuration/1password_provider.go @@ -31,7 +31,7 @@ func (o OnePasswordProvider) Load(ctx context.Context, ref Ref, key *url.URL) ([ return nil, fmt.Errorf("1Password CLI tool \"op\" not found: %w", err) } - decoded, err := base64.RawStdEncoding.DecodeString(key.Host) + decoded, err := base64.RawURLEncoding.DecodeString(key.Host) if err != nil { return nil, fmt.Errorf("1Password secret reference must be a base64 encoded string: %w", err) } @@ -56,7 +56,7 @@ func (o OnePasswordProvider) Store(ctx context.Context, ref Ref, value []byte) ( if !strings.HasPrefix(opref, "op://") { return nil, fmt.Errorf("1Password secret reference must start with \"op://\"") } - encoded := base64.RawStdEncoding.EncodeToString([]byte(opref)) + encoded := base64.RawURLEncoding.EncodeToString([]byte(opref)) return &url.URL{Scheme: "op", Host: encoded}, nil }