<commit_before><?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">
    <servlet>
        <servlet-name>SwaggerClass</servlet-name>
        <servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class>
        <init-param>
            <param-name>api.version</param-name>
            <param-value>${version.reports.rest}.0</param-value>
        </init-param>
        <init-param>
            <param-name>swagger.api.basepath</param-name>
            <param-value>/da/rest/v-${version.reports.rest}</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <module-name>reports-rest</module-name>
    <!-- SECURITY -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for api docs</web-resource-name>
            <url-pattern>/doc/</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for api docs</web-resource-name>
            <url-pattern>/doc/*</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <!-- Allow all users to access the GET endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for users on GET</web-resource-name>
            <url-pattern>/rest/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>OPTIONS</http-method>
        </web-resource-collection>
    </security-constraint>

    <!-- Allow all users to access the POST /reports endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Access to blacklist for Authorized users on GET</web-resource-name>
            <url-pattern>/rest/v-${version.reports.rest}/reports/*</url-pattern>
            <http-method>POST</http-method>
        </web-resource-collection>
    </security-constraint>

    <!-- Allow all logged users to access the other endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Authorized users Access</web-resource-name>
            <url-pattern>/rest/*</url-pattern>
            <http-method>DELETE</http-method>
            <http-method>PUT</http-method>
            <http-method>TRACE</http-method>
            <http-method>POST</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>

    <security-role>
        <role-name>*</role-name>
    </security-role>
    <!-- SECURITY -->
    
    <filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
        <init-param>
            <param-name>allowedMethods</param-name>
            <param-value>GET,POST,OPTIONS,HEAD</param-value>
        </init-param>
        <init-param>
            <param-name>allowedHeaders</param-name>
            <param-value>X-Requested-With,Content-Type,Accept,Origin,Authorization</param-value>
        </init-param>
        <init-param>
            <param-name>chainPreflight</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>${corsUrlPattern}</url-pattern>
    </filter-mapping>
</web-app>
<commit_msg>Allow unauthorized POST request to lookup endpoints<commit_after><?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
         version="3.0">
    <servlet>
        <servlet-name>SwaggerClass</servlet-name>
        <servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class>
        <init-param>
            <param-name>api.version</param-name>
            <param-value>${version.reports.rest}.0</param-value>
        </init-param>
        <init-param>
            <param-name>swagger.api.basepath</param-name>
            <param-value>/da/rest/v-${version.reports.rest}</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <module-name>reports-rest</module-name>
    <!-- SECURITY -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for api docs</web-resource-name>
            <url-pattern>/doc/</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for api docs</web-resource-name>
            <url-pattern>/doc/*</url-pattern>
        </web-resource-collection>
    </security-constraint>

    <!-- Allow all users to access the GET endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All Access for users on GET</web-resource-name>
            <url-pattern>/rest/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>OPTIONS</http-method>
        </web-resource-collection>
    </security-constraint>

    <!-- Allow all users to access the POST /reports and /lookup endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Access to reports for all users on POST</web-resource-name>
            <url-pattern>/rest/v-${version.reports.rest}/reports/*</url-pattern>
            <http-method>POST</http-method>
        </web-resource-collection>
    </security-constraint>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Access to lookups for all users on POST</web-resource-name>
            <url-pattern>/rest/v-${version.reports.rest}/lookup/*</url-pattern>
            <http-method>POST</http-method>
        </web-resource-collection>
    </security-constraint>


    <!-- Allow all logged users to access the other endpoints -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Authorized users Access</web-resource-name>
            <url-pattern>/rest/*</url-pattern>
            <http-method>DELETE</http-method>
            <http-method>PUT</http-method>
            <http-method>TRACE</http-method>
            <http-method>POST</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>

    <security-role>
        <role-name>*</role-name>
    </security-role>
    <!-- SECURITY -->
    
    <filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
        <init-param>
            <param-name>allowedMethods</param-name>
            <param-value>GET,POST,OPTIONS,HEAD</param-value>
        </init-param>
        <init-param>
            <param-name>allowedHeaders</param-name>
            <param-value>X-Requested-With,Content-Type,Accept,Origin,Authorization</param-value>
        </init-param>
        <init-param>
            <param-name>chainPreflight</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>${corsUrlPattern}</url-pattern>
    </filter-mapping>
</web-app>

{'fraction_non_alphanumeric': 0.15889175257731958, 'fraction_numerical': 0.0036082474226804126, 'mean_word_length': 2.2595548089038218, 'pattern_counts': {'":': 0, '<': 257, '<?xml version=': 2, '>': 257, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 12}, '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': '6878676', 'n_tokens_mistral': 2382, 'n_tokens_neox': 2330, 'n_words': 296}