MCPcopy
hub / github.com/dgraph-io/dgraph / hasAdminAuth

Function hasAdminAuth

edgraph/server.go:2174–2184  ·  view source on GitHub ↗
(ctx context.Context, tag string)

Source from the content-addressed store, hash-verified

2172var errNoAuth = errors.Errorf("No Auth Token found. Token needed for Admin operations.")
2173
2174func 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
2186func hasPoormansAuth(ctx context.Context) error {
2187 if worker.Config.AuthToken == "" {

Callers 2

validateAlterOperationFunction · 0.85
LoginMethod · 0.85

Calls 3

HasWhitelistedIPFunction · 0.92
InfofMethod · 0.80
hasPoormansAuthFunction · 0.70

Tested by

no test coverage detected