You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Setting "allowedips" to a peer with "address": "0.0.0.0" and "mask": 0 fails with response status 400
To Reproduce
Steps to reproduce the behavior:
call /api/v2/vpn/wireguard/peer api with "address": "0.0.0.0" and "mask": 0 set to the object in "allowedips" array.
curl -X 'PATCH'
'https://REDACTED/api/v2/vpn/wireguard/peer'
-H 'accept: application/json'
-H 'x-api-key: REDACTED'
-H 'Content-Type: application/json'
-d '{
"id": 1,
"enabled": false,
"tun": "tun_wg0",
"endpoint": "REDACTED",
"port": "51820",
"descr": "",
"persistentkeepalive": 5,
"publickey": "REDACTED",
"presharedkey": "",
"allowedips": [
{
"address": "0.0.0.0",
"mask": 0,
"descr": ""
}
]
}'
Expected behavior
Since via the GUI the user is allowed to enter in Allowed IPs 0.0.0.0 and in Mask 0, the expected behavior would for the API to return status 200.
Screenshots or Response
{
"code": 400,
"status": "bad request",
"response_id": "NUMERIC_RANGE_VALIDATOR_MINIMUM_CONSTRAINT",
"message": "Field allowedips encountered a nested validation error: Field mask must be greater than or equal to 1. Received 0",
"data": []
}
pfSense Version & Package Version:
pfSense Version: 2.7.2
Package Version v2.2.1
Affected Endpoints:
URL: /api/v2/vpn/wireguard/peer
Additional context
The issue is reported when using PATCH action.
I assume the same will occur when using POST action.
I also assume that this will also happen in:
URL: /api/v2/vpn/wireguard/peer/allowed_ip
URL: /api/v2/vpn/wireguard/peers
The text was updated successfully, but these errors were encountered:
Describe the bug
Setting "allowedips" to a peer with "address": "0.0.0.0" and "mask": 0 fails with response status 400
To Reproduce
Steps to reproduce the behavior:
curl -X 'PATCH'
'https://REDACTED/api/v2/vpn/wireguard/peer'
-H 'accept: application/json'
-H 'x-api-key: REDACTED'
-H 'Content-Type: application/json'
-d '{
"id": 1,
"enabled": false,
"tun": "tun_wg0",
"endpoint": "REDACTED",
"port": "51820",
"descr": "",
"persistentkeepalive": 5,
"publickey": "REDACTED",
"presharedkey": "",
"allowedips": [
{
"address": "0.0.0.0",
"mask": 0,
"descr": ""
}
]
}'
Expected behavior
Since via the GUI the user is allowed to enter in Allowed IPs 0.0.0.0 and in Mask 0, the expected behavior would for the API to return status 200.
Screenshots or Response
{
"code": 400,
"status": "bad request",
"response_id": "NUMERIC_RANGE_VALIDATOR_MINIMUM_CONSTRAINT",
"message": "Field
allowedips
encountered a nested validation error: Fieldmask
must be greater than or equal to1
. Received0
","data": []
}
pfSense Version & Package Version:
Affected Endpoints:
Additional context
The issue is reported when using PATCH action.
I assume the same will occur when using POST action.
I also assume that this will also happen in:
The text was updated successfully, but these errors were encountered: