Skip to content

Commit

Permalink
sdk: fix incorrect policy name concatenation
Browse files Browse the repository at this point in the history
This commit fixes a bug in the SDK introduced by
945afb7. The SDK incorrectly concatenated the
KES server endpoint and the policy name which
usually causes the client request to fail due to
an pattern mismatch.

To reproduce this bug:
```sh
export KES_SERVER=https://play.min.io:7373
export KES_CLIENT_KEY=<root.key>
export KES_CLIENT_CERT=<root.cert>

kes policy list
```
  • Loading branch information
Andreas Auernhammer committed Aug 20, 2020
1 parent 945afb7 commit 8de99b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ func (c *Client) ListPolicies(pattern string) ([]string, error) {
pattern = "*" // => default to: list "all" policies
}
client := retry(c.HTTPClient)
resp, err := client.Get(endpoint(c.Endpoint, "/v1/policy/list", c.Endpoint, url.PathEscape(pattern)))
resp, err := client.Get(endpoint(c.Endpoint, "/v1/policy/list", url.PathEscape(pattern)))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8de99b0

Please sign in to comment.