Skip to content

Commit

Permalink
[change] Renamed "server_ip_max_prefix" to "server_ip_max_prefix"
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed May 10, 2021
1 parent f50cd3b commit 5b1ae31
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion netjsonconfig/backends/wireguard/wireguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def auto_client(cls, host='', pub_key='', server={}, port=51820, **kwargs):
'public_key': pub_key,
'endpoint_host': host,
'endpoint_port': server.get('port', 51820),
'allowed_ips': [kwargs.get('server_ip_max_prefix', '')],
'allowed_ips': [kwargs.get('server_ip_network', '')],
},
}
4 changes: 2 additions & 2 deletions tests/openwrt/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def test_wireguard_auto_client(self):
host='0.0.0.0',
pub_key='server_public_key',
server={'name': 'wg', 'port': 51820},
server_ip_max_prefix='10.0.0.1/24',
server_ip_network='10.0.0.1/24',
ip_address='10.0.0.2',
),
expected,
Expand Down Expand Up @@ -536,7 +536,7 @@ def test_vxlan_wireguard_auto_client(self):
host='0.0.0.0',
pub_key='server_public_key',
server={'name': 'wg', 'port': 51820},
server_ip_max_prefix='10.0.0.1/24',
server_ip_network='10.0.0.1/24',
vni=1,
server_ip_address='10.0.0.1',
),
Expand Down
4 changes: 2 additions & 2 deletions tests/openwrt/test_wireguard.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_render_wireguard_peer_with_variables(self):
"interface": "wg0",
"public_key": "{{pub_key_8097b09be57a4b278e2ef2ea9ea809f3}}",
"allowed_ips": [
"{{server_ip_max_prefix_8097b09be57a4b278e2ef2ea9ea809f3}}"
"{{server_ip_network_8097b09be57a4b278e2ef2ea9ea809f3}}"
],
"endpoint_host": "{{vpn_host_8097b09be57a4b278e2ef2ea9ea809f3}}",
"endpoint_port": 40840,
Expand All @@ -174,7 +174,7 @@ def test_render_wireguard_peer_with_variables(self):
]
},
context={
"server_ip_max_prefix_8097b09be57a4b278e2ef2ea9ea809f3": "10.0.0.1/32",
"server_ip_network_8097b09be57a4b278e2ef2ea9ea809f3": "10.0.0.1/32",
"vpn_host_8097b09be57a4b278e2ef2ea9ea809f3": "192.168.1.42",
"pub_key_8097b09be57a4b278e2ef2ea9ea809f3": "rn+isMBpyQ4HX6ZzE709bKnZw5IaLZoIS3hIjmfKCkk=",
"pre_key_8097b09be57a4b278e2ef2ea9ea809f3": "oPZmGdHBseaV1TF0julyElNuJyeKs2Eo+o62R/09IB4=",
Expand Down
2 changes: 1 addition & 1 deletion tests/wireguard/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_auto_client(self):
host='0.0.0.0',
pub_key='server_public_key',
server={'name': 'wg', 'port': 51820},
server_ip_max_prefix='10.0.0.1/24',
server_ip_network='10.0.0.1/24',
ip_address='10.0.0.2',
),
expected,
Expand Down

0 comments on commit 5b1ae31

Please sign in to comment.