예제 #1
0
    def testIteratingThroughASimpleFilterChain(self):
        filterChain = FilterChain()
        self.assertEquals(0, len(filterChain.chain))

        httpSessionContextIntegrationFilter = HttpSessionContextIntegrationFilter(
        )
        exceptionTranslationFilter = ExceptionTranslationFilter()
        authenticationProcessFilter = AuthenticationProcessingFilter()
        filterSecurityInterceptor = FilterSecurityInterceptor()

        filterChain.addFilter(httpSessionContextIntegrationFilter)
        filterChain.addFilter(exceptionTranslationFilter)
        filterChain.addFilter(authenticationProcessFilter)
        filterChain.addFilter(filterSecurityInterceptor)

        chain = filterChain.getFilterChain()
        self.assertEquals(httpSessionContextIntegrationFilter, chain.next())
        self.assertEquals(exceptionTranslationFilter, chain.next())
        self.assertEquals(authenticationProcessFilter, chain.next())
        self.assertEquals(filterSecurityInterceptor, chain.next())
        self.assertRaises(StopIteration, chain.next)
예제 #2
0
 def exceptionTranslationFilter(self):
     filter = ExceptionTranslationFilter()
     filter.authenticationEntryPoint = self.authenticationProcessingFilterEntryPoint(
     )
     filter.accessDeniedHandler = self.accessDeniedHandler()
     return filter
예제 #3
0
 def exceptionTranslationFilter(self):
     """This filter allows re-routing to an Access Denied page in the event of a security exception."""
     filter = ExceptionTranslationFilter()
     filter.authenticationEntryPoint = self.authenticationProcessingFilterEntryPoint()
     filter.accessDeniedHandler = self.accessDeniedHandler()
     return filter
예제 #4
0
 def exceptionTranslationFilter(self):
     """This filter allows re-routing to an Access Denied page in the event of a security exception."""
     filter = ExceptionTranslationFilter()
     filter.authenticationEntryPoint = self.authenticationProcessingFilterEntryPoint()
     filter.accessDeniedHandler = self.accessDeniedHandler()
     return filter
예제 #5
0
 def exceptionTranslationFilter(self):
     filter = ExceptionTranslationFilter()
     filter.authenticationEntryPoint = self.authenticationProcessingFilterEntryPoint()
     filter.accessDeniedHandler = self.accessDeniedHandler()
     return filter