diff --git a/v2/server.js b/v2/server.js
index c590ac3..4f4b880 100644
--- a/v2/server.js
+++ b/v2/server.js
@@ -90,29 +90,38 @@ function createV2Router() {
}
});
- // ── GET /v2/impersonation-check — IAM impersonation: 3 GET эндпоинта ──
+ // ── GET /v2/impersonation-check — сравнение auth-api vs lk-api-gateway ──
router.get('/impersonation-check', async (req, res) => {
const token = req.session && req.session.token;
if (!token) return res.send('
Нет токена
Войти
');
- const endpoints = [
- { name: 'status', url: 'https://auth-api.ngcloud.ru/api/v1/impersonation/status' },
- { name: 'history', url: 'https://auth-api.ngcloud.ru/api/v1/impersonation/history' },
- { name: 'history/all', url: 'https://auth-api.ngcloud.ru/api/v1/impersonation/history/all' },
+ const tests = [
+ {
+ name: 'auth-api /auth/user',
+ url: 'https://auth-api.ngcloud.ru/api/v1/auth/user',
+ },
+ {
+ name: 'lk-api-gateway /iam/auth/user',
+ url: 'https://lk-api-gateway.ngcloud.ru/api/v1/iam/auth/user',
+ },
+ {
+ name: 'auth-api /impersonation/status',
+ url: 'https://auth-api.ngcloud.ru/api/v1/impersonation/status',
+ },
];
const results = {};
- for (const ep of endpoints) {
+ for (const t of tests) {
try {
- const data = await iamFetch(token, ep.url);
- results[ep.name] = { ok: true, data };
+ const data = await iamFetch(token, t.url);
+ results[t.name] = { ok: true, data };
} catch (e) {
- results[ep.name] = { ok: false, error: e.message };
+ results[t.name] = { ok: false, error: e.message };
}
}
res.set('Content-Type', 'text/html; charset=utf-8');
- res.send(iamStatPage(results));
+ res.send(iamComparePage(results));
});
// ── /v2/app — пользовательский CRUD (только с сессией) ──────────────
@@ -187,7 +196,7 @@ function debugPage(u, version) {