<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
    Spring security beans specification.
    Copyright (c) 2014 University of Oxford
-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:property-placeholder order="1" ignore-resource-not-found="false" ignore-unresolvable="true" location="WEB-INF/api.properties" />

    <bean id="passwordEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />

    <!-- API realm -->
    <security:http realm="ABRAID-MP: ModelWrapper API" pattern="/model/**" create-session="stateless" authentication-manager-ref="apiAuthenticationManager">
        <security:intercept-url pattern="/**" access="ROLE_API" />
        <security:http-basic />
    </security:http>

    <bean id="apiAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
        <property name="providers" ref="apiDaoAuthenticationProvider" />
    </bean>

    <bean id="apiDaoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
        <property name="userDetailsService" ref="apiUserDetailsService"/> <!-- Expects fixed username 'api' -->
        <property name="passwordEncoder" ref="passwordEncoder" /> <!-- Uses http basic password to hold the API key -->
    </bean>


    <bean id="apiUserDetailsService" class="uk.ac.ox.zoo.seeg.abraid.mp.common.web.ApiUserDetailsServiceImpl" ><commit_msg>clean<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
    Spring security beans specification.
    Copyright (c) 2014 University of Oxford
-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

    <context:property-placeholder order="1" ignore-resource-not-found="false" ignore-unresolvable="true" location="WEB-INF/api.properties" />

    <bean id="passwordEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder" />

    <!-- API realm -->
    <security:http realm="ABRAID-MP: ModelWrapper API" pattern="/model/**" create-session="stateless" authentication-manager-ref="apiAuthenticationManager">
        <security:intercept-url pattern="/**" access="ROLE_API" />
        <security:http-basic />
    </security:http>

    <bean id="apiAuthenticationManager" class="org.springframework.security.authentication.ProviderManager">
        <property name="providers" ref="apiDaoAuthenticationProvider" />
    </bean>

    <bean id="apiDaoAuthenticationProvider" class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
        <property name="userDetailsService" ref="apiUserDetailsService"/> <!-- Expects fixed username 'api' -->
        <property name="passwordEncoder" ref="passwordEncoder" /> <!-- Uses http basic password to hold the API key -->
    </bean>

    <bean id="apiUserDetailsService" class="uk.ac.ox.zoo.seeg.abraid.mp.common.web.ApiUserDetailsServiceImpl" >
{'fraction_non_alphanumeric': 0.15188006881297617, 'fraction_numerical': 0.006389776357827476, 'mean_word_length': 4.31331592689295, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 2, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 20, 'xml': 10}, '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': '2360853', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1104, 'n_words': 160}