Class TenantPropagationHttpClientFilter
- java.lang.Object
-
- io.micronaut.multitenancy.propagation.TenantPropagationHttpClientFilter
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered,io.micronaut.http.filter.HttpClientFilter,io.micronaut.http.filter.HttpFilter
@Filter("${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.HttpClientFilterHttpClientFilterto enable Token propagation.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected io.micronaut.http.util.OutgoingHttpRequestProcessoroutgoingHttpRequestProcessorUtility to decide whether to process the request.protected TenantPropagationConfigurationtenantPropagationConfigurationTenant Propagation Configuration.protected TenantResolvertenantResolverBean responsible for resolving the tenant.protected TenantWritertokenWriterbean responsible for writing the tenant to the target request.
-
Constructor Summary
Constructors Constructor Description TenantPropagationHttpClientFilter(TenantResolver tenantResolver, TenantWriter tokenWriter, TenantPropagationConfiguration tenantPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 aTenantWriter.
-
-
-
Field Detail
-
tenantPropagationConfiguration
protected final TenantPropagationConfiguration tenantPropagationConfiguration
Tenant Propagation Configuration.
-
tokenWriter
protected final TenantWriter tokenWriter
bean responsible for writing the tenant to the target request.
-
tenantResolver
protected final TenantResolver tenantResolver
Bean responsible for resolving the tenant.
-
outgoingHttpRequestProcessor
protected final io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor
Utility to decide whether to process the request.
-
-
Constructor Detail
-
TenantPropagationHttpClientFilter
public TenantPropagationHttpClientFilter(TenantResolver tenantResolver, TenantWriter tokenWriter, TenantPropagationConfiguration tenantPropagationConfiguration, io.micronaut.http.util.OutgoingHttpRequestProcessor outgoingHttpRequestProcessor)
- Parameters:
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 request
-
-
Method Detail
-
doFilter
public 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 aTenantWriter.- Specified by:
doFilterin interfaceio.micronaut.http.filter.HttpClientFilter- Parameters:
targetRequest- The target requestchain- The filter chain- Returns:
- The publisher of the response
-
-