diff --git a/internal/keystore/azure/client.go b/internal/keystore/azure/client.go index c5c36c39..b7d84091 100644 --- a/internal/keystore/azure/client.go +++ b/internal/keystore/azure/client.go @@ -11,7 +11,6 @@ import ( "math" "net/http" "path" - "strings" "time" "github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets" @@ -234,25 +233,3 @@ func (c *client) GetFirstVersion(ctx context.Context, name string) (string, stat Message: fmt.Sprintf("There are no versions of %q.", name), }, nil } - -// endpoint returns an endpoint URL starting with the -// given endpoint followed by the path elements. -// -// For example: -// - endpoint("https://127.0.0.1:7373", "version") => "https://127.0.0.1:7373/version" -// - endpoint("https://127.0.0.1:7373/", "/key/create", "my-key") => "https://127.0.0.1:7373/key/create/my-key" -// -// Any leading or trailing whitespaces are removed from -// the endpoint before it is concatenated with the path -// elements. -// -// The path elements will not be URL-escaped. -func endpoint(endpoint string, elems ...string) string { - endpoint = strings.TrimSpace(endpoint) - endpoint = strings.TrimSuffix(endpoint, "/") - - if len(elems) > 0 && !strings.HasPrefix(elems[0], "/") { - endpoint += "/" - } - return endpoint + path.Join(elems...) -}