Class SubdomainTenantResolver
java.lang.Object
io.stargate.sgv2.api.common.tenant.impl.SubdomainTenantResolver
- All Implemented Interfaces:
TenantResolver
TenantResolver that finds the tenant ID in the left most domain part of the host name.
For example, having tenant-id.domain.com will resolve tenant identifier to the
tenant-id. In case of top-level domain, domain.com will resolve tenant
identifier to the domain.
-
Constructor Summary
ConstructorsConstructorDescriptionSubdomainTenantResolver(MultiTenancyConfig.TenantResolverConfig.SubdomainTenantResolverConfig config) -
Method Summary
-
Constructor Details
-
SubdomainTenantResolver
public SubdomainTenantResolver(MultiTenancyConfig.TenantResolverConfig.SubdomainTenantResolverConfig config)
-
-
Method Details
-
resolve
public Optional<String> resolve(io.vertx.ext.web.RoutingContext context, jakarta.ws.rs.core.SecurityContext securityContext) Returns a tenant identifier given aRoutingContextand aSecurityContext.- Specified by:
resolvein interfaceTenantResolver- Parameters:
context- the routing contextsecurityContext- the security context- Returns:
- The tenant identifier. If empty, indicates that the multi-tenancy is disabled.
-