[java-plugin-shibd] branch main updated: JSHIBD-24 - Relationship between Application and RelyingPartyConfiguration interfaces

Codeberg noreply at shibboleth.net
Mon Jul 6 17:00:52 UTC 2026


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

codeberg pushed a commit to branch main
in repository java-plugin-shibd.

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd/commit/5b1582e8dd0273ade5c9e661172eac8f424ba44e

The following commit(s) were added to refs/heads/main by this push:
     new 5b1582e  JSHIBD-24 - Relationship between Application and RelyingPartyConfiguration interfaces
5b1582e is described below

commit 5b1582e8dd0273ade5c9e661172eac8f424ba44e
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Mon Jul 6 13:00:37 2026 -0400

    JSHIBD-24 - Relationship between Application and
    RelyingPartyConfiguration interfaces
    
    https://shibboleth.atlassian.net/browse/JSHIBD-24
    
    Flag authority setting in particular to allow nulling.
---
 .../java/net/shibboleth/sp/service/AgentResolverTest.java     | 11 +++++++++--
 .../net/shibboleth/idp/module/conf/sp/agents-inheritance.xml  |  3 +++
 .../main/java/net/shibboleth/sp/impl/BasicApplication.java    |  6 +++++-
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/sp-conf-impl/src/test/java/net/shibboleth/sp/service/AgentResolverTest.java b/sp-conf-impl/src/test/java/net/shibboleth/sp/service/AgentResolverTest.java
index f33bd73..eb4634c 100644
--- a/sp-conf-impl/src/test/java/net/shibboleth/sp/service/AgentResolverTest.java
+++ b/sp-conf-impl/src/test/java/net/shibboleth/sp/service/AgentResolverTest.java
@@ -112,7 +112,7 @@ public class AgentResolverTest extends AbstractTestNGSpringContextTests {
      * @throws ComponentInitializationException
      * @throws ResolverException
      */
-    @Test public void testInheriting() throws ComponentInitializationException, ResolverException {
+    @Test public void testInheritance() throws ComponentInitializationException, ResolverException {
         resolver = getResolver("/net/shibboleth/idp/module/conf/sp/agents-inheritance.xml");
         
         // Resolve the agent.
@@ -123,7 +123,7 @@ public class AgentResolverTest extends AbstractTestNGSpringContextTests {
         Assert.assertEquals(agent.getCredentials(), creds);
         Assert.assertEquals(agent.getId(), "inherit.example.org");
 
-        Assert.assertEquals(agent.getApplications().size(), 4);
+        Assert.assertEquals(agent.getApplications().size(), 5);
         Assert.assertEquals(agent.getAllowedAddressRanges(),
                 CollectionSupport.singletonList(IPRange.parseCIDRBlock("192.168.0.0/16")));
 
@@ -188,6 +188,7 @@ public class AgentResolverTest extends AbstractTestNGSpringContextTests {
             Assert.assertTrue(basic.getProfileConfigurations(null).isEmpty());
         }
 
+        // THis one is inheriting issuer by leaving it null.
         app = agent.getApplication("override-inherit-issuer");
         assert app != null;
         Assert.assertEquals(app.getId(), "override-inherit-issuer");
@@ -197,6 +198,12 @@ public class AgentResolverTest extends AbstractTestNGSpringContextTests {
         Assert.assertSame(app, rpc);
         Assert.assertEquals(rpc.getIssuer(null), "https://example.org/sp");
         
+        // This is one is overriding authority to null while inheriting in general.
+        app = agent.getApplication("override-null-authority");
+        assert app != null;
+        Assert.assertEquals(app.getId(), "override-null-authority");
+        Assert.assertEquals(app.getApplicationId(), "override-null-authority");
+        Assert.assertNull(app.getAuthenticatingAuthority(null));
         
         // Check default vs. overridden RPC.
         // These are still inherited because by default the globally defined Unverified and Override beans get injected.
diff --git a/sp-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/agents-inheritance.xml b/sp-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/agents-inheritance.xml
index c0a6973..af68b4c 100644
--- a/sp-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/agents-inheritance.xml
+++ b/sp-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/agents-inheritance.xml
@@ -41,6 +41,9 @@
                     p:issuer="https://example.org/override2" />
 
                 <bean p:id="override-inherit-issuer" parent="shibboleth.sp.Application" />
+
+                <bean p:id="override-null-authority" parent="shibboleth.sp.Application"
+                    p:authenticatingAuthority="#{null}" />
             </list>
         </property>
     </bean>
diff --git a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
index 00fcac5..231dfc8 100644
--- a/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
+++ b/sp-server-impl/src/main/java/net/shibboleth/sp/impl/BasicApplication.java
@@ -81,6 +81,9 @@ public class BasicApplication extends BasicRelyingPartyConfiguration implements
     /** Map of protocol support services. */
     @Nonnull Map<String,ProtocolSupportService> protocolServiceMap;
     
+    /** Flag indicating whether authority setting was explicitly set. */
+    private boolean authoritySet;
+    
     /** Lookup strategy for authenticating authority. */
     @Nonnull private Function<ProfileRequestContext,String> authenticatingAuthorityLookupStrategy;
     
@@ -186,7 +189,7 @@ public class BasicApplication extends BasicRelyingPartyConfiguration implements
     /** {@inheritDoc} */
     @Nullable @NotEmpty public String getAuthenticatingAuthority(@Nullable ProfileRequestContext profileRequestContext) {
         final String ret = authenticatingAuthorityLookupStrategy.apply(profileRequestContext);
-        if (ret != null) {
+        if (authoritySet || ret != null) {
             return ret;
         }
         
@@ -206,6 +209,7 @@ public class BasicApplication extends BasicRelyingPartyConfiguration implements
     public void setAuthenticatingAuthority(@Nullable @NotEmpty final String authority) {
         checkSetterPreconditions();
         
+        authoritySet = true;
         authenticatingAuthorityLookupStrategy = FunctionSupport.constant(StringSupport.trimOrNull(authority));
     }
     

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


More information about the commits mailing list