necouchman commented on a change in pull request #454: GUACAMOLE-793: CAS
Provider returns Group - like LDAP Provider
URL: https://github.com/apache/guacamole-client/pull/454#discussion_r352386055
##########
File path:
extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
##########
@@ -81,11 +87,13 @@ public CASAuthenticatedUser authenticateUser(Credentials
credentials)
if (request != null) {
String ticket =
request.getParameter(CASTicketField.PARAMETER_NAME);
if (ticket != null) {
- Map<String, String> tokens =
ticketService.validateTicket(ticket, credentials);
+ TokensAndGroups tokensAndGroups =
ticketService.validateTicket(ticket, credentials);
+ Map<String, String> tokens = tokensAndGroups.tokens;
+ Set<String> effectiveGroups = tokensAndGroups.effectiveGroups;
Review comment:
Style needs to conform to the existing standards, which are four space tab
stops. Looks like a couple of these lines have tabs.
I'm also not sure that an entirely separate class is required here for
parsing out tokens and groups. It seems like maybe it would be better to just
have the `validateTicket()` method return the raw attributes, and then have a
utility method - maybe a private one within this class - that parses the
returned attributes for whatever one is configured for group membership,
returning the `effectiveGroups`. The method could either leave the group
membership on for use as a token (if that's of any value) or remove the group
membership attributes(s) from the `Map` such that only the non-group attributes
are left as tokens.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services