feat(source2): push all latest files - device labeling, help system, proxy docs, database isolation fix
- Added DOKUMENTASI-FILTER-PER-SITE.md (site isolation docs) - Fixed start-with-env.js to force-load .env.production - Fixed MONGODB_URI hostname from mongodb-netify to mongodb.prod.proit.id - Updated .gitignore to exclude sensitive scripts and credential files - Minor UI and labeling improvements
This commit is contained in:
1 parent
a403f752f3
commit
dd4c8f6876
385 files changed
+31016
-8268
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// test/test-site-isolation.js
|
||||
const axios = require('axios');
|
||||
const assert = require('assert');
|
||||
|
||||
async function main() {
|
||||
console.log('=== Running Site Isolation Integration Test ===');
|
||||
|
||||
console.log('1. Logging in as Nexus Tenant Admin...');
|
||||
const loginRes = await axios.post('https://demoplace.my.id/api/auth/login', {
|
||||
username: 'nexus',
|
||||
password: 'nexus'
|
||||
});
|
||||
|
||||
const cookie = loginRes.headers['set-cookie'];
|
||||
const headers = { Cookie: cookie ? cookie.join('; ') : '' };
|
||||
|
||||
console.log('2. Fetching /api/dashboard/agents/uptime...');
|
||||
const uptimeRes = await axios.get('https://demoplace.my.id/api/dashboard/agents/uptime?timeRange=1d', { headers });
|
||||
assert.ok(uptimeRes.data.ok, 'Uptime response must be ok');
|
||||
|
||||
const uptimeKeys = Object.keys(uptimeRes.data.uptime);
|
||||
console.log('Uptime keys returned:', uptimeKeys);
|
||||
|
||||
const siabAgentUuids = ['F6-2V-DT-8A', '2F-TF-1D-GK', 'YW-6I-61-LL', '8A-V3-PB-85', '1R-79-J9-YE'];
|
||||
const nexusAgentUuids = ['1T-5Q-RC-AS', '2N-ID-VQ-AL'];
|
||||
|
||||
for (const uuid of uptimeKeys) {
|
||||
assert.ok(!siabAgentUuids.includes(uuid), `Security violation: SIAB agent ${uuid} leaked to Nexus admin!`);
|
||||
}
|
||||
console.log('✓ No SIAB agent uptimes leaked to Nexus.');
|
||||
|
||||
console.log('3. Fetching /api/dashboard/agents/storage...');
|
||||
const storageRes = await axios.get('https://demoplace.my.id/api/dashboard/agents/storage', { headers });
|
||||
assert.ok(storageRes.data.ok, 'Storage response must be ok');
|
||||
|
||||
const storageKeys = Object.keys(storageRes.data.storage);
|
||||
console.log('Storage keys returned:', storageKeys);
|
||||
|
||||
for (const uuid of storageKeys) {
|
||||
assert.ok(!siabAgentUuids.includes(uuid), `Security violation: SIAB agent storage ${uuid} leaked to Nexus admin!`);
|
||||
}
|
||||
console.log('✓ No SIAB agent storage sizes leaked to Nexus.');
|
||||
|
||||
console.log('=== SITE ISOLATION TEST PASSED SUCCESSFULY ===');
|
||||
}
|
||||
|
||||
main().catch(err => {
|
||||
console.error('✗ TEST FAILED:', err.message);
|
||||
if (err.response) {
|
||||
console.error('Response data:', err.response.data);
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in new issue
Block a user