AshReplicant.Resource.Verifiers.ValidateMultitenancy (AshReplicant v0.2.0)

Copy Markdown View Source

Compile-verifier for replicant do tenant_attribute :x end (surfaced as a Spark diagnostic; build-blocking under --warnings-as-errors).

When a tenant_attribute is set it is the per-row tenant discriminator Ash injects as a plaintext filter and force-set. It fails closed unless it is:

  • not classified sensitive — an encrypted discriminator would match nothing (fail-open isolation), and ash_replicant holds no key material;
  • not listed in skip — a skipped discriminator is never written, so the tenant filter matches nothing (fail-open isolation);
  • a declared attribute — an undeclared discriminator cannot be resolved or force-set; and
  • not binary-storage-typed — the discriminator is a plaintext comparator; a tag/base64 discriminator would scope inconsistently.

Messages are value-free: they name schema structure (the attribute name), never a row value.