[java-idp-plugin-oidc-op-oidfed] 01/02: Check the map type before parsing it to metadata.

Henri Mikkonen henri.mikkonen at iki.fi
Thu Sep 11 10:24:24 UTC 2025


This is an automated email from the git hooks/post-receive script.

hjmikkon pushed a commit to branch main
in repository java-idp-plugin-oidc-op-oidfed.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-op-oidfed.git;a=commit;h=b0beb420cc9273d76c2fdbed6dc24c39e7c0d417

commit b0beb420cc9273d76c2fdbed6dc24c39e7c0d417
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Thu Sep 11 13:23:06 2025 +0300

    Check the map type before parsing it to metadata.
    
    This removes the unsafe/unchecked warning
---
 .../navigate/DefaultSelectedTrustChainMetadataLookupStrategy.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultSelectedTrustChainMetadataLookupStrategy.java b/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultSelectedTrustChainMetadataLookupStrategy.java
index bd42f6e..b34a826 100644
--- a/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultSelectedTrustChainMetadataLookupStrategy.java
+++ b/idp-oidfed-op-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oidfed/profile/navigate/DefaultSelectedTrustChainMetadataLookupStrategy.java
@@ -16,6 +16,7 @@ package net.shibboleth.idp.plugin.oidc.op.oidfed.profile.navigate;
 
 import java.util.Map;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -40,7 +41,10 @@ public class DefaultSelectedTrustChainMetadataLookupStrategy
                 .map(pair -> pair.getSecond())
                 .map(map -> map.get("openid_relying_party"))
                 .filter(Map.class::isInstance)
-                .map(Map.class::cast)
+                .map(obj -> (Map<?,?>) obj)
+                .map(map -> map.entrySet().stream()
+                        .filter(e -> e.getKey() instanceof String && e.getValue() != null)
+                        .collect(Collectors.toMap(e -> (String) e.getKey(), e -> e.getValue())))
                 .map(JSONObject::new)
                 .map(json-> {
                     try {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list