<commit_before><?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2012 Nodeable Inc
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       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-3.0.xsd
       ">

    <import resource="classpath:core-config.xml"/>
    <import resource="classpath:security-config.xml"/>
    <import resource="classpath:datasource-config.xml"/>
    <import resource="classpath:camel-config.xml"/>
    <import resource="classpath:jmx-config.xml"/>

    <!-- Let's use some enterprise caching support for better performance.  You can replace this with any enterprise
         caching framework implementation that you like (Terracotta+Ehcache, Coherence, GigaSpaces, etc -->
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <!-- Set a net.sf.ehcache.CacheManager instance here if you already have one.  If not, a new one
             will be creaed with a default config:
             <property name="cacheManager" ref="ehCacheManager"/> -->
        <!-- If you don't have a pre-built net.sf.ehcache.CacheManager instance to inject, but you want
             a specific Ehcache configuration to be used, specify that here.  If you don't, a default
             will be used.:
        <property name="cacheManagerConfigFile" value="classpath:some/path/to/ehcache.xml"/> -->
    </bean>

    <!-- Define the Shiro Filter here (as a FactoryBean) instead of directly in web.xml -
         web.xml uses the DelegatingFilterProxy to access this bean.  This allows us
         to wire things with more control as well utilize nice Spring things such as
         PropertiesPlaceholderConfigurer and abstract beans or anything else we might need: -->
    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="loginUrl" value="/authentication/login"/>
        <property name="unauthorizedUrl" value="/logout"/>
        <property name="filterChainDefinitions">
            <value>
                /status/** = anon
                /docs/** = anon
                /authentication/login = authcBasic, roles[Users]
                /logout = logout
                /api/** = anon
                /gateway/** = apiKey
                /agent/** = apiKey
                /admin/** = userToken, roles[Administrators]
                /** = anon
            </value>
        </property><commit_msg>/api should be guarded by apiKey auth<commit_after><?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ Copyright 2012 Nodeable Inc
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~    you may not use this file except in compliance with the License.
  ~    You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~    See the License for the specific language governing permissions and
  ~    limitations under the License.
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
       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-3.0.xsd
       ">

    <import resource="classpath:core-config.xml"/>
    <import resource="classpath:security-config.xml"/>
    <import resource="classpath:datasource-config.xml"/>
    <import resource="classpath:camel-config.xml"/>
    <import resource="classpath:jmx-config.xml"/>

    <!-- Let's use some enterprise caching support for better performance.  You can replace this with any enterprise
         caching framework implementation that you like (Terracotta+Ehcache, Coherence, GigaSpaces, etc -->
    <bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
        <!-- Set a net.sf.ehcache.CacheManager instance here if you already have one.  If not, a new one
             will be creaed with a default config:
             <property name="cacheManager" ref="ehCacheManager"/> -->
        <!-- If you don't have a pre-built net.sf.ehcache.CacheManager instance to inject, but you want
             a specific Ehcache configuration to be used, specify that here.  If you don't, a default
             will be used.:
        <property name="cacheManagerConfigFile" value="classpath:some/path/to/ehcache.xml"/> -->
    </bean>

    <!-- Define the Shiro Filter here (as a FactoryBean) instead of directly in web.xml -
         web.xml uses the DelegatingFilterProxy to access this bean.  This allows us
         to wire things with more control as well utilize nice Spring things such as
         PropertiesPlaceholderConfigurer and abstract beans or anything else we might need: -->
    <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
        <property name="securityManager" ref="securityManager"/>
        <property name="loginUrl" value="/authentication/login"/>
        <property name="unauthorizedUrl" value="/logout"/>
        <property name="filterChainDefinitions">
            <value>
                /status/** = anon
                /docs/** = anon
                /authentication/login = authcBasic, roles[Users]
                /logout = logout
                /api/** = apiKey
                /gateway/** = apiKey
                /agent/** = apiKey
                /admin/** = userToken, roles[Administrators]
                /** = anon
            </value>
        </property>
{'fraction_non_alphanumeric': 0.10885723134097244, 'fraction_numerical': 0.005574481263549086, 'mean_word_length': 2.6083798882681566, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 2, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 22}, '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': '6267402', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1684, 'n_words': 551}