domainPattern - validation/check.ts
Closed this issue · 1 comments
diva-exchange commented
According to the docs the domainId should be validated against RFC1035, RFC1123.
But validation/check.ts validates against
/^[a-z_0-9]{1,9}$/
This is also not inline with Iroha master, field_validator.cpp which validates the domainId against
const RegexValidator kDomainValidator{
"Domain",
R"#(([a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)*)#"
R"#([a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)#"};
I suggest a relaxed regex within check.ts, like
/^([a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)*[a-zA-Z]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?$/
What are your thoughts on this?