coheigea commented on code in PR #3809:
URL: https://github.com/apache/cxf/pull/3809#discussion_r4755412764
##########
rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/utils/crypto/ModelEncryptionSupport.java:
##########
@@ -388,17 +396,21 @@ private static String
tokenizeServerToken(ServerAccessToken token) {
state.append(tokenizeString(token.getGrantType()));
// 7: audience
state.append(SEP);
- state.append(token.getAudiences().toString());
+ state.append(tokenizeList(token.getAudiences()));
// 8: other parameters
state.append(SEP);
- // {key=value, key=value}
- state.append(token.getParameters().toString());
+ state.append(tokenizeMap(token.getParameters()));
// 9: permissions
state.append(SEP);
if (token.getScopes().isEmpty()) {
state.append(' ');
} else {
+ boolean first = true;
for (OAuthPermission p : token.getScopes()) {
+ if (!first) {
+ state.append('.');
Review Comment:
The separator has to be . rather than ,: the reader splits the permissions
field on . and consumes the parts in groups of five (permission, description,
default flag, HTTP verbs, URIs), so the permissions form a flat .-separated run
rather than a bracketed list. Using , would merge the previous permission’s URI
list with the next permission’s name. Previously no separator was written at
all, so tokens with more than one permission didn’t round-trip;
testMultiplePermissionsRoundTrip covers this now.
I'll add a comment...
--
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]