Search in sources :

Example 1 with PluginServletFilter

use of hudson.util.PluginServletFilter in project hudson-2.x by hudson.

the class SecurityRealm method createFilter.

/**
     * Creates {@link Filter} that all the incoming HTTP requests will go through
     * for authentication.
     * <p/>
     * <p/>
     * The default implementation uses {@link #getSecurityComponents()} and builds
     * a standard filter chain from /WEB-INF/security/SecurityFilters.groovy.
     * But subclasses can override this to completely change the filter sequence.
     * <p/>
     * <p/>
     * For other plugins that want to contribute {@link Filter}, see
     * {@link PluginServletFilter}.
     *
     * @since 1.271
     */
public Filter createFilter(FilterConfig filterConfig) {
    LOGGER.entering(SecurityRealm.class.getName(), "createFilter");
    Binding binding = new Binding();
    SecurityComponents sc = getSecurityComponents();
    binding.setVariable("securityComponents", sc);
    binding.setVariable("securityRealm", this);
    BeanBuilder builder = new BeanBuilder();
    builder.parse(filterConfig.getServletContext().getResourceAsStream("/WEB-INF/security/SecurityFilters.groovy"), binding);
    WebApplicationContext context = builder.createApplicationContext();
    return (Filter) context.getBean("filter");
}
Also used : Binding(groovy.lang.Binding) BeanBuilder(hudson.util.spring.BeanBuilder) Filter(javax.servlet.Filter) PluginServletFilter(hudson.util.PluginServletFilter) WebApplicationContext(org.springframework.web.context.WebApplicationContext)

Aggregations

Binding (groovy.lang.Binding)1 PluginServletFilter (hudson.util.PluginServletFilter)1 BeanBuilder (hudson.util.spring.BeanBuilder)1 Filter (javax.servlet.Filter)1 WebApplicationContext (org.springframework.web.context.WebApplicationContext)1