-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Deployment Type
Self-hosted
NetBox Version
v4.0.6
Python Version
3.10
Steps to Reproduce
This can be done via CURL natively in the API via Swagger UI. Confirmed with a raw request.
- Send a POST request to the API without the "authentication_algorithm" in the request body or "null" as the value.
- Receive a response The request failed with code 400 Bad Request: {'authentication_algorithm': ['This field is required.']}
- OR receive a response The request failed with code 400 Bad Request: {'authentication_algorithm': ['null is not a valid choice.']}
Expected Behavior
The web interface supports creation of IKE proposals without an authentication algorithm in the cases where no auth is specified. This creates an object like so visible in the API:
{
"id": 1,
"url": "https://netbox_fqdn_here/api/vpn/ike-proposals/1/",
"display": "default",
"name": "default",
"description": "",
"authentication_method": {
"value": "preshared-keys",
"label": "Pre-shared keys"
},
"encryption_algorithm": {
"value": "aes-128-cbc",
"label": "128-bit AES (CBC)"
},
"authentication_algorithm": null,
"group": {
"value": 2,
"label": "Group 2"
},
"sa_lifetime": null,
"comments": "",
"tags": [],
"custom_fields": {},
"created": "2024-07-01T18:36:23.031219Z",
"last_updated": "2024-07-01T18:52:15.841523Z"
}
So clearly a null value is intended to be supported and should be supported via API as well.
I expected the API to support either the request body to have this as optional or support a null value. It does not appear to.
Observed Behavior
400 Bad Request: {'authentication_algorithm': ['This field is required.']}
400 Bad Request: {'authentication_algorithm': ['null is not a valid choice.']}