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

Function LoadAuthSchemes

auth/auth.go:14–30  ·  view source on GitHub ↗
(cfg map[string]config.AuthScheme)

Source from the content-addressed store, hash-verified

12}
13
14func LoadAuthSchemes(cfg map[string]config.AuthScheme) (map[string]AuthScheme, error) {
15 auths := map[string]AuthScheme{}
16 for _, a := range cfg {
17 switch a.Type {
18 case "basic":
19 b, err := newBasicAuth(a.Basic)
20 if err != nil {
21 return nil, err
22 }
23 auths[a.Name] = b
24 default:
25 return nil, fmt.Errorf("unknown auth type '%s'", a.Type)
26 }
27 }
28
29 return auths, nil
30}

Callers 2

newHTTPProxyFunction · 0.92
TestLoadAuthSchemesFunction · 0.85

Calls 1

newBasicAuthFunction · 0.85

Tested by 1

TestLoadAuthSchemesFunction · 0.68