MCPcopy
hub / github.com/fabiolb/fabio / Authorized

Method Authorized

route/auth.go:10–23  ·  view source on GitHub ↗
(r *http.Request, w http.ResponseWriter, authSchemes map[string]auth.AuthScheme)

Source from the content-addressed store, hash-verified

8)
9
10func (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}

Callers 1

TestTarget_AuthorizedFunction · 0.95

Calls 1

AuthorizedMethod · 0.65

Tested by 1

TestTarget_AuthorizedFunction · 0.76