From ecf6638683334d96a485c0af33ebb303eee4c519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Mon, 15 Jun 2026 17:09:15 +0400 Subject: [PATCH] =?UTF-8?q?v0.5.130:=20=D0=B8=D0=BC=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=81=D0=BE=D0=BD=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BE=D1=85=D1=80=D0=B0=D0=BD=D1=8F=D0=B5=D1=82=20isAdmi?= =?UTF-8?q?n=20=D0=BE=D1=82=20=D0=BE=D1=80=D0=B8=D0=B3=D0=B8=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- v2/src/config/index.js | 2 +- v2/src/impersonation/index.js | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ae42e4b..2a3a1c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.5.129", + "version": "0.5.130", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/v2/src/config/index.js b/v2/src/config/index.js index 549d880..dec6ce5 100644 --- a/v2/src/config/index.js +++ b/v2/src/config/index.js @@ -9,7 +9,7 @@ // ═══════════════════════════════════════════════════════════════════════════════ module.exports = { - version: '0.5.129', + version: '0.5.130', // ── IAM ────────────────────────────────────────────────────────────────── iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user', diff --git a/v2/src/impersonation/index.js b/v2/src/impersonation/index.js index 02cb3d0..a82581d 100644 --- a/v2/src/impersonation/index.js +++ b/v2/src/impersonation/index.js @@ -34,16 +34,12 @@ function enhanceImpersonation(req, res, next) { // ── Тестовый режим: нужны все три — ORIGINAL, TARGET, COMPANY ──────── if (ORIGINAL_EMAIL && TARGET_EMAIL && MAIN_COMPANY && u.email === ORIGINAL_EMAIL) { - // Сохраняем isAdmin от оригинала - const wasAdmin = u.isAdmin || (u.allClientIds || []).includes('WZ01112') || u.clientId === 'WZ01112'; - // Подменяем ВСЕ данные на таргета (как делает IAM) u.email = TARGET_EMAIL; u.clientId = MAIN_COMPANY; u.activeClientId = u.activeClientId || MAIN_COMPANY; u.allClientIds = ALL_TARGET_CIDS; u.companyName = MAIN_COMPANY; - u.isAdmin = wasAdmin; u.isImpersonated = true; u.impersonatedCompanyId = MAIN_COMPANY; u.originalUserEmail = ORIGINAL_EMAIL;