(ctx context.Context, tag string)
| 2172 | var errNoAuth = errors.Errorf("No Auth Token found. Token needed for Admin operations.") |
| 2173 | |
| 2174 | func hasAdminAuth(ctx context.Context, tag string) (net.Addr, error) { |
| 2175 | ipAddr, err := x.HasWhitelistedIP(ctx) |
| 2176 | if err != nil { |
| 2177 | return nil, err |
| 2178 | } |
| 2179 | glog.Infof("Got %s request from: %q\n", tag, ipAddr) |
| 2180 | if err = hasPoormansAuth(ctx); err != nil { |
| 2181 | return nil, err |
| 2182 | } |
| 2183 | return ipAddr, nil |
| 2184 | } |
| 2185 | |
| 2186 | func hasPoormansAuth(ctx context.Context) error { |
| 2187 | if worker.Config.AuthToken == "" { |
no test coverage detected