[java-plugin-shibd-saml] branch main updated: JSHIBD-26 - Review incrementing of profile metric in various flows

Codeberg noreply at shibboleth.net
Wed Oct 14 16:47:12 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-saml.

View the commit online:
https://codeberg.org/Shibboleth/java-plugin-shibd-saml/commit/d78d99788f6038a1f0928db52c4bfde4c065db06

The following commit(s) were added to refs/heads/main by this push:
     new d78d997  JSHIBD-26 - Review incrementing of profile metric in various flows
d78d997 is described below

commit d78d99788f6038a1f0928db52c4bfde4c065db06
Author: Scott Cantor <scott at restingparrotsoftware.com>
AuthorDate: Wed Oct 14 12:47:03 2026 -0400

    JSHIBD-26 - Review incrementing of profile metric in various flows
    
    https://shibboleth.atlassian.net/browse/JSHIBD-26
    
    Add profile counter handling to consumer subflows.
    Add missing logging/profileID beans to token consumer.
---
 .../shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml    | 11 ++++++++++-
 .../net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml |  1 +
 .../idp/flows/sp/logout/consumer/saml2/saml2-beans.xml        |  4 ++++
 .../idp/flows/sp/logout/consumer/saml2/saml2-flow.xml         |  1 +
 .../profile/config/impl/BrowserSSOProfileConfiguration.java   |  3 +++
 .../profile/config/impl/SingleLogoutProfileConfiguration.java |  3 +++
 6 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
index 611837b..7f957c6 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-beans.xml
@@ -5,10 +5,19 @@
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
-    default-init-method="initialize" default-destroy-method="destroy">
+    default-init-method="initialize"
+    default-destroy-method="destroy">
 
     <import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/saml2-common-beans.xml" />
 
+    <util:constant id="shibboleth.sp.profileId"
+        static-field="net.shibboleth.saml.saml2.profile.config.BrowserSSOProfileConfiguration.PROFILE_ID" />
+
+    <bean id="shibboleth.sp.loggingId" class="java.lang.String" c:_0="%{sp.saml.service.logging.token-consumer:TokenConsumer.SAML2}" />
+
+    <util:constant id="shibboleth.metrics.ProfileCounter"
+        static-field="net.shibboleth.sp.saml.saml2.profile.config.impl.BrowserSSOProfileConfiguration.PROFILE_COUNTER" />
+
     <bean id="RecoverStateData"
         class="net.shibboleth.sp.profile.impl.RecoverStateData" scope="prototype"
         p:stateTokenLookupStrategy-ref="RelayStateLookup"
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
index 47efa6e..5f23306 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/consumer/saml2/saml2-flow.xml
@@ -7,6 +7,7 @@
         <on-entry>
             <evaluate expression="opensamlProfileRequestContext.setProfileId(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.sp.profileId'))" />
             <evaluate expression="opensamlProfileRequestContext.setLoggingId(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.sp.loggingId'))" />
+            <evaluate expression="T(org.opensaml.core.metrics.MetricsSupport).getMetricRegistry()?.counter(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.metrics.ProfileCounter')).inc()" />
         </on-entry>
 
         <evaluate expression="ValidateHttpServletRequest" />
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-beans.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-beans.xml
index c4bf16c..31ad5f3 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-beans.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-beans.xml
@@ -12,9 +12,13 @@
 
     <bean id="shibboleth.sp.loggingId" class="java.lang.String" c:_0="%{sp.saml.service.logging.logout-consumer:LogoutConsumer.SAML2}" />
 
+    <util:constant id="shibboleth.metrics.ProfileCounter"
+        static-field="net.shibboleth.sp.saml.saml2.profile.config.impl.SingleLogoutProfileConfiguration.PROFILE_COUNTER" />
+
     <util:constant id="shibboleth.EndpointType"
         static-field="org.opensaml.saml.saml2.metadata.SingleLogoutService.DEFAULT_ELEMENT_NAME" />
 
+
     <import resource="classpath:/META-INF/net/shibboleth/idp/flows/sp/saml2-common-beans.xml" />
 
     <!-- Dummy manager used to generate/consume the "token" operation parameter. -->
diff --git a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-flow.xml b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-flow.xml
index e3c661d..020c914 100644
--- a/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-flow.xml
+++ b/sp-saml-conf-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/sp/logout/consumer/saml2/saml2-flow.xml
@@ -7,6 +7,7 @@
         <on-entry>
             <evaluate expression="opensamlProfileRequestContext.setProfileId(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.sp.profileId'))" />
             <evaluate expression="opensamlProfileRequestContext.setLoggingId(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.sp.loggingId'))" />
+            <evaluate expression="T(org.opensaml.core.metrics.MetricsSupport).getMetricRegistry()?.counter(flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.metrics.ProfileCounter')).inc()" />
         </on-entry>
     
         <if test="opensamlProfileRequestContext.ensureSubcontext(T(net.shibboleth.sp.context.AgentRequestContext)).getInput().getmember('http').isstruct()"
diff --git a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/BrowserSSOProfileConfiguration.java b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/BrowserSSOProfileConfiguration.java
index 2383005..8ec65be 100644
--- a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/BrowserSSOProfileConfiguration.java
+++ b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/BrowserSSOProfileConfiguration.java
@@ -51,6 +51,9 @@ public class BrowserSSOProfileConfiguration extends AbstractSAML2AssertionConsum
         implements SAMLArtifactConsumerProfileConfiguration,
             net.shibboleth.sp.saml.saml2.profile.config.BrowserSSOProfileConfiguration {
 
+    /** Name of profile counter. */
+    @Nonnull @NotEmpty public static final String PROFILE_COUNTER = "net.shibboleth.sp.profiles.saml2.sso.browser";
+    
     /** Whether attributes should be resolved in the course of the profile. */
     @Nonnull private Predicate<ProfileRequestContext> resolveAttributesPredicate;
 
diff --git a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/SingleLogoutProfileConfiguration.java b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/SingleLogoutProfileConfiguration.java
index 4df4d22..7621708 100644
--- a/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/SingleLogoutProfileConfiguration.java
+++ b/sp-saml-impl/src/main/java/net/shibboleth/sp/saml/saml2/profile/config/impl/SingleLogoutProfileConfiguration.java
@@ -43,6 +43,9 @@ import net.shibboleth.shared.primitive.StringSupport;
 public class SingleLogoutProfileConfiguration extends AbstractSAML2ArtifactConsumerProfileConfiguration
         implements net.shibboleth.sp.saml.saml2.profile.config.SingleLogoutProfileConfiguration {
 
+    /** Name of profile counter. */
+    @Nonnull @NotEmpty public static final String PROFILE_COUNTER = "net.shibboleth.sp.profiles.saml2.logout";
+    
     /** Predicate used to determine if SOAP-based requests should be signed. */
     @Nonnull private Predicate<MessageContext> signSOAPRequestsPredicate;
     

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


More information about the commits mailing list