Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

servers endpoint lacks several validation checks #4525

@ericholguin

Description

@ericholguin

I'm submitting a ...

  • bug report
  • new feature / enhancement request
  • improvement request (usability, performance, tech debt, etc.)
  • other

Traffic Control components affected ...

  • CDN in a Box
  • Documentation
  • Grove
  • Traffic Control Client
  • Traffic Monitor
  • Traffic Ops
  • Traffic Ops ORT
  • Traffic Portal
  • Traffic Router
  • Traffic Stats
  • Traffic Vault
  • unknown

Current behavior:

When making a POST request to /servers with any of the following keys in the body:

ipGateway, ip6Gateway, ipNetmask, iloIpAddress, iloIpGateway, iloIpNetmask, mgmtIpAddress, mgmtIpGateway, mgmtIpNetmask

There are no checks performed to validate that they are valid IP Addresses.

Traffic Portal also doesn't perform any checks on any of these fields in the server page, However it doesn't allow for an invalid IP Netmask, while TO does.

Traffic portal also doesn't allow a Router Hostname to have spaces, but TO doesn't perform this check and a Router Hostname with spaces is allowed.

Expected / new behavior:

Traffic Ops should not allow a server to be created with invalid Ip addresses and not allow a routerHostName with spaces these should return:

HTTP/1.1 400 Bad Request
Content-Type: application/json
{
    "alerts": [
        {
            "text": "<key> must be a valid IPv4 address",
            "level": "error"
        }
    ]
}

OR

HTTP/1.1 400 Bad Request
Content-Type: application/json
{
    "alerts": [
        {
            "text": "<key> must be a valid IPv6 address",
            "level": "error"
        }
    ]
}

OR

HTTP/1.1 400 Bad Request
Content-Type: application/json
{
    "alerts": [
        {
            "text": "'routerHostName' cannot contain spaces",
            "level": "error"
        }
    ]
}

Traffic Portal should display a red outline around the text box with the word "Invalid" underneath.
See screenshot below.
Screen Shot 2020-03-19 at 4 57 53 PM

Minimal reproduction of the problem with instructions:

Anything else:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Traffic Opsrelated to Traffic OpsTraffic Portal v1related to Traffic Portal version 1improvementThe functionality exists but it could be improved in some way.low impactaffects only a small portion of a CDN, and cannot itself break one

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions