code: func NewDigest(ctx context.Context, next http.Handler, authConfig config.DigestAuth, name string) (http.Handler, error) {
  	middlewares.GetLogger(ctx, name, digestTypeName).Debug("Creating middleware")
  	users, err := getUsers(authConfig.UsersFile, authConfig.Users, digestUserParser)
  	if err != nil {
  		return nil, err
  	}
  
  	da := &digestAuth{
  		next:         next,
  		users:        users,
  		headerField:  authConfig.HeaderField,
  		removeHeader: authConfig.RemoveHeader,
  		name:         name,
  	}
  
  	realm := defaultRealm
  	if len(authConfig.Realm) > 0 {
  		realm = authConfig.Realm
  	}
  	da.auth = goauth.NewDigestAuthenticator(realm, da.secretDigest)
  
  	return da, nil
  }
docs: // NewDigest creates a digest auth middleware.