Plugin name validation should be more strict
Closed this issue · 1 comments
What problem are you trying to solve? Please describe.
Eg. I'm always frustrated when [...]
A plugin does not get loaded into MITRE CALDERA when the plugin name contains "." or "/".
The current code checks only that the plugin name does not contain spaces.
The ideal solution: What should the feature should do?
a clear and concise description
I strongly recommend for the plugin names to follow the "identifier" syntax
and use of name.isidentifier() to validate the plugin name more strictly.
(c.f. https://docs.python.org/3/reference/lexical_analysis.html#identifiers)
What category of feature is this?
- UI/UX
- API
- Other
If you have code or pseudo-code please provide:
Current code:
def is_valid_plugin_name(name):
if len(name.split(' ')) == 1:
return True
return False
Suggested code:
def is_valid_plugin_name(name):
return name.isidentifier()
- Willing to submit a pull request to implement this feature?
Additional context
Add any other context or screenshots about the feature request here.
Nothing.
Awesome, great suggestion!
It's been added