@Filter(value="${micronaut.security.token.propagation.path:/**}") @Requires(beans={TokenWriter.class,TokenPropagationConfiguration.class}) @Requires(property="micronaut.security.token.propagation.enabled") 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 TokenWriter |
tokenWriter |
Constructor and Description |
---|
TokenPropagationHttpClientFilter(TokenWriter tokenWriter,
TokenPropagationConfiguration tokenPropagationConfiguration,
io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor) |
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 TokenWriter tokenWriter
protected final io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor
public TokenPropagationHttpClientFilter(TokenWriter tokenWriter, TokenPropagationConfiguration tokenPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor)
tokenWriter
- bean responsible of writing the token to the target requesttokenPropagationConfiguration
- JWT Propagation configurationoutgoingHttpRequestProcessor
- Utility to decide whether to process the requestpublic 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