ocket8888 commented on code in PR #7806:
URL: https://github.com/apache/trafficcontrol/pull/7806#discussion_r1329255653


##########
traffic_ops/traffic_ops_golang/routing/routes.go:
##########
@@ -395,10 +395,11 @@ func Routes(d ServerData) ([]Route, http.Handler, error) {
                {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodDelete, Path: `deliveryservices/{xmlID}/urisignkeys$`, Handler: 
urisigning.RemoveDeliveryServiceURIKeysHandler, RequiredPrivLevel: 
auth.PrivLevelAdmin, RequiredPermissions: []string{"DS-SECURITY-KEY:DELETE", 
"DS-SECURITY-KEY:READ", "DELIVERY-SERVICE:READ", "DELIVERY-SERVICE:UPDATE"}, 
Authenticated: Authenticated, Middlewares: nil, ID: 42992541731},
 
                // Federations by CDN (the actual table for federation)
-               {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodGet, Path: `cdns/{name}/federations/?$`, Handler: 
api.ReadHandler(&cdnfederation.TOCDNFederation{}), RequiredPrivLevel: 
auth.PrivLevelReadOnly, RequiredPermissions: []string{"CDN:READ", 
"FEDERATION:READ", "DELIVERY-SERVICE:READ"}, Authenticated: Authenticated, 
Middlewares: nil, ID: 48922503231},
-               {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodPost, Path: `cdns/{name}/federations/?$`, Handler: 
api.CreateHandler(&cdnfederation.TOCDNFederation{}), RequiredPrivLevel: 
auth.PrivLevelAdmin, RequiredPermissions: []string{"FEDERATION:CREATE", 
"FEDERATION:READ, CDN:READ"}, Authenticated: Authenticated, Middlewares: nil, 
ID: 495489421931},
-               {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodPut, Path: `cdns/{name}/federations/{id}$`, Handler: 
api.UpdateHandler(&cdnfederation.TOCDNFederation{}), RequiredPrivLevel: 
auth.PrivLevelAdmin, RequiredPermissions: []string{"FEDERATION:UPDATE", 
"FEDERATION:READ", "CDN:READ"}, Authenticated: Authenticated, Middlewares: nil, 
ID: 42606546631},
-               {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodDelete, Path: `cdns/{name}/federations/{id}$`, Handler: 
api.DeleteHandler(&cdnfederation.TOCDNFederation{}), RequiredPrivLevel: 
auth.PrivLevelAdmin, RequiredPermissions: []string{"FEDERATION:DELETE", 
"FEDERATION:READ", "CDN:READ"}, Authenticated: Authenticated, Middlewares: nil, 
ID: 444285290231},
+               {Version: api.Version{Major: 5, Minor: 0}, Method: 
http.MethodGet, Path: `cdns/{name}/federations/?$`, Handler: 
api.Wrap(cdnfederation.Read, []string{"name"}, nil), RequiredPrivLevel: 
auth.PrivLevelReadOnly, RequiredPermissions: []string{"CDN:READ", 
"FEDERATION:READ", "DELIVERY-SERVICE:READ"}, Authenticated: Authenticated, 
Middlewares: nil, ID: 48922503231},

Review Comment:
   Because you can't just make that change for all of the routes. That requires 
changing the call signatures of the route handlers; such a PR would probably 
never even be reviewed. I had to make a new handler, and I didn't want to use 
the crudder, so I chose to make use of the wrapper. 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to