Skip to content

Commit

Permalink
fix: Revert "fix: revert RawURLEncoding for 1Password"
Browse files Browse the repository at this point in the history
This reverts commit a8224b3.
  • Loading branch information
alecthomas committed May 14, 2024
1 parent 1e079ab commit 761bd7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/configuration/1password_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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
}

Expand Down

0 comments on commit 761bd7c

Please sign in to comment.