|
|
@ -142,11 +142,14 @@ func (h validateAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
// Access key not found
|
|
|
|
// Access key not found
|
|
|
|
if _, ok := authConfig.Users[accessKeyID]; !ok { |
|
|
|
for _, user := range authConfig.Users { |
|
|
|
writeErrorResponse(w, r, InvalidAccessKeyID, acceptsContentType, r.URL.Path) |
|
|
|
if user.AccessKeyID == accessKeyID { |
|
|
|
return |
|
|
|
h.handler.ServeHTTP(w, r) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
h.handler.ServeHTTP(w, r) |
|
|
|
writeErrorResponse(w, r, InvalidAccessKeyID, acceptsContentType, r.URL.Path) |
|
|
|
|
|
|
|
return |
|
|
|
default: |
|
|
|
default: |
|
|
|
// control reaches here, we should just send the request up the stack - internally
|
|
|
|
// control reaches here, we should just send the request up the stack - internally
|
|
|
|
// individual calls will validate themselves against un-authenticated requests
|
|
|
|
// individual calls will validate themselves against un-authenticated requests
|
|
|
|