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

Function getUser

audit/interceptor.go:372–388  ·  view source on GitHub ↗
(token string, poorman bool)

Source from the content-addressed store, hash-verified

370}
371
372func getUser(token string, poorman bool) string {
373 if poorman {
374 return PoorManAuth
375 }
376 var user string
377 var err error
378 if token == "" {
379 if x.WorkerConfig.AclEnabled {
380 user = UnauthorisedUser
381 }
382 } else {
383 if user, err = x.ExtractUserName(token); err != nil {
384 user = UnknownUser
385 }
386 }
387 return user
388}
389
390type ResponseWriter struct {
391 http.ResponseWriter

Callers 3

AuditWebSocketsFunction · 0.85
auditGrpcFunction · 0.85
auditHttpFunction · 0.85

Calls 1

ExtractUserNameFunction · 0.92

Tested by

no test coverage detected