Method
Authorized
(r *http.Request, w http.ResponseWriter, authSchemes map[string]auth.AuthScheme)
Source from the content-addressed store, hash-verified
| 8 | ) |
| 9 | |
| 10 | func (t *Target) Authorized(r *http.Request, w http.ResponseWriter, authSchemes map[string]auth.AuthScheme) bool { |
| 11 | if t.AuthScheme == "" { |
| 12 | return true |
| 13 | } |
| 14 | |
| 15 | scheme := authSchemes[t.AuthScheme] |
| 16 | |
| 17 | if scheme == nil { |
| 18 | log.Printf("[ERROR] unknown auth scheme '%s'\n", t.AuthScheme) |
| 19 | return false |
| 20 | } |
| 21 | |
| 22 | return scheme.Authorized(r, w) |
| 23 | } |