GUACAMOLE-1364: Do not rely on Collectors.toUnmodifiableMap() as it is not part of Java 8.

This commit is contained in:
Michael Jumper
2021-11-22 15:10:36 -08:00
parent 3162a3b4f7
commit cce63e74c4

View File

@@ -92,13 +92,13 @@ public class SAMLAuthenticatedUser extends AbstractAuthenticatedUser {
* for substitution as parameter tokens.
*/
private Map<String, String> getTokens(AssertedIdentity identity) {
return identity.getAttributes().entrySet()
return Collections.unmodifiableMap(identity.getAttributes().entrySet()
.stream()
.filter((entry) -> !entry.getValue().isEmpty())
.collect(Collectors.toUnmodifiableMap(
.collect(Collectors.toMap(
(entry) -> TokenName.canonicalize(entry.getKey(), SAML_ATTRIBUTE_TOKEN_PREFIX),
(entry) -> entry.getValue().get(0)
));
)));
}
/**