<?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">

    <filter>
        <filter-name>RedirectFilter</filter-name>
        <filter-class>io.apicurio.registry.ui.servlets.RedirectFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>RedirectFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>RegistryApplicationServletFilter</filter-name>
        <filter-class>io.apicurio.registry.rest.RegistryApplicationServletFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>RegistryApplicationServletFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>ResourceCacheControlFilter</filter-name>
        <filter-class>io.apicurio.registry.ui.servlets.ResourceCacheControlFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>ResourceCacheControlFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter>
        <filter-name>HSTSFilter</filter-name>
        <filter-class>io.apicurio.registry.ui.servlets.HSTSFilter</filter-class>
        <async-supported>true</async-supported>
    </filter>
    <filter-mapping>
        <filter-name>HSTSFilter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter>
        <filter-name>BaseHrefFilter</filter-name>
        <filter-class>io.apicurio.registry.ui.servlets.BaseHrefFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>BaseHrefFilter</filter-name>
        <url-pattern>/ui/*</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <filter>
        <filter-name>SpecUrlFilter</filter-name>
        <filter-class>io.apicurio.registry.ui.servlets.SpecUrlFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>SpecUrlFilter</filter-name>
        <url-pattern>/apis/registry/v2</url-pattern>
        <url-pattern>/apis/registry/v2/</url-pattern>
        <url-pattern>/apis/registry/v1</url-pattern>
        <url-pattern>/apis/registry/v1/</url-pattern>
        <url-pattern>/apis/ccompat/v6</url-pattern>
        <url-pattern>/apis/ccompat/v6/</url-pattern>
        <url-pattern>/apis/ccompat/v7</url-pattern>
        <url-pattern>/apis/ccompat/v7/</url-pattern>
        <url-pattern>/apis/ibmcompat/v1</url-pattern>
        <url-pattern>/apis/ibmcompat/v1/</url-pattern>
        <url-pattern>/apis/cncf/v0</url-pattern>
        <url-pattern>/apis/cncf/v0/</url-pattern>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
    </filter-mapping>

    <servlet>
        <servlet-name>ReactAppServlet</servlet-name>
        <servlet-class>io.apicurio.registry.ui.servlets.ReactAppServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ReactAppServlet</servlet-name>
        <url-pattern>/ui/roles/*</url-pattern>
        <url-pattern>/ui/rules/*</url-pattern>
        <url-pattern>/ui/artifacts/*</url-pattern>
        <url-pattern>/ui/settings/*</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>ConfigJsServlet</servlet-name>
        <servlet-class>io.apicurio.registry.ui.servlets.ConfigJsServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ConfigJsServlet</servlet-name>
        <url-pattern>/ui/config.js</url-pattern>
    </servlet-mapping>

    <servlet>
        <servlet-name>ApiDocsServlet</servlet-name>
        <servlet-class>io.apicurio.registry.ui.servlets.ApiDocsServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ApiDocsServlet</servlet-name>
        <url-pattern>/apis</url-pattern>
        <url-pattern>/apis/</url-pattern>
        <url-pattern>/apis/registry/v2</url-pattern>
        <url-pattern>/apis/registry/v2/</url-pattern>
        <url-pattern>/apis/registry/v1</url-pattern>
        <url-pattern>/apis/registry/v1/</url-pattern>
        <url-pattern>/apis/ccompat/v6</url-pattern>
        <url-pattern>/apis/ccompat/v6/</url-pattern>
        <url-pattern>/apis/ccompat/v7</url-pattern>
        <url-pattern>/apis/ccompat/v7/</url-pattern>
        <url-pattern>/apis/ibmcompat/v1</url-pattern>
        <url-pattern>/apis/ibmcompat/v1/</url-pattern>
        <url-pattern>/apis/cncf/v0</url-pattern>
        <url-pattern>/apis/cncf/v0/</url-pattern>
    </servlet-mapping>

</web-app>