veracross / consult

Configuration and secrets management for Rails
MIT License
12 stars 0 forks source link

Template validation #44

Open sixfeetover opened 1 year ago

sixfeetover commented 1 year ago

This is a very draft-level initial commit of some template validation logic. At this stage, I am mostly pushing the files as a backup, and to trigger discussion.

This uses dry-validation to define a schema for the section of consult.yml that defines individual templates. In the current form, it does not validate the entire consult.yml file.

Goals

  1. Provide visibility into obvious configuration errors (e.g., having no source or destination configured).
  2. Encourage best practice configuration, such as setting a TTL.

Caveats

There are changes in here (bin/consult, as well as the ERB API change in template.rb) that are not related to template validation that I needed to make to get the code to run properly. I have not debugged why.

aharpervc commented 1 year ago

I rebased your PR on the latest changes from master, but I forgot to add the parameter to preserve the original author, so now it looks like I wrote the commit. We can fix that before merging though.