code: func NewValidator(method *structs.ACLAuthMethod) (Validator, error) {
  	typesMu.RLock()
  	factory, ok := types[method.Type]
  	typesMu.RUnlock()
  
  	if !ok {
  		return nil, fmt.Errorf("no auth method registered with type: %s", method.Type)
  	}
  
  	return factory(method)
  }
docs: // NewValidator instantiates a new Validator for the given auth method
  // configuration. If no auth method is registered with the provided type an
  // error is returned.