fix: use list instead of consumed stream
This commit is contained in:
parent
119a89f2ee
commit
c60c4978df
1 changed files with 8 additions and 6 deletions
|
|
@ -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,10 +74,11 @@ public class SSHKeyResourceProvider implements RealmResourceProvider {
|
|||
List<String> keys = users
|
||||
.map(user -> {
|
||||
return attributeNames
|
||||
.map(attributeName -> user.getAttributeStream(attributeName).findFirst())
|
||||
.filter(attribute -> attribute.isPresent())
|
||||
.map(attribute -> attribute.get())
|
||||
.toList();
|
||||
.stream()
|
||||
.map(attributeName -> user.getAttributeStream(attributeName).findFirst())
|
||||
.filter(attribute -> attribute.isPresent())
|
||||
.map(attribute -> attribute.get())
|
||||
.toList();
|
||||
})
|
||||
.flatMap(List::stream)
|
||||
.map(key -> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue