<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
    Common beans for this channel.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
    default-lazy-init="true"
    xmlns:c="http://www.springframework.org/schema/c"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <!--
        Location of various resources.
    -->
    <bean id="uk_productionAggregate_url" class="java.lang.String">
        <constructor-arg value="http://metadata.ukfederation.org.uk/ukfederation-metadata.xml"/>
    </bean>
    <bean id="uk_exportAggregate_url" class="java.lang.String">
        <constructor-arg value="http://metadata.ukfederation.org.uk/ukfederation-export.xml"/>
    </bean>
    
    
    <!--
        uk_federation_uri
        
        URI for the UK federation.  Used in several contexts:
        
        * as the Name attribute for the main EntitiesDescriptor in UK federation metadata
          (not always the document element)
          
        * in mdrpi:PublicationInfo, as the unique identifier for the UK federation publisher
        
        It is the same as the URI used to indicate the UK federation as a registrar, so is made
        an alias of that bean.
    -->
    <alias name="uk_ukf_registrar" alias="uk_federation_uri"/>


    <!--
        Fetch the export aggregate.
    -->
    <bean id="uk_exportAggregate" parent="DOMResourceSourceStage">
        <property name="DOMResource">
            <bean parent="HTTPResource">
                <constructor-arg name="client" ref="httpClient"/>
                <constructor-arg name="url" ref="uk_exportAggregate_url"/>        
            </bean>
        </property>
    </bean>
    
    
    <!--
        Fetch the production aggregate.
    -->
    <bean id="uk_productionAggregate" parent="DOMResourceSourceStage">
        <property name="DOMResource">
            <bean parent="HTTPResource">
                <constructor-arg name="client" ref="httpClient"/>
                <constructor-arg name="url" ref="uk_productionAggregate_url"/>        
            </bean>
        </property>
    </bean>
    
    
    <!--
        Metadata signing certificate.
    -->
    <bean id="uk_signingCertificate" parent="X509CertificateFactoryBean"
        p:resource="classpath:uk/ukfederation-2014.pem"/>
    
    
    <!--
        Check the signature on a document.
    -->
    <bean id="uk_checkSignature" parent="XMLSignatureValidationStage">
        <property name="verificationCertificate" ref="uk_signingCertificate"/>
    </bean>
    
    
    <!--
        uk_check_validUntil
        
        Check that an aggregate has a validUntil instant specified, and that it has not
        yet expired.  Sets a bound of 30 days on the validity interval; 14 days is the
        expected value.
    -->
    <bean id="uk_check_validUntil" parent="stage_parent"
        class="net.shibboleth.metadata.dom.saml.ValidateValidUntilStage">
        <!--
            The validUntil attribute must be present.
        -->
        <property name="requireValidUntil" value="true"/>
        <!--
            Validity interval must not exceed 30 days.
        -->
        <property name="maxValidityInterval" value="#{ 1000L * 60 * 60 * 24 * 30 }"/>
    </bean>
    
    
    <!--
        uk_fetchFragmentFiles
        
        Collects all the UK metadata "fragment files" from the /entities directory.
        
        Each fragment file contains a single EntityDescriptor.  The name of each
        eligible file matches a particular regular expression.
    -->
    <bean id="uk_fetchFragmentFiles" parent="stage_parent"
        class="net.shibboleth.metadata.dom.DOMFilesystemSourceStage">
        <property name="parserPool" ref="parserPool"/>
        <property name="source">
            <bean class="java.io.File">
                <constructor-arg value="${entities.dir}"/>
            </bean>
        </property>
        <property name="sourceFileFilter">
            <bean class="uk.org.ukfederation.mda.RegexFileFilter">
                <constructor-arg value="uk\d{6}.xml"/>
            </bean>
        </property>
    </bean>
    
    
    <!--
        uk_membersResource
        
        A Resource referencing the members.xml document.
    -->
    <bean id="uk_membersResource" parent="FileSystemResource">
        <constructor-arg value="${members.dir}/members.xml"/>
    </bean>
    
    
    <!--
        uk_membersDocument
        
        This bean contains the contents of the members.xml file as a DOM Document.
    -->
    <bean id="uk_membersDocument" parent="DOMDocumentFactoryBean">
        <property name="resource" ref="uk_membersResource"/>
        <property name="parserPool" ref="parserPool"/>
    </bean>
    
    
    <!--
        uk_members
        <commit_msg>Embed the members.xml Resource as it is only used once<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
    Common beans for this channel.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
    default-lazy-init="true"
    xmlns:c="http://www.springframework.org/schema/c"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

    <!--
        Location of various resources.
    -->
    <bean id="uk_productionAggregate_url" class="java.lang.String">
        <constructor-arg value="http://metadata.ukfederation.org.uk/ukfederation-metadata.xml"/>
    </bean>
    <bean id="uk_exportAggregate_url" class="java.lang.String">
        <constructor-arg value="http://metadata.ukfederation.org.uk/ukfederation-export.xml"/>
    </bean>
    
    
    <!--
        uk_federation_uri
        
        URI for the UK federation.  Used in several contexts:
        
        * as the Name attribute for the main EntitiesDescriptor in UK federation metadata
          (not always the document element)
          
        * in mdrpi:PublicationInfo, as the unique identifier for the UK federation publisher
        
        It is the same as the URI used to indicate the UK federation as a registrar, so is made
        an alias of that bean.
    -->
    <alias name="uk_ukf_registrar" alias="uk_federation_uri"/>


    <!--
        Fetch the export aggregate.
    -->
    <bean id="uk_exportAggregate" parent="DOMResourceSourceStage">
        <property name="DOMResource">
            <bean parent="HTTPResource">
                <constructor-arg name="client" ref="httpClient"/>
                <constructor-arg name="url" ref="uk_exportAggregate_url"/>        
            </bean>
        </property>
    </bean>
    
    
    <!--
        Fetch the production aggregate.
    -->
    <bean id="uk_productionAggregate" parent="DOMResourceSourceStage">
        <property name="DOMResource">
            <bean parent="HTTPResource">
                <constructor-arg name="client" ref="httpClient"/>
                <constructor-arg name="url" ref="uk_productionAggregate_url"/>        
            </bean>
        </property>
    </bean>
    
    
    <!--
        Metadata signing certificate.
    -->
    <bean id="uk_signingCertificate" parent="X509CertificateFactoryBean"
        p:resource="classpath:uk/ukfederation-2014.pem"/>
    
    
    <!--
        Check the signature on a document.
    -->
    <bean id="uk_checkSignature" parent="XMLSignatureValidationStage">
        <property name="verificationCertificate" ref="uk_signingCertificate"/>
    </bean>
    
    
    <!--
        uk_check_validUntil
        
        Check that an aggregate has a validUntil instant specified, and that it has not
        yet expired.  Sets a bound of 30 days on the validity interval; 14 days is the
        expected value.
    -->
    <bean id="uk_check_validUntil" parent="stage_parent"
        class="net.shibboleth.metadata.dom.saml.ValidateValidUntilStage">
        <!--
            The validUntil attribute must be present.
        -->
        <property name="requireValidUntil" value="true"/>
        <!--
            Validity interval must not exceed 30 days.
        -->
        <property name="maxValidityInterval" value="#{ 1000L * 60 * 60 * 24 * 30 }"/>
    </bean>
    
    
    <!--
        uk_fetchFragmentFiles
        
        Collects all the UK metadata "fragment files" from the /entities directory.
        
        Each fragment file contains a single EntityDescriptor.  The name of each
        eligible file matches a particular regular expression.
    -->
    <bean id="uk_fetchFragmentFiles" parent="stage_parent"
        class="net.shibboleth.metadata.dom.DOMFilesystemSourceStage">
        <property name="parserPool" ref="parserPool"/>
        <property name="source">
            <bean class="java.io.File">
                <constructor-arg value="${entities.dir}"/>
            </bean>
        </property>
        <property name="sourceFileFilter">
            <bean class="uk.org.ukfederation.mda.RegexFileFilter">
                <constructor-arg value="uk\d{6}.xml"/>
            </bean>
        </property>
    </bean>
    
    
    <!--
        uk_membersDocument
        
        This bean contains the contents of the members.xml file as a DOM Document.
    -->
    <bean id="uk_membersDocument" parent="DOMDocumentFactoryBean">
        <property name="resource">
            <bean parent="FileSystemResource" c:_="${members.dir}/members.xml"/>
        </property>
        <property name="parserPool" ref="parserPool"/>
    </bean>
    
    
    <!--
        uk_members
        
{'fraction_non_alphanumeric': 0.12165233718746912, 'fraction_numerical': 0.006720031623678229, 'mean_word_length': 2.21882951653944, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 2, '>': 133, 'https://': 0, 'lorem ipsum': 0, 'www.': 18, 'xml': 24}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6389488', 'n_tokens_mistral': 2832, 'n_tokens_neox': 2743, 'n_words': 629}