سامانه صدور فاکتور و حسابداری
Mirrored from https://github.com/davoodmehraban89/Factor-easy.git
Synced Dec 4, 01:45 UTC
test: emit safe tenant isolation diagnostics on failed assertions
davoodmehraban89 committed
Nov 17, 2026 at 09:48 UTC
6a4f46950657e8bf8c2c65d2c93e1d3f9c58a5a2
1 file changed
+1
scripts/wp2-auth-tenant-e2e.mjs
+1
@@ -78,6 +78,7 @@ try {
78
const visibleB = await rest('organizations?select=id,name&order=name', tokens[1]);
79
assert.equal(visibleA.status, 200); assert.equal(visibleB.status, 200);
80
const rowsA = await visibleA.json(), rowsB = await visibleB.json();
81
+ console.log('WP2 tenant diagnostics', JSON.stringify({ users, orgA, orgB, rowsA, rowsB }));
82
assert.ok(rowsA.some(x => x.id === orgA));
83
assert.ok(!rowsA.some(x => x.id === orgB), 'tenant A JWT leaked tenant B organization');
84
assert.ok(rowsB.some(x => x.id === orgB));