Guard Tenant Id

Tenant-id shape validator. Tenant ids surface in audit log lines, sealed registry rows, derived-key context labels, and routing keys — they have to be ASCII-greppable across the whole framework stack. Refuses:

b.guardTenantId.validate(tenantId, opts?) #

stable0.9.26
{
  profile:   "strict" | "balanced" | "permissive",
  posture:   "hipaa" | "pci-dss" | "gdpr" | "soc2",
}

Validate a tenant-id string. Returns the id on success; throws GuardTenantIdError on refusal.

b.guardTenantId.validate("acme-clinic");

b.guardTenantId.compliancePosture(name) #

stable0.9.26hipaapci-dssgdprsoc2

Return the effective profile NAME for a compliance posture, or null for a name this parser does not map. Unlike the content-guard variant this returns the resolved profile string (every line-protocol parser composes gateContract.ALL_STRICT_POSTURES, so "hipaa" / "pci-dss" / "gdpr" / "soc2" all resolve to "strict") and never throws — the parser shape carries no overlay-clone, no buildProfile, and no loadRulePack. Wired by gateContract.defineParser.

b.guardTenantId.compliancePosture("hipaa");                   // → "strict"
b.guardTenantId.compliancePosture("not-a-regime");            // → null

Last updated 2026-08-08T16:39:49.652Z by seeder.