Problem/Motivation

Yoyaku's tenant resolution is a seam: TenantContext consults services tagged booking.tenant_resolver and falls back to the tenant with id default. Nothing implements that seam today, in yoyaku or anywhere else, so every request acts in the default tenant however many front ends a site has.

On a multi-domain install each front end is usually its own tenant, with its own resources, tariffs, constraint policies and branding. Right now a booking made on any of them lands in the same tenant, so none of that can differ per front end, and the tenant seam is unusable without writing a custom service.

Proposed resolution

An optional yoyaku_domain submodule providing a booking.tenant_resolver that maps the domain being served to a yoyaku tenant. It reads yoyaku's own binding, not Orchestra's: yoyaku tenants (yoyaku_tenant) and Orchestra tenants (orchestra_tenant) are separate entity types, and a site is free to line them up differently, or to run yoyaku without Orchestra at all.

The binding lives on the tenant, which names the domains it is served on, rather than on the domain records. Domain configuration then keeps meaning exactly what Domain says it means, and the mapping stays honest in both directions: several domains can point at one tenant, and a domain can serve several tenants under other resolvers. Resolution scans the tenants for one claiming the negotiated domain; no claim means the resolver defers, and the tenant with id default applies exactly as it does now, so installing the submodule changes nothing until a tenant names a domain.

This mirrors what Orchestra does for the places it renders notifications in (orchestra issue 3613775), where each tenant names its public and workspace domains on its own form.

Remaining tasks

  • Submodule and resolver.
  • A Domains form per tenant, with its configuration schema.
  • Kernel coverage: a bound domain resolves to its tenant, an unclaimed domain defers to the default, and a binding left behind by a deleted domain defers cleanly.
  • Documentation and French translations.

User interface changes

A Domains form on each yoyaku tenant, listing the domains it is served on.

API changes

A new optional submodule. No change to existing services: the seam and its fallback are unchanged.

Issue fork yoyaku-3613782

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed 4b440953 on 1.x
    feat: #3613782 Resolve the booking tenant from the domain being served...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.