mirror of
https://github.com/distribution/distribution.git
synced 2025-09-04 16:30:31 +00:00
Simplify auth.Challenge interface to SetHeaders
This removes the erroneous http.Handler interface in favor a simple SetHeaders method that only operattes on the response. Several unnecessary uses of pointer types were also fixed up. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
@@ -61,12 +61,12 @@ type Access struct {
|
||||
// header values based on the error.
|
||||
type Challenge interface {
|
||||
error
|
||||
// ServeHTTP prepares the request to conduct the appropriate challenge
|
||||
// response by adding the appropriate HTTP challenge header on the response
|
||||
// message. Callers are expected to set the appropriate HTTP status code
|
||||
// (e.g. 401) themselves. Because no body is written, users may write a
|
||||
// custom body after calling ServeHTTP.
|
||||
ServeHTTP(w http.ResponseWriter, r *http.Request)
|
||||
|
||||
// SetHeaders prepares the request to conduct a challenge response by
|
||||
// adding the an HTTP challenge header on the response message. Callers
|
||||
// are expected to set the appropriate HTTP status code (e.g. 401)
|
||||
// themselves.
|
||||
SetHeaders(w http.ResponseWriter)
|
||||
}
|
||||
|
||||
// AccessController controls access to registry resources based on a request
|
||||
|
Reference in New Issue
Block a user