Skip to content

Commit cadef34

Browse files
author
Joël van der Voort van der Kleij
committed
Make error more general as it's also returned when unauthorized to list tokens
1 parent c21632c commit cadef34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/vault-client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func (v *VaultClient) request(method string, url string, requestBody interface{}
7676

7777
// content will be empty with GET, so can be sent anyway
7878
if v == nil || v.baseUri == "" {
79-
return errors.New("Previder vault client not setup")
79+
return errors.New("previder vault client not setup")
8080
}
8181

8282
b := new(bytes.Buffer)
@@ -110,8 +110,8 @@ func (v *VaultClient) request(method string, url string, requestBody interface{}
110110

111111
if res.StatusCode < 200 || res.StatusCode >= 300 {
112112
if res.StatusCode == 401 {
113-
log.Println("Vault token is not authorized to read and decrypt secrets")
114-
return errors.New(fmt.Sprintf("vault token is not authorized to read and decrypt secrets"))
113+
log.Println("Vault token is not authorized for this action")
114+
return errors.New(fmt.Sprintf("vault token is not authorized for this action"))
115115
}
116116
log.Printf("An error was returned: %v, %v\n", res.StatusCode, res.Body)
117117
}

0 commit comments

Comments
 (0)