mirror of https://github.com/docker/docs.git
fixing timestamp key retrieval
Signed-off-by: David Lawrence <david.lawrence@docker.com> (github: endophage)
This commit is contained in:
parent
37bced3efa
commit
47f651ef8a
|
|
@ -63,7 +63,7 @@
|
|||
},
|
||||
{
|
||||
"ImportPath": "github.com/endophage/gotuf",
|
||||
"Rev": "374908abc8af7e953a2813c5c2b3944ab625ca68"
|
||||
"Rev": "5f508200b262dc8f56362523f621417853192812"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/go-sql-driver/mysql",
|
||||
|
|
|
|||
|
|
@ -5,3 +5,9 @@ type ErrMetaNotFound struct{}
|
|||
func (err ErrMetaNotFound) Error() string {
|
||||
return "no trust data available"
|
||||
}
|
||||
|
||||
type ErrKeyNotAvailable struct{}
|
||||
|
||||
func (err ErrKeyNotAvailable) Error() string {
|
||||
return "could not retrieve timestamp public key"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,6 +204,9 @@ func (s HTTPStore) GetKey(role string) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if resp.StatusCode != 200 {
|
||||
return nil, ErrKeyNotAvailable{}
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ func GetTimestampKeyHandler(ctx context.Context, w http.ResponseWriter, r *http.
|
|||
|
||||
key, err := timestamp.GetOrCreateTimestampKey(gun, store, crypto, data.ED25519Key)
|
||||
if err != nil {
|
||||
logrus.Debugf("[Notary Server] 500 GET timestamp key: %s", gun)
|
||||
logrus.Debugf("[Notary Server] 500 GET timestamp key for %s: %v", gun, err)
|
||||
return errors.ErrUnknown.WithDetail(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue