From 10b890437d27e32cf2be0b9f726d530fed18bca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Tue, 16 Jun 2026 13:17:16 +0400 Subject: [PATCH] =?UTF-8?q?v0.5.144:=20/v2/iam=5Fresponse=20=E2=80=94=20?= =?UTF-8?q?=D1=81=D1=8B=D1=80=D0=BE=D0=B9=20=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=20IAM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- v2/server.js | 20 ++++++++++++++++++++ v2/src/config/index.js | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 4e79e48..93982b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.5.143", + "version": "0.5.144", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/v2/server.js b/v2/server.js index fdb0f94..a1df457 100644 --- a/v2/server.js +++ b/v2/server.js @@ -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('

Нет токена

Войти

'); + try { + const iamData = await auth.fetchIamUser(token); + res.set('Content-Type', 'text/html; charset=utf-8'); + res.send('\nIAM Raw' + + '' + + '

Сырой ответ IAM

' + + '
' + JSON.stringify(iamData.raw, null, 2).replace(/'
+        + '

← Сессия | CRUD

' + + ''); + } catch (e) { + res.send('

Ошибка IAM

' + e.message + '
'); + } + }); + // ── /v2/app — пользовательский CRUD (только с сессией) ────────────── router.use('/app', enhanceImpersonation, resolveContext, createUserRouter()); diff --git a/v2/src/config/index.js b/v2/src/config/index.js index 19cb438..f819a33 100644 --- a/v2/src/config/index.js +++ b/v2/src/config/index.js @@ -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',