Global node name validation in VyConf
Open, NormalPublic

Description

@cbuechler pointed out in T253 how problematic insufficient node name validation can be. You can use something like "set foo bar \"baz quuz\" xyzzy 42" as a configuration command, and unless the tag node "bar" has a name constraint that disallows it, it will work, and make it to the running config. But when the user saves that config, it will be syntactically incorrect and will fail to load.

Since neither the shell nor the API message decoder can do anything about it, I guess this should be a part of path validation in the Reference_tree. Before checking the name constraint, it should verify that the name matches [^\s\{\}\[\]\"\']+ expression.

An alternative would be to make the config formatter quote identifiers that contain those characters, but tag node names are, in all known real life cases, things that naturally must not have any such characters in them, like network interface names, usernames, FQDNs and similar.

If valid use for tag nodes with spaces will ever be found, change to the alternative approach with quoting can be made in a forward-compatible manner, so there are no compatibility concerns.

Details

Difficulty level
Easy (less than an hour)
dmbaturin created this object with edit policy "Administrators".