From 3e7575594016c28084cc6c89b0c483f78e5a7b4a Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Thu, 9 Nov 2023 15:06:33 -0600 Subject: T5727: Use native URL validator instead of regex-based validator Replace regex-based URL validator with native validator from vyos-utils. Also, move `include/url.xml.i` to `include/url-http-https.xml.i` to reflect the fact that it is used only for HTTP(S) URLs. (cherry picked from commit 64322b19d6968195a6dc7c82e7e22126072377f5) --- interface-definitions/dns-dynamic.xml.in | 2 +- interface-definitions/include/url-http-https.xml.i | 15 +++++++++++++++ interface-definitions/include/url.xml.i | 15 --------------- interface-definitions/service-monitoring-telegraf.xml.in | 6 +++--- interface-definitions/system-update-check.xml.in | 2 +- 5 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 interface-definitions/include/url-http-https.xml.i delete mode 100644 interface-definitions/include/url.xml.i diff --git a/interface-definitions/dns-dynamic.xml.in b/interface-definitions/dns-dynamic.xml.in index a0720f3aa..9f560b063 100644 --- a/interface-definitions/dns-dynamic.xml.in +++ b/interface-definitions/dns-dynamic.xml.in @@ -38,7 +38,7 @@ Options when using HTTP(S) web request to obtain the IP address - #include + #include Pattern to skip from the HTTP(S) respose diff --git a/interface-definitions/include/url-http-https.xml.i b/interface-definitions/include/url-http-https.xml.i new file mode 100644 index 000000000..f763c2bb2 --- /dev/null +++ b/interface-definitions/include/url-http-https.xml.i @@ -0,0 +1,15 @@ + + + + Remote URL + + url + Remote HTTP(S) URL + + + + + Invalid HTTP(S) URL format + + + diff --git a/interface-definitions/include/url.xml.i b/interface-definitions/include/url.xml.i deleted file mode 100644 index caa6f67bd..000000000 --- a/interface-definitions/include/url.xml.i +++ /dev/null @@ -1,15 +0,0 @@ - - - - Remote URL - - url - Remote URL - - - ^https?:\/\/?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\:[0-9]+)*(\/.*)? - - Incorrect URL format - - - diff --git a/interface-definitions/service-monitoring-telegraf.xml.in b/interface-definitions/service-monitoring-telegraf.xml.in index ae0bae900..4d694114a 100644 --- a/interface-definitions/service-monitoring-telegraf.xml.in +++ b/interface-definitions/service-monitoring-telegraf.xml.in @@ -53,7 +53,7 @@ main - #include + #include #include 8086 @@ -145,7 +145,7 @@ Table is limited to alphanumerical characters and can contain hyphen and underscores - #include + #include @@ -271,7 +271,7 @@ - #include + #include #include diff --git a/interface-definitions/system-update-check.xml.in b/interface-definitions/system-update-check.xml.in index e4d7041ec..a7d754003 100644 --- a/interface-definitions/system-update-check.xml.in +++ b/interface-definitions/system-update-check.xml.in @@ -14,7 +14,7 @@ - #include + #include -- cgit v1.2.3