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/03/01 15:58:58 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6577: JWT Authorization

ocket8888 commented on a change in pull request #6577:
URL: https://github.com/apache/trafficcontrol/pull/6577#discussion_r816894644



##########
File path: docs/source/api/v4/users.rst
##########
@@ -168,6 +172,10 @@ Request Structure
 
 	.. note:: This field is optional if and only if tenancy is not enabled in Traffic Control
 
+:ucdn:              The name of the :abbr:`uCDN (Upstream Content Delivery Network)` to which the user belongs
+
+	.. note:: This field is optional and only used if :abbr:`CDNi (Content Delivery Network Interconnect)` is in use.

Review comment:
       Nit: other optional fields just mention in the description that they're optional, rather than having an admonition like this.

##########
File path: docs/source/api/v4/users.rst
##########
@@ -90,6 +90,10 @@ Response Structure
 :stateOrProvince:   The name of the state or province where this user resides
 :tenant:            The name of the tenant to which this user belongs
 :tenantId:          The integral, unique identifier of the tenant to which this user belongs
+:ucdn:              The name of the :abbr:`uCDN (Upstream Content Delivery Network)` to which the user belongs
+
+	.. note:: This field is optional and only used if :abbr:`CDNi (Content Delivery Network Interconnect)` is in use.

Review comment:
       This field is not optional in responses, it will always be shown.

##########
File path: traffic_ops/traffic_ops_golang/cdni/shared.go
##########
@@ -106,6 +107,17 @@ func GetCapabilities(w http.ResponseWriter, r *http.Request) {
 	api.WriteRespRaw(w, r, fciCaps)
 }
 
+func getBearerToken(r *http.Request) string {
+	var bearerToken string
+	for _, cookie := range r.Cookies() {
+		switch cookie.Name {
+		case "access_token":
+			bearerToken = cookie.Value

Review comment:
       you can just `return` at this point to avoid iterating the rest of the cookies when you've already found the one you want.




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