Skip to content

VPN proposal API POST requires authentication_algorithm in the request body #16780

@locklearxd

Description

@locklearxd

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.

  1. Send a POST request to the API without the "authentication_algorithm" in the request body or "null" as the value.
  2. Receive a response The request failed with code 400 Bad Request: {'authentication_algorithm': ['This field is required.']}
  3. 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.']}

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions