GUACAMOLE-1364: Merge do not rely on Collectors.toUnmodifiableMap().

This commit is contained in:
Virtually Nick
2021-11-22 20:20:53 -05:00
committed by GitHub

View File

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