fix remote HMAC: identify tenant by domain, not shared nodeServer

new.gholaktala.ir is the API host of many versions. Prefer subdomain of the product domain and refuse ambiguous nodeServer ties. 403 names the matched tenant.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-09 21:53:11 +03:30
co-authored by Cursor
parent 502b0c8b24
commit 3f0dfe448c
3 changed files with 87 additions and 10 deletions
+11 -1
View File
@@ -810,7 +810,17 @@ export class PluginStoreService implements OnModuleInit, OnModuleDestroy {
}
if (!tenantId) throw new ForbiddenException('نسخه نامعتبر است');
if (!(await this.isStoreEnabled(tenantId))) {
throw new ForbiddenException('فروشگاه افزونه برای این نسخه خاموش است');
const tenant = await this.prisma.tenant.findUnique({
where: { id: tenantId },
select: { nameFa: true, domain: true },
});
const who = tenant
? `${tenant.nameFa} (${tenant.domain})`
: tenantId;
this.logger.warn(`plugin store off for ${who}`);
throw new ForbiddenException(
`فروشگاه افزونه برای این نسخه خاموش است: ${who}`,
);
}
}