Search in sources :

Example 1 with FilterRegistrationBean

use of org.springframework.boot.context.embedded.FilterRegistrationBean in project Gatekeeper by FINRAOS.

the class GatekeeperCommonConfig method userProfileFilterRegistration.

/* Creating UserProfileFilter with order of 0 to ensure it happens first */
@Bean
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
public FilterRegistrationBean userProfileFilterRegistration() {
    FilterRegistrationBean userProfileFilterRegistration = new FilterRegistrationBean();
    userProfileFilterRegistration.setFilter(new UserHeaderFilter(new SSOParser(userIdHeader)));
    userProfileFilterRegistration.setOrder(0);
    return userProfileFilterRegistration;
}
Also used : UserHeaderFilter(org.finra.gatekeeper.common.authfilter.UserHeaderFilter) SSOParser(org.finra.gatekeeper.common.authfilter.parser.SSOParser) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean) AutoConfigureOrder(org.springframework.boot.autoconfigure.AutoConfigureOrder)

Example 2 with FilterRegistrationBean

use of org.springframework.boot.context.embedded.FilterRegistrationBean in project x-pipe by ctripcorp.

the class ConsoleContextConfig method userAccessFilter.

@Bean
@Profile(AbstractProfile.PROFILE_NAME_PRODUCTION)
public FilterRegistrationBean userAccessFilter(ConsoleConfig consoleConfig) {
    FilterRegistrationBean userAccessFilter = new FilterRegistrationBean();
    userAccessFilter.setFilter(new UserAccessFilter(UserInfoHolder.DEFAULT, consoleConfig));
    userAccessFilter.addUrlPatterns("/*");
    return userAccessFilter;
}
Also used : UserAccessFilter(com.ctrip.xpipe.redis.console.sso.UserAccessFilter) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) AbstractProfile(com.ctrip.xpipe.spring.AbstractProfile) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean)

Example 3 with FilterRegistrationBean

use of org.springframework.boot.context.embedded.FilterRegistrationBean in project x-pipe by ctripcorp.

the class SSOConfigurations method assertionHolderFilter.

@Bean
public FilterRegistrationBean assertionHolderFilter() {
    FilterRegistrationBean assertionHolderFilter = new FilterRegistrationBean();
    assertionHolderFilter.setFilter(filter("com.ctrip.infosec.sso.client.util.AssertionThreadLocalFilter"));
    assertionHolderFilter.addUrlPatterns("/*");
    return assertionHolderFilter;
}
Also used : FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) ServletRegistrationBean(org.springframework.boot.context.embedded.ServletRegistrationBean) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with FilterRegistrationBean

use of org.springframework.boot.context.embedded.FilterRegistrationBean in project apollo by ctripcorp.

the class WebContextConfiguration method userAccessFilter.

@Bean
public FilterRegistrationBean userAccessFilter() {
    FilterRegistrationBean filter = new FilterRegistrationBean();
    filter.setFilter(new UserAccessFilter(userInfoHolder));
    filter.addUrlPatterns("/*");
    return filter;
}
Also used : UserAccessFilter(com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Example 5 with FilterRegistrationBean

use of org.springframework.boot.context.embedded.FilterRegistrationBean in project x-pipe by ctripcorp.

the class CatConfig method catFilter.

@Bean
public FilterRegistrationBean catFilter() {
    FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new CatFilter());
    bean.setName("cat-filter");
    bean.addUrlPatterns("/*");
    bean.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.FORWARD);
    return bean;
}
Also used : CatFilter(com.dianping.cat.servlet.CatFilter) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) ServletListenerRegistrationBean(org.springframework.boot.context.embedded.ServletListenerRegistrationBean) FilterRegistrationBean(org.springframework.boot.context.embedded.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

FilterRegistrationBean (org.springframework.boot.context.embedded.FilterRegistrationBean)7 Bean (org.springframework.context.annotation.Bean)6 ServletRegistrationBean (org.springframework.boot.context.embedded.ServletRegistrationBean)2 UserAccessFilter (com.ctrip.framework.apollo.portal.spi.ctrip.filters.UserAccessFilter)1 UserAccessFilter (com.ctrip.xpipe.redis.console.sso.UserAccessFilter)1 AbstractProfile (com.ctrip.xpipe.spring.AbstractProfile)1 CatFilter (com.dianping.cat.servlet.CatFilter)1 UserHeaderFilter (org.finra.gatekeeper.common.authfilter.UserHeaderFilter)1 SSOParser (org.finra.gatekeeper.common.authfilter.parser.SSOParser)1 AutoConfigureOrder (org.springframework.boot.autoconfigure.AutoConfigureOrder)1 ServletListenerRegistrationBean (org.springframework.boot.context.embedded.ServletListenerRegistrationBean)1