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);
|
UserProfileProvider profileProvider = session.getProvider(UserProfileProvider.class);
|
||||||
UPConfig upconfig = profileProvider.getConfiguration();
|
UPConfig upconfig = profileProvider.getConfiguration();
|
||||||
|
|
||||||
Stream<String> attributeNames = upconfig.getAttributes()
|
List<String> attributeNames = upconfig.getAttributes()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(a -> a.getGroup() != null && a.getGroup().equals("de.ccc.hamburg.keycloak.ssh_key.keys"))
|
.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 {
|
try {
|
||||||
AuthHelper.getAuth(
|
AuthHelper.getAuth(
|
||||||
|
|
@ -73,10 +74,11 @@ public class SSHKeyResourceProvider implements RealmResourceProvider {
|
||||||
List<String> keys = users
|
List<String> keys = users
|
||||||
.map(user -> {
|
.map(user -> {
|
||||||
return attributeNames
|
return attributeNames
|
||||||
.map(attributeName -> user.getAttributeStream(attributeName).findFirst())
|
.stream()
|
||||||
.filter(attribute -> attribute.isPresent())
|
.map(attributeName -> user.getAttributeStream(attributeName).findFirst())
|
||||||
.map(attribute -> attribute.get())
|
.filter(attribute -> attribute.isPresent())
|
||||||
.toList();
|
.map(attribute -> attribute.get())
|
||||||
|
.toList();
|
||||||
})
|
})
|
||||||
.flatMap(List::stream)
|
.flatMap(List::stream)
|
||||||
.map(key -> {
|
.map(key -> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue