Skip to content

Commit

Permalink
Differentiate between 'dont have access' and 'invalid key content' in…
Browse files Browse the repository at this point in the history
… knox client (#85)
  • Loading branch information
krockpot authored Sep 12, 2022
1 parent 980b36c commit 3f2d988
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ func (c *HTTPClient) CacheGetKey(keyID string) (*Key, error) {
func (c *HTTPClient) NetworkGetKey(keyID string) (*Key, error) {
key := &Key{}
err := c.getHTTPData("GET", "/v0/keys/"+keyID+"/", nil, key)
if err != nil {
return nil, err
}

// do not return the invalid format remote keys
if key.ID == "" || key.ACL == nil || key.VersionList == nil || key.VersionHash == "" {
Expand Down

0 comments on commit 3f2d988

Please sign in to comment.