@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
Utility to decide whether to process the request.
|
protected TenantPropagationConfiguration |
tenantPropagationConfiguration
Tenant Propagation Configuration.
|
protected TenantResolver |
tenantResolver
Bean responsible for resolving the tenant.
|
protected TenantWriter |
tokenWriter
bean responsible for writing the tenant to the target request.
|
| 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 for resolving the tenanttokenWriter - bean responsible for 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.HttpClientFiltertargetRequest - The target requestchain - The filter chain