You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/08/13 19:25:39 UTC

[GitHub] [trafficcontrol] rob05c opened a new issue #3868: Prevent Creating Objects With Names that are Numbers.

rob05c opened a new issue #3868: Prevent Creating Objects With Names that are Numbers.
URL: https://github.com/apache/trafficcontrol/issues/3868
 
 
   ## I'm submitting a ...
   - [ ] bug report
   - [x] new feature / enhancement request
   - [ ] improvement request (usability, performance, tech debt, etc.)
   - [ ] other <!--(Please do not submit support requests here - see above)-->
   
   ## Traffic Control components affected ...
   - [ ] CDN in a Box
   - [ ] Documentation
   - [ ] Grove
   - [ ] Traffic Control Client
   - [ ] Traffic Monitor
   - [x] Traffic Ops
   - [ ] Traffic Ops ORT
   - [ ] Traffic Portal
   - [ ] Traffic Router
   - [ ] Traffic Stats
   - [ ] Traffic Vault
   - [ ] unknown
   
   ## Current behavior:
   
   Objects with names that are numbers can be created.
   
   ## Expected / new behavior:
   
   Prevent creating objects with names that are numbers.
   
   ## Minimal reproduction of the problem with instructions:
   
   Currently, you can create objects -- CDNs, Profiles, Delivery Services, Servers -- basically any object, whose name (CDN Name, Profile Name, DS xmlId, Server HostName, etc). These names can then be queried from API endpoints, and clients expect to get a single response. 
   
   Further, many API endpoints accept either a name or ID in the same path segment.
   
   What then happens when a user requests `cdns/id-or-name` for an object with a name which is a valid ID of a different object?
   
   We should **not** do anything to break upon existing data. If some Traffic Control user has names which are IDs, and is somehow using them successfully, we should not cause them to break.
   
   But we should prevent new objects, for every object type with a name, from being created with a name that is strictly a number. We have never supported that, and it has never worked correctly with the API. It is better to explicitly prohibit it and return an error when trying to create, than to let users create it and get difficult errors when later using it.
   
   In the future, for "API 2.0," we could design an API which can unambiguously handle names that are numbers. But the current API simply does not work with numeric names, in numerous places, both at the API and internal code level, and so it should be prevented.
   
   `#footgun`
   
   ## Anything else:
   
   No.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services