rimashah25 commented on code in PR #7806:
URL: https://github.com/apache/trafficcontrol/pull/7806#discussion_r1327568914
##########
traffic_ops/testing/api/v5/cdn_federations_test.go:
##########
@@ -220,10 +219,9 @@ func validateCDNFederationCNameSort() utils.CkReqFunc {
return func(t *testing.T, _ toclientlib.ReqInf, resp interface{},
alerts tc.Alerts, _ error) {
assert.RequireNotNil(t, resp, "Expected CDN Federation response
to not be nil.")
var federationCNames []string
- CDNFederationResp := resp.([]tc.CDNFederation)
- for _, CDNFederation := range CDNFederationResp {
- assert.RequireNotNil(t, CDNFederation.CName, "Expected
CDN Federation CName to not be nil.")
Review Comment:
Why are the assert of CName and ID checks removed?
##########
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:
interesting.. I haven't seen api.wrap usage before. What are we achieving
here?
##########
traffic_ops/traffic_ops_golang/cdnfederation/insert.sql:
##########
@@ -0,0 +1,12 @@
+INSERT INTO federation (
Review Comment:
Why different sql files? We normally have these sql statements as part of
the go file.
--
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]