Browse Source

fix: bitwarden API url to point to the correct default location (#3848)

* fix: bitwarden API url to point to the correct default location

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

* explicitly remove trailing slashes to prevent not found error

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>

---------

Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Gergely Brautigam 1 year ago
parent
commit
c3dcd9adcd

+ 1 - 1
docs/snippets/bitwarden-secrets-manager-secret-store.yaml

@@ -5,7 +5,7 @@ metadata:
 spec:
   provider:
     bitwardensecretsmanager:
-      apiURL: https://vault.bitwarden.com
+      apiURL: https://api.bitwarden.com
       identityURL: https://identity.bitwarden.com
       auth:
         secretRef:

+ 3 - 2
pkg/provider/bitwarden/bitwarden_sdk.go

@@ -21,6 +21,7 @@ import (
 	"fmt"
 	"io"
 	"net/http"
+	"strings"
 
 	"sigs.k8s.io/controller-runtime/pkg/client"
 
@@ -111,8 +112,8 @@ func NewSdkClient(ctx context.Context, c client.Client, storeKind, namespace str
 	}
 
 	return &SdkClient{
-		apiURL:                provider.APIURL,
-		identityURL:           provider.IdentityURL,
+		apiURL:                strings.TrimSuffix(provider.APIURL, "/"),
+		identityURL:           strings.TrimSuffix(provider.IdentityURL, "/"),
 		bitwardenSdkServerURL: provider.BitwardenServerSDKURL,
 		token:                 token,
 		client:                httpsClient,