[ 
https://issues.apache.org/jira/browse/KNOX-3424?focusedWorklogId=1039436&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1039436
 ]

ASF GitHub Bot logged work on KNOX-3424:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Sep/26 13:13
            Start Date: 03/Sep/26 13:13
    Worklog Time Spent: 10m 
      Work Description: lmccay commented on code in PR #1373:
URL: https://github.com/apache/knox/pull/1373#discussion_r3924900021


##########
gateway-service-knoxtoken/src/main/java/org/apache/knox/gateway/service/knoxtoken/TokenResource.java:
##########
@@ -1163,26 +1168,65 @@ public ResponseMap(String accessToken, String tokenId, 
Map<String, Object> map,
     }
   }
 
-  private List<String> parseRequestedAudiences() {
+  private List<String> parseRequestedResources() throws 
RequestedAudienceValidationException {
+    // An RFC 8693 token-exchange request carries the requested 
resource/audience in the form body,
+    // which the JWTProvider's TokenExchangeHandler has already parsed and 
validated and stashed as a
+    // request attribute. When present, those body-supplied values take 
precedence over the resource
+    // query parameter.
+    @SuppressWarnings("unchecked")
+    final List<String> fromExchange =
+        (List<String>) 
request.getAttribute(CommonTokenConstants.REQUESTED_AUDIENCES_REQUEST_ATTR);
+    if (fromExchange != null) {
+      return fromExchange;
+    }

Review Comment:
   Okay. Let's move forward here but I think we need to do some careful 
testing. Having no way to ensure that the form body param is chosen over the 
query param without using the JWTProvider may be problematic.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1039436)
    Time Spent: 2h 20m  (was: 2h 10m)

> Dynamic audience handling in the KNOXTOKEN service
> --------------------------------------------------
>
>                 Key: KNOX-3424
>                 URL: https://issues.apache.org/jira/browse/KNOX-3424
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>    Affects Versions: 3.1.0
>            Reporter: Tamás Hanicz
>            Assignee: Tamás Hanicz
>            Priority: Major
>             Fix For: 3.1.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to