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 2018/09/28 01:57:34 UTC

[GitHub] mitchell852 commented on a change in pull request #2834: TO Golang: Rewrite /api/*/users endpoints

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

 ##########
 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 don't think you need the .json on the PUT and POST

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services