@Filter(value="${micronaut.multitenancy.propagation.path:/**}") @Requires(beans={TenantWriter.class,TenantResolver.class,TenantPropagationConfiguration.class,io.micronaut.http.util.OutgoingHttpRequestProcessor.class}) @Requires(property="micronaut.multitenancy.propagation.enabled") public class TenantPropagationHttpClientFilter 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 TenantPropagationConfiguration |
tenantPropagationConfiguration |
protected TenantResolver |
tenantResolver |
protected TenantWriter |
tokenWriter |
Constructor and Description |
---|
TenantPropagationHttpClientFilter(TenantResolver tenantResolver,
TenantWriter tokenWriter,
TenantPropagationConfiguration tenantPropagationConfiguration,
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)
If the request should be processed and the tenant id is resolved, the tenant is written to the targeted request with a
TenantWriter . |
protected final TenantPropagationConfiguration tenantPropagationConfiguration
protected final TenantWriter tokenWriter
protected final TenantResolver tenantResolver
protected final io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor
public TenantPropagationHttpClientFilter(TenantResolver tenantResolver, TenantWriter tokenWriter, TenantPropagationConfiguration tenantPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor)
tenantResolver
- bean responsible of resolving the tenanttokenWriter
- bean responsible of writing the token to the target requesttenantPropagationConfiguration
- Tenant 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)
TenantWriter
.doFilter
in interface io.micronaut.http.filter.HttpClientFilter
targetRequest
- The target requestchain
- The filter chain