moltzaum commented on a change in pull request #2834: TO Golang: Rewrite 
/api/*/users endpoints
URL: https://github.com/apache/trafficcontrol/pull/2834#discussion_r222093016
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/routes.go
 ##########
 @@ -154,6 +154,19 @@ func Routes(d ServerData) ([]Route, []RawRoute, 
http.Handler, error) {
                {1.1, http.MethodGet, 
`user/{id}/deliveryservices/available/?(\.json)?$`, user.GetAvailableDSes, 
auth.PrivLevelReadOnly, Authenticated, nil},
                {1.1, http.MethodPost, `user/login/?$`, 
login.LoginHandler(d.DB, d.Config), 0, NoAuth, nil},
 
+               //User: CRUD (1.4 then 1.1)
+               //Incrementing version for users because change to Nullable 
struct. Delete is completely new.
+               {1.4, http.MethodGet, `users/?(\.json)?$`, 
api.ReadHandler(user.GetTypeSingleton()), auth.PrivLevelReadOnly, 
Authenticated, nil},
+               {1.4, http.MethodGet, `users/{id}?(\.json)?$`, 
api.ReadHandler(user.GetTypeSingleton()), auth.PrivLevelReadOnly, 
Authenticated, nil},
+               {1.4, http.MethodPut, `users/{id}?(\.json)?$`, 
api.UpdateHandler(user.GetTypeSingleton()), auth.PrivLevelOperations, 
Authenticated, nil},
 
 Review comment:
   I'll keep the json since some other endpoints have it. Fixed the bug.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to