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 2022/02/08 23:08:22 UTC

[GitHub] [trafficcontrol] zrhoffman opened a new issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

zrhoffman opened a new issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548


   <!--
   ************ STOP!! ************
   If this issue identifies a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Traffic Control Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://apache.org/security regarding vulnerability disclosure.
   
   - For *SUPPORT QUESTIONS*, use the #traffic-control channel on the ASF slack (https://s.apache.org/tc-slack-request)
   or the Traffic Control Users mailing list (send an email to users-subscribe@trafficcontrol.apache.org to subscribe).
   - Before submitting, please **SEARCH GITHUB** for a similar issue or PR
       * https://github.com/apache/trafficcontrol/issues
       * https://github.com/apache/trafficcontrol/pulls
   -->
   
   <!-- Do not submit security vulnerabilities or support requests here - see above -->
   ## This Bug Report affects these Traffic Control components:
   <!-- delete all those that don't apply -->
   - Traffic Ops
   
   ## Current behavior:
   <!-- Describe how the bug happens -->
   18 Traffic Ops routes (6 in each TO API version) have a `Route.RequiredPrivLevel` of `0`:
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L225-L229
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L258
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L619-L623
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L652
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L996-L1000
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L1029
   
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L652
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L996-L1000
   
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/routing/routes.go#L1029
   
   There is no constant associated with `RequiredPrivLevel` 0:
   https://github.com/apache/trafficcontrol/blob/1c6c9b8ca190b7d9a527ed48eb31c814b19432f2/traffic_ops/traffic_ops_golang/auth/authorize.go#L82-L97
   
   ## Expected behavior:
   <!-- Describe what the behavior would be without the bug -->
   A constant should be added to the `github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/auth` package for `RequiredPrivLevel` 0, and those routes should be updated to use it.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1058966625


   > @Ayushsunny are you working on this. If not then I would like to work on this issue
   
   Hey, Thank you @sourikghosh Yes you can take it.
   I'm busy with my Uni's test.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1045709252


   Hello @zrhoffman I would like to fix this issue.
   but I need some help here `those routes should be updated to use it`


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] sourikghosh commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
sourikghosh commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1058806061


   @Ayushsunny are you working on this. If not then I would like to work on this issue 
   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] srijeet0406 commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
srijeet0406 commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1050162659


   @Ayushsunny So the basic idea is not using the magic numeral `0` in those routes. Instead, you create a constant like
   `const PrivLevel<Whatever you want to name it> = 0` in the `authorize.go` file and then use this new name in place of the 0's in the routes that Zach mentioned.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1045962002


   > Hello @zrhoffman I would like to fix this issue. but I need some help here `those routes should be updated to use it`
   
   Would you please expand on what help you are looking for?


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman edited a comment on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1045970979


   > Like first we will add `const RequiredPrivLevel = 0` on auth, right?
   
   The new `const` should not be named `RequiredPrivLevel`. `RequiredPrivLevel` is just the name of a certain field in the `routing.Route` struct: https://github.com/apache/trafficcontrol/blob/1398c02a80dfd4090881f8f90961c11ff57feeaa/traffic_ops/traffic_ops_golang/routing/routing.go#L51-L62
   
   > then how we are going to update those routes to use it
   
   Instances of the `routing.Route` struct that set the `RequiredPrivLevel` field to `0` should have that `0` be replaced with the new `const`.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1046792462


   I'm still little confused here.
   sorry if I wasted your time but I think I need more clarity for doing this or I can leave this issue.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman closed issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
zrhoffman closed issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548


   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] sourikghosh commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
sourikghosh commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1059069920


   @zrhoffman  @srijeet0406 any suggestion for a proper name for this const


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1045970979


   > Like first we will add `const RequiredPrivLevel = 0` on auth, right?
   
   The new `const` should not be named `RequiredPrivLevel`. `RequiredPrivLevel` is just the name of a certain field in the `routing.Route` struct: https://github.com/apache/trafficcontrol/blob/1398c02a80dfd4090881f8f90961c11ff57feeaa/traffic_ops/traffic_ops_golang/routing/routing.go#L51-L62
   
   > then how we are going to update those routes to use it
   
   Instances of the `routing.Route` struct that set `RequiredPrivLevel` to `0` should have `0` be replaced with the new `const`.


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] Ayushsunny commented on issue #6548: Some routes use hard-coded `RequiredPrivLevel` 0

Posted by GitBox <gi...@apache.org>.
Ayushsunny commented on issue #6548:
URL: https://github.com/apache/trafficcontrol/issues/6548#issuecomment-1045964025


   Like first we will add  `const RequiredPrivLevel = 0` on auth, right?
   then how we are going to update those routes to use it
   
   


-- 
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: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org