test: build HMAC tenant fixtures from domain, drop product URLs

HMAC identity tests should not hardcode gholak/montzar hosts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 22:12:21 +03:30
co-authored by Cursor
parent 82e74f86f0
commit 38337c62d7
2 changed files with 54 additions and 54 deletions
+2 -3
View File
@@ -54,7 +54,7 @@ function hostsEqual(left: string, right: string): boolean {
return left.replace(/^www\./, '') === right.replace(/^www\./, '');
}
/** new.gholaktala.ir belongs to tenant domain gholaktala.ir — not via shared nodeServer. */
/** new.shop.ir belongs to tenant domain shop.ir — not via shared nodeServer. */
function isSubdomainOf(host: string, parent: string): boolean {
const child = normalizeTenantHost(host);
const root = normalizeTenantHost(parent).replace(/^www\./, '');
@@ -66,8 +66,7 @@ export type TenantHostMatchMode = 'full' | 'hmac';
/**
* full: get_user — دامنه، alias، app/admin/node.
* hmac: فقط دامنهٔ اصلی نسخه (و ساب‌دامنهٔ همان). adminUrl مشترک
* (k.montzar.ir روی نسخهٔ app.gholaktala.ir) هویت نیست.
* hmac: فقط دامنهٔ اصلی نسخه (و ساب‌دامنهٔ همان). adminUrl هویت نیست.
*/
export function scoreTenantHost(
tenant: TenantHostFields,