fix: use list instead of consumed stream

This commit is contained in:
kritzl 2025-11-01 01:49:54 +01:00 committed by June
commit c60c4978df
No known key found for this signature in database

View file

@ -53,10 +53,11 @@ public class SSHKeyResourceProvider implements RealmResourceProvider {
UserProfileProvider profileProvider = session.getProvider(UserProfileProvider.class);
UPConfig upconfig = profileProvider.getConfiguration();
Stream<String> attributeNames = upconfig.getAttributes()
List<String> attributeNames = upconfig.getAttributes()
.stream()
.filter(a -> a.getGroup() != null && a.getGroup().equals("de.ccc.hamburg.keycloak.ssh_key.keys"))
.map(a -> a.getName());
.map(a -> a.getName())
.toList();
try {
AuthHelper.getAuth(
@ -73,6 +74,7 @@ public class SSHKeyResourceProvider implements RealmResourceProvider {
List<String> keys = users
.map(user -> {
return attributeNames
.stream()
.map(attributeName -> user.getAttributeStream(attributeName).findFirst())
.filter(attribute -> attribute.isPresent())
.map(attribute -> attribute.get())