v0.5.144: /v2/iam_response — сырой ответ IAM
This commit is contained in:
@@ -50,6 +50,26 @@ function createV2Router() {
|
||||
res.send(debugPage(u, config.version));
|
||||
});
|
||||
|
||||
// ── GET /v2/iam_response — сырой ответ IAM ─────────────────────────
|
||||
router.get('/iam_response', async (req, res) => {
|
||||
const token = req.session && req.session.token;
|
||||
if (!token) return res.send('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>');
|
||||
try {
|
||||
const iamData = await auth.fetchIamUser(token);
|
||||
res.set('Content-Type', 'text/html; charset=utf-8');
|
||||
res.send('<!DOCTYPE html>\n<html><head><meta charset="utf-8"><title>IAM Raw</title>'
|
||||
+ '<style>body{font-family:monospace;background:#111;color:#eee;padding:20px}'
|
||||
+ 'pre{background:#1a1a2e;padding:15px;border-radius:8px;overflow-x:auto;font-size:13px}'
|
||||
+ 'h2{color:#4fc3f7}a{color:#80cbc4}</style></head><body>'
|
||||
+ '<h2>Сырой ответ IAM</h2>'
|
||||
+ '<pre>' + JSON.stringify(iamData.raw, null, 2).replace(/</g, '<') + '</pre>'
|
||||
+ '<p><a href="/v2/iam">← Сессия</a> | <a href="/v2/app">CRUD</a></p>'
|
||||
+ '</body></html>');
|
||||
} catch (e) {
|
||||
res.send('<h2>Ошибка IAM</h2><pre>' + e.message + '</pre>');
|
||||
}
|
||||
});
|
||||
|
||||
// ── /v2/app — пользовательский CRUD (только с сессией) ──────────────
|
||||
router.use('/app', enhanceImpersonation, resolveContext, createUserRouter());
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
// ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
module.exports = {
|
||||
version: '0.5.143',
|
||||
version: '0.5.144',
|
||||
|
||||
// ── IAM ──────────────────────────────────────────────────────────────────
|
||||
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
|
||||
|
||||
Reference in New Issue
Block a user