forked from p34709852/monkey
Common: Seperate regex for Windows and Linux filenames in CustomPBAConfigurationSchema
This commit is contained in:
parent
f823e9c7ae
commit
cacfb7755d
|
@ -15,14 +15,19 @@ from .agent_sub_configurations import (
|
||||||
)
|
)
|
||||||
from .utils import freeze_lists
|
from .utils import freeze_lists
|
||||||
|
|
||||||
valid_custom_pba_filename_regex = re.compile(r"^([a-zA-Z0-9\ \._-]*)$")
|
valid_windows_custom_pba_filename_regex = re.compile(r"^[^<>:\"\\\/|?*]+[^<>:\"\\\/|?* \.]$")
|
||||||
|
valid_linux_custom_pba_filename_regex = re.compile(r"^[^\\]+$")
|
||||||
|
|
||||||
|
|
||||||
class CustomPBAConfigurationSchema(Schema):
|
class CustomPBAConfigurationSchema(Schema):
|
||||||
linux_command = fields.Str()
|
linux_command = fields.Str()
|
||||||
linux_filename = fields.Str(validate=validate.Regexp(regex=valid_custom_pba_filename_regex))
|
linux_filename = fields.Str(
|
||||||
|
validate=validate.Regexp(regex=valid_linux_custom_pba_filename_regex)
|
||||||
|
)
|
||||||
windows_command = fields.Str()
|
windows_command = fields.Str()
|
||||||
windows_filename = fields.Str(validate=validate.Regexp(regex=valid_custom_pba_filename_regex))
|
windows_filename = fields.Str(
|
||||||
|
validate=validate.Regexp(regex=valid_windows_custom_pba_filename_regex)
|
||||||
|
)
|
||||||
|
|
||||||
@post_load
|
@post_load
|
||||||
def _make_custom_pba_configuration(self, data, **kwargs):
|
def _make_custom_pba_configuration(self, data, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue