[java-idp-plugin-oidc-op-oidfed] 03/04: Only apply the default value if the profile specific strategy is not defined
Codeberg
noreply at shibboleth.net
Sun Oct 11 11:49:58 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-idp-plugin-oidc-op-oidfed.
View the commit online:
https://codeberg.org/Shibboleth/java-idp-plugin-oidc-op-oidfed/commit/eef5eb582c4e000c604f72855c428ee9672fbee7
commit eef5eb582c4e000c604f72855c428ee9672fbee7
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Sun Oct 11 14:48:15 2026 +0300
Only apply the default value if the profile specific strategy is not defined
---
.../DefaultPreSelectedTrustChainIDsLookupStrategy.java | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultPreSelectedTrustChainIDsLookupStrategy.java b/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultPreSelectedTrustChainIDsLookupStrategy.java
index 361bdfe..1f3e8e3 100644
--- a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultPreSelectedTrustChainIDsLookupStrategy.java
+++ b/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultPreSelectedTrustChainIDsLookupStrategy.java
@@ -19,7 +19,6 @@ import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;
-import java.util.function.Supplier;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -90,10 +89,11 @@ public class DefaultPreSelectedTrustChainIDsLookupStrategy extends AbstractIdent
@Override @Nullable
public List<String> apply(@Nullable final ProfileRequestContext input) {
checkComponentActive();
- return Optional.ofNullable(profileIdLookupStrategy.apply(input))
+ final Function<ProfileRequestContext,List<String>> profileSpecificStrategy =
+ Optional.ofNullable(profileIdLookupStrategy.apply(input))
.map(profileId -> profileSpecificStrategies.get(profileId))
- .map(function -> function.apply(input))
- .orElseGet(defaultValue(input));
+ .orElse(null);
+ return profileSpecificStrategy != null ? profileSpecificStrategy.apply(input) : defaultValue(input);
}
/**
@@ -102,8 +102,8 @@ public class DefaultPreSelectedTrustChainIDsLookupStrategy extends AbstractIdent
* @param input profile request context
* @return trust chain IDs
*/
- private Supplier<List<String>> defaultValue(@Nullable final ProfileRequestContext input) {
- return () -> Optional.ofNullable(input)
+ private List<String> defaultValue(@Nullable final ProfileRequestContext input) {
+ return Optional.ofNullable(input)
.filter(prc -> prc.getOutboundMessageContext() != null)
.map(prc -> prc.ensureOutboundMessageContext())
.filter(msgCtx -> msgCtx.containsSubcontext(OIDCAuthenticationResponseContext.class))
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list