sops icon indicating copy to clipboard operation
sops copied to clipboard

provide JSON Schema to allow validating config file

Open KiaraGrouwstra opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe. We now have a sample config, which helps users get going to tweak their own setup. However, we currently do not yet offer static checks to help validate these.

Describe the solution you'd like It would be nice to offer a JSON Schema file for config validation, including by LSP language servers such as yaml-language-server.

Describe alternatives you've considered not make mistakes

Additional context n/a

KiaraGrouwstra avatar Feb 23 '25 12:02 KiaraGrouwstra

I think there was an issue or discussion before where validation of .sops.yaml files came up, but I can't find it right now. It would be great to have validation, either as a sops subcommand or as a JSON schema (or both), but it would be best if that could be automatically extracted from the existing data structures.

It looks like there is a library which creates JSON schemas from Go data structures: https://github.com/invopop/jsonschema So this should be doable. (Actually both: creating a standalone JSON schema, and creating a config validation subcommand that uses the schema to do the validation.)

felixfontein avatar Feb 23 '25 13:02 felixfontein