blinklet / usermapper

Script that creates default authentication XML file for Guacamole
GNU General Public License v3.0
0 stars 0 forks source link

Add error checking for input config file #3

Open blinklet opened 4 years ago

blinklet commented 4 years ago

Need to write some input checking and error handling for config file with helpful messages

blinklet commented 3 years ago

Tools I found that may help:

https://stackoverflow.com/questions/3262569/validating-a-yaml-document-in-python

User "Cerberus"? (because excellent docs) https://github.com/pyeve/cerberus https://docs.python-cerberus.org/en/stable/

Also, "Schema" https://github.com/keleshev/schema

Also, "Pykwalify" (schema is just another easy-to-read yaml file) https://github.com/grokzen/pykwalify

Also, "Yamale" https://github.com/23andMe/Yamale

blinklet commented 3 years ago

Add more error checking code on the loaded configuration file (example: so we do not create crazy-large xml files if someone says there are one million students). Some ideas for config file restrictions: