code: func getUserName(ctx context.Context, r *http.Request) string {
  	username := dcontext.GetStringValue(ctx, auth.UserNameKey)
  
  	// Fallback to request user with basic auth
  	if username == "" {
  		var ok bool
  		uname, _, ok := basicAuth(r)
  		if ok {
  			username = uname
  		}
  	}
  
  	return username
  }
docs: // getUserName attempts to resolve a username from the context and request. If
  // a username cannot be resolved, the empty string is returned.