[java-idp-oidc] branch main updated: JOIDC-182 - Spurious warning "File resource is null, no bytes will be returned"

Henri Mikkonen henri.mikkonen at iki.fi
Fri Mar 1 14:08:50 UTC 2024


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

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

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

The following commit(s) were added to refs/heads/main by this push:
     new e76a177d JOIDC-182 - Spurious warning "File resource is null, no bytes will be returned"
e76a177d is described below

commit e76a177d34c44749df28933fb5ed3da018c3facb
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Mar 1 16:07:41 2024 +0200

    JOIDC-182 - Spurious warning "File resource is null, no bytes will be returned"
    
    https://shibboleth.atlassian.net/browse/JOIDC-182
    
    Refactored the wiring of idp.oidc.dynreg.defaultMetadataPolicyFile -property to have a
    default value of %{idp.home}/conf/oidc-dynreg-profile-policy.json.
    
    The ConditionalResource type is exploited there so that if the file doesn’t exist,
    then an empty policy (contents {}) is used instead of producing the WARN-line to the logs.
---
 .../shibboleth/idp/service/relying-party/postconfig.xml  | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/service/relying-party/postconfig.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/service/relying-party/postconfig.xml
index 94e42913..71d77b25 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/service/relying-party/postconfig.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/service/relying-party/postconfig.xml
@@ -756,13 +756,21 @@
     </bean>
 
     <bean id="shibboleth.oidc.dyngreg.DefaultMetadataPolicyFilename" class="java.lang.String" factory-method="valueOf">
-        <constructor-arg value="%{idp.oidc.dynreg.defaultMetadataPolicyFile:}" />
+        <constructor-arg value="%{idp.oidc.dynreg.defaultMetadataPolicyFile:%{idp.home}/conf/oidc-dynreg-profile-policy.json}" />
     </bean>
 
     <bean id="shibboleth.oidc.dynreg.DefaultMetadataPolicyLookupStrategy"
         parent="shibboleth.oidc.dynreg.MetadataPolicyLookupStrategy"
-        c:resource-ref="shibboleth.oidc.dyngreg.DefaultMetadataPolicyFilename"
-        c:id="DefaultProfileMetadataPolicyCache" />
+        c:id="DefaultProfileMetadataPolicyCache">
+        <constructor-arg name="resource">
+            <bean class="net.shibboleth.shared.spring.resource.ConditionalResource" p:defaultContent="{}">
+                <constructor-arg>
+                    <bean class="org.springframework.core.io.FileSystemResource"
+                        c:path-ref="shibboleth.oidc.dyngreg.DefaultMetadataPolicyFilename" />
+                </constructor-arg>
+            </bean>
+        </constructor-arg>
+    </bean>
 
     <bean id="shibboleth.oidc.dynreg.BatchMetadataCacheBuilderSpec"
         class="net.shibboleth.oidc.metadata.cache.impl.BatchMetadataCacheBuilderSpec"
@@ -790,7 +798,7 @@
 
     <bean id="shibboleth.oidc.dynreg.MetadataPolicyLookupStrategy" abstract="true"
         factory-bean="shibboleth.oidc.dynreg.MetadataPolicyLookupStrategyFactory" 
-        factory-method="buildFileLoadingMetadataPolicyResolver"
+        factory-method="buildResourceLoadingMetadataPolicyResolver"
         c:cacheSpec-ref="shibboleth.oidc.dynreg.BatchMetadataCacheBuilderSpec" 
         c:criteriaSetLookupStrategy="#{null}"/>
 

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


More information about the commits mailing list