Validateur middleware and helper functions for Ring