[
https://issues.apache.org/jira/browse/KNOX-3424?focusedWorklogId=1039259&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1039259
]
ASF GitHub Bot logged work on KNOX-3424:
----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Sep/26 17:05
Start Date: 02/Sep/26 17:05
Worklog Time Spent: 10m
Work Description: lmccay commented on code in PR #1373:
URL: https://github.com/apache/knox/pull/1373#discussion_r3916619548
##########
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:
I'm not sure that I like how this is being done. We are leaking exchange
specifics into the API service which should only be about issuing tokens.
Perhaps this is happening already elsewhere but I want to be careful not to do
this.
Issue Time Tracking
-------------------
Worklog Id: (was: 1039259)
Time Spent: 1h 50m (was: 1h 40m)
> 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: 1h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)