mirror of
https://github.com/distribution/distribution.git
synced 2025-09-05 17:01:06 +00:00
add autoredirect auth config
It redirects the user to to the Host header's domain whenever they try to use token auth. Signed-off-by: David Wu <david.wu@docker.com>
This commit is contained in:
committed by
David Wu
parent
16128bbac4
commit
f730f3ab77
@@ -21,7 +21,7 @@
|
||||
// if ctx, err := accessController.Authorized(ctx, access); err != nil {
|
||||
// if challenge, ok := err.(auth.Challenge) {
|
||||
// // Let the challenge write the response.
|
||||
// challenge.SetHeaders(w)
|
||||
// challenge.SetHeaders(r, w)
|
||||
// w.WriteHeader(http.StatusUnauthorized)
|
||||
// return
|
||||
// } else {
|
||||
@@ -87,7 +87,7 @@ type Challenge interface {
|
||||
// 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)
|
||||
SetHeaders(r *http.Request, w http.ResponseWriter)
|
||||
}
|
||||
|
||||
// AccessController controls access to registry resources based on a request
|
||||
|
Reference in New Issue
Block a user