(flags *pflag.FlagSet, defaultAuther map[string]interface{})
| 94 | } |
| 95 | |
| 96 | func getProxyAuth(flags *pflag.FlagSet, defaultAuther map[string]interface{}) (auth.Auther, error) { |
| 97 | header, err := flags.GetString("auth.header") |
| 98 | if err != nil { |
| 99 | return nil, err |
| 100 | } |
| 101 | |
| 102 | if header == "" && defaultAuther != nil { |
| 103 | header = defaultAuther["header"].(string) |
| 104 | } |
| 105 | |
| 106 | if header == "" { |
| 107 | return nil, errors.New("you must set the flag 'auth.header' for method 'proxy'") |
| 108 | } |
| 109 | |
| 110 | return &auth.ProxyAuth{Header: header}, nil |
| 111 | } |
| 112 | |
| 113 | func getNoAuth() auth.Auther { |
| 114 | return &auth.NoAuth{} |
no test coverage detected