Files
sailing-analytics/java/com.sap.sse.security/WEB-INF/web.xml
T
Axel Uhl 62139edbce bug6101: consolidate CORS filters and factor out common CORS header handling;
use CORSHeader instead of response filter in com.sap.sailing.server.gateway
consistently across Jersey and non-Jersey servlets provided by the bundle;

as drive-by improvement, fix the sap.ico/sap-whitelabeled.ico paths in the page
header of /index.html and provide an empty sap-whitelabeled.ico file.
2025-03-13 01:20:50 +01:00

85 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<!-- Disable directory listing: -->
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet
</servlet-class>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>useFileMappedBuffer</param-name>
<param-value>false</param-value>
</init-param>
</servlet>
<context-param>
<param-name>shiroEnvironmentClass</param-name>
<param-value>org.apache.shiro.web.env.IniWebEnvironment</param-value>
</context-param>
<!-- Apache Shiro -->
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<!-- CORS filter -->
<filter>
<filter-name>CORSFilter</filter-name>
<filter-class>com.sap.sse.rest.CORSFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CORSFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>com.sap.sse.security.shiro.ShiroFilterForAllButOptionsRequests</filter-class>
</filter>
<!-- Make sure any request you want accessible to Shiro is filtered. "/*"
catches all requests. Usually this filter mapping is defined first (before all
others) to ensure that Shiro works in subsequent filters in the filter chain: -->
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter>
<filter-name>DefaultTenantFilter</filter-name>
<filter-class>com.sap.sse.security.impl.DefaultTenantRequestFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>DefaultTenantFilter</filter-name>
<url-pattern>/api/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Jersey REST API</servlet-name>
<servlet-class>com.sap.sse.security.jaxrs.RestServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.sap.sse.security.jaxrs.api.RestApiApplication</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST API</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>