You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:
Traffic Ops
Documentation
Current behavior:
The representations of Users are different depending on the API endpoint used to view them, e.g. /user/current uses the field roleName to hold the name of the User's Role, while /users shows the same information in the rolename property.
The current model for users (API v3.0, 4.0 makes some structural changes in some contexts) is such that requests and responses have different "shapes" depending on the request method - and some fields are even renamed between requests and responses.
responses from POST requests and PUT requests where the password was changed include confirmLocalPasswd but GET representations never do
POST and PUT responses don't include registrationSent but GET requests always do
/users never shows localUser, but /user/current always does
POST and PUT requests allow newUser to be null, but that's actually not allowed in the database, and GET requests will always show an actual boolean value. Plus, if newUser was null in a POST or PUT to /users, it will be null in the response, but if it was null in a PUT to /user/current the response will properly show false like a subsequent GET
PUT to /user/current doesn't require any fields, not even those required by POST and PUT requests to /users, making it non-idempotent in violation of the HTTP spec
and then of course we have the pervasive issue where things are allowed to be missing from the request as a synonym for "null", but that's more an issue just because in TS/JS undefined and null are different, but Go makes no such distinction without jumping through some encoding/json.RawMessage hoops.
New behavior:
Users should be represented consistently in a single way throughout the API.
This Improvement request (usability, performance, tech debt, etc.) affects these Traffic Control components:
Current behavior:
The representations of Users are different depending on the API endpoint used to view them, e.g.
/user/currentuses the fieldroleNameto hold the name of the User's Role, while/usersshows the same information in therolenameproperty.The current model for users (API v3.0, 4.0 makes some structural changes in some contexts) is such that requests and responses have different "shapes" depending on the request method - and some fields are even renamed between requests and responses.
A TypeScript model of Users in APIv3
tenantID, responses havetenantIdconfirmLocalPasswdbut GET representations never doregistrationSentbut GET requests always dolocalUser, but /user/current always doesnewUserto benull, but that's actually not allowed in the database, and GET requests will always show an actual boolean value. Plus, ifnewUserwasnullin a POST or PUT to /users, it will benullin the response, but if it wasnullin a PUT to /user/current the response will properly show false like a subsequent GETand then of course we have the pervasive issue where things are allowed to be missing from the request as a synonym for "null", but that's more an issue just because in TS/JS
undefinedandnullare different, but Go makes no such distinction without jumping through someencoding/json.RawMessagehoops.New behavior:
Users should be represented consistently in a single way throughout the API.