private static void addTomcatValve(final TomcatServletWebServerFactory tomcat,
                                       final CasEmbeddedApacheTomcatValveTypes type,
                                       final Valve valve) {
        switch (type) {
            case CONTEXT -> tomcat.addContextValves(valve);
            case ENGINE -> tomcat.addEngineValves(valve);
        }
    }
This is {@link CasTomcatServletWebServerFactoryCustomizer}.

@author Misagh Moayyed
@since 6.1.0
webapp/cas-server-webapp-init-tomcat/src/main/java/org/apereo/cas/tomcat/CasTomcatServletWebServerFactoryCustomizer.java