Feilong is a open source z/VM cloud connector project under the Open Mainframe Project umbrella that will accelerate the z/VM adoption, extending its ecosystem and its user experience. It provides a set of APIs to operate z/VM including guest, image, network, volume etc.
The regular expression used to validate "remotehost" parameter has two problems:
the dots (.) should be escaped with \, otherwise they mean "any character" ;
the second and further domain names are made of more than one character, and therefore need a +.
This small python program permits to reproduce the problem in isolation:
import re
rbad = '^[a-zA-Z0-9\-]+\@([0-9]{1,3}(.[0-9]{1,3}){3}$|[a-zA-Z0-9\-]+(.[a-zA-Z0-9\-]){1,}$)'
rok = '^[a-zA-Z0-9\-]+\@([0-9]{1,3}(\.[0-9]{1,3}){3}$|[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]+){1,}$)'
if re.compile(rbad).match("johndoe@test-05.example.us") == None:
print("failed")
else:
print("matched")
Matching fails for johndoe@test-05.example.us, while this is a legitimate user@domain syntax. With the correct regular exception, it works.
The regular expression used to validate "remotehost" parameter has two problems:
.
) should be escaped with\
, otherwise they mean "any character" ;+
.This small python program permits to reproduce the problem in isolation:
Matching fails for
johndoe@test-05.example.us
, while this is a legitimateuser@domain
syntax. With the correct regular exception, it works.Reference: https://cloudlib4zvm.readthedocs.io/en/latest/restapi.html#deploy-guest