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 2021/05/27 17:42:03 UTC

[GitHub] [trafficcontrol] srijeet0406 commented on a change in pull request #5895: Add the ability to CRD CDN Locks

srijeet0406 commented on a change in pull request #5895:
URL: https://github.com/apache/trafficcontrol/pull/5895#discussion_r640836432



##########
File path: traffic_ops/traffic_ops_golang/routing/routes.go
##########
@@ -133,6 +134,12 @@ func Routes(d ServerData) ([]Route, []RawRoute, http.Handler, error) {
 		 * 4.x API
 		 */
 
+		// CDN lock
+		{api.Version{Major: 4, Minor: 0}, http.MethodGet, `cdn_locks/?$`, cdn_lock.Read, auth.PrivLevelReadOnly, Authenticated, nil, 4134390561},
+		{api.Version{Major: 4, Minor: 0}, http.MethodPost, `cdn_locks/?$`, cdn_lock.Create, auth.PrivLevelOperations, Authenticated, nil, 4134390562},
+		{api.Version{Major: 4, Minor: 0}, http.MethodDelete, `cdn_locks/?$`, cdn_lock.Delete, auth.PrivLevelOperations, Authenticated, nil, 4134390564},
+		{api.Version{Major: 4, Minor: 0}, http.MethodDelete, `cdn_locks/admin/?$`, cdn_lock.AdminDelete, auth.PrivLevelAdmin, Authenticated, nil, 4134390565},

Review comment:
       So here's what I was thinking: If an `admin` level user hits the `DELETE` endpoint, it might be because the user wants to delete their own lock, or some other user's lock. That why I wanted to split them out into two different endpoints, one for deleting the user's own locks, and one for other deleting other people's locks (for an admin). However, I could add another query parameter to the DELETE endpoint, saying something like `self=true` to imply that the user wants to delete their own locks. Thoughts?




-- 
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