Package org.springframework.security.web.server

# Class WebFilterChainProxy

java.lang.Object
org.springframework.security.web.server.WebFilterChainProxy

All Implemented Interfaces:
  `org.springframework.web.server.WebFilter`

public class WebFilterChainProxy extends Object implements org.springframework.web.server.WebFilter
Used to delegate to a List of `SecurityWebFilterChain` instances.

Since:
  5.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`WebFilterChainProxy.DefaultWebFilterChainDecorator`
A `WebFilterChainProxy.WebFilterChainDecorator` that uses the `DefaultWebFilterChain`
`static interface`
`WebFilterChainProxy.WebFilterChainDecorator`
A strategy for decorating the provided filter chain with one that accounts for the `SecurityFilterChain` for a given request.

## Constructor Summary

Constructors
Constructor
Description
`WebFilterChainProxy(List<SecurityWebFilterChain> filters)`
`WebFilterChainProxy(SecurityWebFilterChain... filters)`

## Method Summary

Modifier and Type
Method
Description
`reactor.core.publisher.Mono<Void>`
`filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)`
`void`
`setExchangeRejectedHandler(ServerExchangeRejectedHandler exchangeRejectedHandler)`
Handles `ServerExchangeRejectedException` when the `ServerWebExchangeFirewall` rejects the provided `ServerWebExchange`.
`void`
`setFilterChainDecorator(WebFilterChainProxy.WebFilterChainDecorator filterChainDecorator)`
Used to decorate the original `WebFilterChain` for each request
`void`
`setFirewall(ServerWebExchangeFirewall firewall)`
Protects the application using the provided `StrictServerWebExchangeFirewall`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WebFilterChainProxy

public WebFilterChainProxy(List<SecurityWebFilterChain> filters)

### WebFilterChainProxy

public WebFilterChainProxy(SecurityWebFilterChain... filters)

## Method Details

### filter

public reactor.core.publisher.Mono<Void> filter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain)

Specified by:
  `filter` in interface `org.springframework.web.server.WebFilter`

### setFirewall

public void setFirewall(ServerWebExchangeFirewall firewall)
Protects the application using the provided `StrictServerWebExchangeFirewall`.

Parameters:
  `firewall` - the `StrictServerWebExchangeFirewall` to use. Cannot be null.
Since:
  6.4

### setExchangeRejectedHandler

public void setExchangeRejectedHandler(ServerExchangeRejectedHandler exchangeRejectedHandler)
Handles `ServerExchangeRejectedException` when the `ServerWebExchangeFirewall` rejects the provided `ServerWebExchange`.

Parameters:
  `exchangeRejectedHandler` - the `ServerExchangeRejectedHandler` to use.

### setFilterChainDecorator

public void setFilterChainDecorator(WebFilterChainProxy.WebFilterChainDecorator filterChainDecorator)
Used to decorate the original `WebFilterChain` for each request

By default, this decorates the filter chain with a `DefaultWebFilterChain` that iterates through security filters and then delegates to the original chain

Parameters:
  `filterChainDecorator` - the strategy for constructing the filter chain
Since:
  6.0