[#84543682] extract configuration validator

- so that configuration is not too concerned about validation.