ericholguin opened a new issue, #6781: URL: https://github.com/apache/trafficcontrol/issues/6781
<!-- ************ STOP!! ************ If this issue identifies a security vulnerability, DO NOT submit it! Instead, contact the Apache Traffic Control Security Team at [email protected] and follow the guidelines at https://apache.org/security regarding vulnerability disclosure. - For *SUPPORT QUESTIONS*, use the #traffic-control channel on the ASF slack (https://s.apache.org/tc-slack-request) or the Traffic Control Users mailing list (send an email to [email protected] to subscribe). - Before submitting, please **SEARCH GITHUB** for a similar issue or PR * https://github.com/apache/trafficcontrol/issues * https://github.com/apache/trafficcontrol/pulls --> <!-- Do not submit security vulnerabilities or support requests here - see above --> ## This Bug Report affects these Traffic Control components: <!-- delete all those that don't apply --> - Traffic Ops ## Current behavior: <!-- Describe how the bug happens --> When creating a server with multiple profiles, a user can add a profile from a CDN that does not match up with the server's CDN. This was not allowed previously. This occurs when the profile name is not first in the list. ## Expected behavior: <!-- Describe what the behavior would be without the bug --> Should not create the server and return: ```http HTTP/1.1 400 Bad Request { "alerts": [ { "text": "CDN id '1' for profile 'BIND_ALL' does not match Server CDN '2'", "level": "error" } ] } ``` ## Steps to reproduce: <!-- If the current behavior is a bug, please provide the *STEPS TO REPRODUCE* and include the applicable TC version. --> Run the latest code on Ciab or CiaBDev and make a `POST` request to `/api/4.0/servers` with multiple profiles and use a profile that does not match your server's CDN. In the example below `MID_TIER_ATS_CACHE` is in CDN with id 2 and `BIND_ALL` is in CDN with id 1. E.g. ```json { "cachegroupId": 8, "cdnId": 2, "domainName": "test.net", "hostName": "test-01", "interfaces": [ { "ipAddresses": [ { "address": "0.0.0.1", "gateway": "0.0.0.1", "serviceAddress": true } ], "name": "eth0" } ], "physLocationId": 2, "statusId": 3, "typeId": 11, "profileNames": ["MID_TIER_ATS_CACHE", "BIND_ALL"] } ``` If you perform the same request where the profile from a different CDN is the first on the list, it will fail, this should be the expected behavior regardless of profile order. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
