[java-identity-provider] branch master updated: Move audit beans into root context and remove import from flows.

Scott Cantor cantor.2 at osu.edu
Thu Jan 16 15:26:32 EST 2020


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

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=bb636819f6b2232f294d26570a00713855891c8b

The following commit(s) were added to refs/heads/master by this push:
       new  bb63681   Move audit beans into root context and remove import from flows.
bb63681 is described below

commit bb636819f6b2232f294d26570a00713855891c8b
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu Jan 16 15:23:34 2020 -0500

    Move audit beans into root context and remove import from flows.
---
 .../main/resources/system/conf/audit-system.xml    | 23 ++++++++++++++++++----
 .../main/resources/system/conf/global-system.xml   |  1 +
 .../system/flows/admin/admin-abstract-beans.xml    |  3 ---
 .../system/flows/authn/saml-authn-beans.xml        |  3 ---
 .../system/flows/cas/cas-abstract-beans.xml        |  3 ---
 .../flows/intercept/attribute-release-beans.xml    |  1 -
 .../system/flows/intercept/impersonate-beans.xml   |  2 --
 .../system/flows/intercept/terms-of-use-beans.xml  |  1 -
 .../resources/system/flows/logout/logout-beans.xml |  3 ---
 .../flows/logout/logout-propagation-beans.xml      |  3 ---
 .../flows/logout/propagation/saml2-beans.xml       |  3 ---
 .../system/flows/saml/saml-abstract-beans.xml      |  3 ---
 12 files changed, 20 insertions(+), 29 deletions(-)

diff --git a/idp-conf/src/main/resources/system/conf/audit-system.xml b/idp-conf/src/main/resources/system/conf/audit-system.xml
index fdbb1a2..721a893 100644
--- a/idp-conf/src/main/resources/system/conf/audit-system.xml
+++ b/idp-conf/src/main/resources/system/conf/audit-system.xml
@@ -55,6 +55,23 @@
         </constructor-arg>
     </bean>
     
+    <bean id="shibboleth.ProtocolLookupFunction" parent="shibboleth.ContextFunctions.Scripted" factory-method="inlineScript">
+        <constructor-arg>
+            <value>
+            <![CDATA[
+                var protocol = null;
+                var springContext = input.getSubcontext("net.shibboleth.idp.profile.context.SpringRequestContext");
+                if (springContext != null) {
+                    if (springContext.getRequestContext() != null) {
+                        protocol = springContext.getRequestContext().getActiveFlow().getApplicationContext().getBean('shibboleth.MetadataLookup.Protocol');
+                    }
+                }
+                protocol;
+            ]]>
+            </value>
+        </constructor-arg>
+    </bean>
+    
     <!--
     The actual beans used are in user-space, but they inherit from the maps below. We have to use a
     MapFactoryBean instead of util:map because merging isn't supported by the util:map schema.
@@ -83,8 +100,7 @@
                     <key>
                         <util:constant static-field="net.shibboleth.idp.saml.profile.SAMLAuditFields.PROTOCOL"/>
                     </key>
-                    <bean parent="shibboleth.Functions.Constant"
-                        c:target-ref="shibboleth.MetadataLookup.Protocol" />
+                    <ref bean="shibboleth.ProtocolLookupFunction" />
                 </entry>
                 <entry>
                     <key>
@@ -232,8 +248,7 @@
                     <key>
                         <util:constant static-field="net.shibboleth.idp.saml.profile.SAMLAuditFields.PROTOCOL"/>
                     </key>
-                    <bean parent="shibboleth.Functions.Constant"
-                        c:target-ref="shibboleth.MetadataLookup.Protocol" />
+                    <ref bean="shibboleth.ProtocolLookupFunction" />
                 </entry>
                 <entry>
                     <key>
diff --git a/idp-conf/src/main/resources/system/conf/global-system.xml b/idp-conf/src/main/resources/system/conf/global-system.xml
index 9e9a557..06e7cb4 100644
--- a/idp-conf/src/main/resources/system/conf/global-system.xml
+++ b/idp-conf/src/main/resources/system/conf/global-system.xml
@@ -42,6 +42,7 @@
 
     <import resource="../../conf/global.xml" />
     <import resource="../../conf/errors.xml" />
+    <import resource="audit-system.xml" />
     <import resource="general-authn-system.xml" />
     <import resource="session-manager-system.xml" />
     <import resource="services-system.xml" />
diff --git a/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml b/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml
index 16a1458..8d06cc6 100644
--- a/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/admin/admin-abstract-beans.xml
@@ -98,9 +98,6 @@
             <bean class="net.shibboleth.idp.profile.context.navigate.WebFlowCurrentEventLookupFunction" />
         </property>
     </bean>
-
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
         
     <bean id="AdminPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
         p:fieldExtractors="#{getObject('shibboleth.AdminAuditExtractors') ?: getObject('shibboleth.DefaultAdminAuditExtractors')}" />
diff --git a/idp-conf/src/main/resources/system/flows/authn/saml-authn-beans.xml b/idp-conf/src/main/resources/system/flows/authn/saml-authn-beans.xml
index a2e77d1..c935c25 100644
--- a/idp-conf/src/main/resources/system/flows/authn/saml-authn-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/authn/saml-authn-beans.xml
@@ -52,9 +52,6 @@
     <bean id="FlowStartPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
         p:fieldExtractors="#{getObject('shibboleth.FlowStartAuditExtractors') ?: getObject('shibboleth.DefaultFlowStartAuditExtractors')}" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
-
     <bean id="PrepareInboundMessageContext"
             class="net.shibboleth.idp.saml.session.impl.PrepareInboundMessageContext" scope="prototype"
             p:profileContextLookupStrategy-ref="shibboleth.ChildLookup.ProxyProfileRequestContext">
diff --git a/idp-conf/src/main/resources/system/flows/cas/cas-abstract-beans.xml b/idp-conf/src/main/resources/system/flows/cas/cas-abstract-beans.xml
index 3964d28..8b7ce5e 100644
--- a/idp-conf/src/main/resources/system/flows/cas/cas-abstract-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/cas/cas-abstract-beans.xml
@@ -16,9 +16,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
-
     <!-- These are beans that are common to all CAS protocol flows. -->
 
     <bean id="FlowStartPopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
diff --git a/idp-conf/src/main/resources/system/flows/intercept/attribute-release-beans.xml b/idp-conf/src/main/resources/system/flows/intercept/attribute-release-beans.xml
index 6da8574..12be05c 100644
--- a/idp-conf/src/main/resources/system/flows/intercept/attribute-release-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/intercept/attribute-release-beans.xml
@@ -14,7 +14,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="../../conf/audit-system.xml" />
     <import resource="../../../conf/intercept/consent-intercept-config.xml" />
 
     <bean id="AttributeReleaseConsentFunction"
diff --git a/idp-conf/src/main/resources/system/flows/intercept/impersonate-beans.xml b/idp-conf/src/main/resources/system/flows/intercept/impersonate-beans.xml
index 901d18a..51f60b9 100644
--- a/idp-conf/src/main/resources/system/flows/intercept/impersonate-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/intercept/impersonate-beans.xml
@@ -48,8 +48,6 @@
         c:filterService-ref="shibboleth.AttributeFilterService"
         p:maskFailures="%{idp.service.attribute.filter.maskFailures:true}"
         p:metadataResolver-ref="shibboleth.MetadataResolver" />
-        
-    <import resource="../../conf/audit-system.xml" />
     
     <bean id="PopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext" scope="prototype">
         <property name="fieldExtractors">
diff --git a/idp-conf/src/main/resources/system/flows/intercept/terms-of-use-beans.xml b/idp-conf/src/main/resources/system/flows/intercept/terms-of-use-beans.xml
index 868ece4..1cace50 100644
--- a/idp-conf/src/main/resources/system/flows/intercept/terms-of-use-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/intercept/terms-of-use-beans.xml
@@ -14,7 +14,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <import resource="../../conf/audit-system.xml" />
     <import resource="../../../conf/intercept/consent-intercept-config.xml" />
 
     <bean id="TermsOfUseConsentFunction"
diff --git a/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml b/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml
index c056b14..fb8b705 100644
--- a/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/logout/logout-beans.xml
@@ -18,9 +18,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
-
     <alias alias="UserPromptCondition" name="%{idp.logout.promptUser:shibboleth.Conditions.FALSE}" />
 
     <bean id="InitializeProfileRequestContext"
diff --git a/idp-conf/src/main/resources/system/flows/logout/logout-propagation-beans.xml b/idp-conf/src/main/resources/system/flows/logout/logout-propagation-beans.xml
index f4796ce..c9814eb 100644
--- a/idp-conf/src/main/resources/system/flows/logout/logout-propagation-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/logout/logout-propagation-beans.xml
@@ -18,9 +18,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
-
     <bean id="InitializeProfileRequestContext"
         class="net.shibboleth.idp.profile.impl.InitializeProfileRequestContext" scope="prototype"
         p:profileId="http://shibboleth.net/ns/profiles/logout-propagation"
diff --git a/idp-conf/src/main/resources/system/flows/logout/propagation/saml2-beans.xml b/idp-conf/src/main/resources/system/flows/logout/propagation/saml2-beans.xml
index a832e90..1bbab4f 100644
--- a/idp-conf/src/main/resources/system/flows/logout/propagation/saml2-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/logout/propagation/saml2-beans.xml
@@ -17,9 +17,6 @@
     <bean class="net.shibboleth.ext.spring.config.IdentifiableBeanPostProcessor" />
     <bean class="net.shibboleth.idp.profile.impl.ProfileActionBeanPostProcessor" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../../conf/audit-system.xml" />
-
     <import resource="../../saml/saml-abstract-beans.xml" />
 
     <util:constant id="shibboleth.EndpointType"
diff --git a/idp-conf/src/main/resources/system/flows/saml/saml-abstract-beans.xml b/idp-conf/src/main/resources/system/flows/saml/saml-abstract-beans.xml
index b6658e8..c40d67c 100644
--- a/idp-conf/src/main/resources/system/flows/saml/saml-abstract-beans.xml
+++ b/idp-conf/src/main/resources/system/flows/saml/saml-abstract-beans.xml
@@ -27,9 +27,6 @@
         class="org.opensaml.profile.action.impl.PopulateMetricContext" scope="prototype"
         p:metricStrategy="#{getObject('shibboleth.metrics.MetricStrategy')}" />
 
-    <!-- Declares audit field extractor functions injected into beans that populate the audit context. -->
-    <import resource="../../conf/audit-system.xml" />
-
     <bean id="PostDecodePopulateAuditContext" parent="shibboleth.AbstractPopulateAuditContext"
         p:fieldExtractors="#{getObject('shibboleth.PostDecodeAuditExtractors') ?: getObject('shibboleth.DefaultPostDecodeAuditExtractors')}" />
 

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


More information about the commits mailing list