As part of the work I am doing on the package in the topic Geneos Golang package I am adding support for sanitising user input for instance names, both with a view to securing of input (Bobby Tables is not welcome here!) but also usability and predictability.
I am not focused on internal data items right now, such as Managed Entities, Samplers and other configuration - but rather the on-disk instances like gateways, probes etc.
Many of the geneos
program commands accepts one or more names for instances, such as “MyGateway” etc. but - and this is the real question - what should be a valid name?
We have, by accident more than design, a special gateway name Demo Gateway
as per Demo Mode and for predictability the gateway name is usually linked to the on-disk directory name and other meta-configuration items. So, I’m having to account for spaces but this makes me wonder if I should also limit the set of valid characters in names? Typical, ASCII-centric, sets would be letters, number and underscore and dash (regexp '^[w-]+$'
) but is this enough for users (i.e. you) ?
It would be nice to support Unicode properly but since Geneos doesn’t internally this would introduce a disconnect between on-disk and config. The Unicode “attacks” on code with LR/RL switches and similar visual characters simply breaks with most of Geneos, so there is unintentional protection already.
In terms of spaces, I am going to simplistically replace them in and out of the user interface in my geneos
with another character, default ‘+’, but keep the space on disk and in config files etc.
Finally, as another consideration, for my geneos
command I am reserving the keywords that describe components, such as “gateway”, “netprobe”, “probe” and others (full list in github) - do any of you call real Geneos instances such generic names? If, as part of an import process, I simply rename them by adding a number on then end will this be a problem?