Skip to content

Add SubdomainTenantIdResolver with header fallback#2198

Merged
einari merged 2 commits into
mainfrom
feat/subdomain-tenant-id-resolver
May 8, 2026
Merged

Add SubdomainTenantIdResolver with header fallback#2198
einari merged 2 commits into
mainfrom
feat/subdomain-tenant-id-resolver

Conversation

@einari
Copy link
Copy Markdown
Contributor

@einari einari commented May 8, 2026

Added

  • New SubdomainTenantIdResolver that extracts the tenant ID from the first segment of the request hostname (e.g. acme.myapp.comacme), with the configured HTTP header as fallback when no subdomain is present
  • TenantResolverType.Subdomain enum value
  • UseSubdomainTenancy() extension method on ArcOptions
  • Host property on IHttpRequestContext and both implementations

einari added 2 commits May 8, 2026 22:00
Needed to support subdomain-based tenant resolution without taking
a direct dependency on IHttpContextAccessor in the resolver.
Resolves the tenant ID from the first segment of the request hostname
(e.g. acme.myapp.com → acme). When the host has no subdomain, falls
back to the configured HTTP header. Useful for SaaS applications that
route tenants through subdomains.

Adds TenantResolverType.Subdomain and UseSubdomainTenancy() extension.
@einari einari added the minor label May 8, 2026
@einari einari merged commit ad0006e into main May 8, 2026
8 of 9 checks passed
@einari einari deleted the feat/subdomain-tenant-id-resolver branch May 8, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant