Skip to content

Commit bb4534a

Browse files
committed
[chores] Wireguard: public_key and allowed_ips shall not be empty
1 parent cc8f9f2 commit bb4534a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

netjsonconfig/backends/openwrt/schema.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,11 @@
726726
"title": "allowed IPs",
727727
"propertyOrder": 2,
728728
"uniqueItems": True,
729-
"items": {"type": "string", "title": "IP/prefix"},
729+
"items": {
730+
"type": "string",
731+
"title": "IP/prefix",
732+
"minLength": 1,
733+
},
730734
},
731735
"endpoint_host": wireguard_peers["endpoint_host"],
732736
"endpoint_port": wireguard_peers["endpoint_port"],

netjsonconfig/backends/wireguard/schema.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@
6161
"title": "public key",
6262
"type": "string",
6363
"maxLength": 44,
64+
"minLength": 1,
6465
"pattern": "^[^\\s]*$",
6566
"propertyOrder": 1,
6667
},
6768
"allowed_ips": {
6869
"title": "allowed IP addresses",
6970
"type": "string",
71+
"minLength": 1,
7072
"propertyOrder": 2,
7173
},
7274
"endpoint_host": {

0 commit comments

Comments
 (0)