@Filter(value="${micronaut.security.token.propagation.path:/**}") @Requires(beans={TokenPropagator.class,TokenPropagationConfiguration.class}) @Requires(property="micronaut.security.token.propagation.enabled",value="true") public class TokenPropagationHttpClientFilter extends java.lang.Object implements io.micronaut.http.filter.HttpClientFilter
HttpClientFilter
to enable Token propagation.Modifier and Type | Field and Description |
---|---|
protected io.micronaut.http.util.OutgoingHttpRequestProcessor |
outgoingHttpRequestProcessor |
protected TokenPropagationConfiguration |
tokenPropagationConfiguration |
protected TokenPropagator |
tokenPropagator |
Constructor and Description |
---|
TokenPropagationHttpClientFilter(TokenPropagationConfiguration tokenPropagationConfiguration,
io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor,
TokenPropagator tokenPropagator) |
Modifier and Type | Method and Description |
---|---|
org.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>> |
doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest,
io.micronaut.http.filter.ClientFilterChain chain) |
org.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>> |
doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest,
io.micronaut.http.filter.ClientFilterChain chain,
io.micronaut.http.HttpRequest<java.lang.Object> currentRequest) |
protected final TokenPropagationConfiguration tokenPropagationConfiguration
protected final io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor
protected final TokenPropagator tokenPropagator
public TokenPropagationHttpClientFilter(TokenPropagationConfiguration tokenPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor, TokenPropagator tokenPropagator)
tokenPropagationConfiguration
- JWT Propagation configurationoutgoingHttpRequestProcessor
- Utility to decide whether to process the requesttokenPropagator
- The token propagatorpublic org.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>> doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest, io.micronaut.http.filter.ClientFilterChain chain)
doFilter
in interface io.micronaut.http.filter.HttpClientFilter
targetRequest
- The target requestchain
- The filter chainpublic org.reactivestreams.Publisher<? extends io.micronaut.http.HttpResponse<?>> doFilter(io.micronaut.http.MutableHttpRequest<?> targetRequest, io.micronaut.http.filter.ClientFilterChain chain, io.micronaut.http.HttpRequest<java.lang.Object> currentRequest)
targetRequest
- The target request of this HttpClientFilterchain
- The filter chaincurrentRequest
- The original request which triggered during its execution the invocation of this HttpClientFilter