v0.6.18: авто-имперсонация выставляет isAdmin + adminMode

This commit is contained in:
2026-06-15 11:11:25 +04:00
parent 5507d11608
commit 38cac02c90
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ipwhitelist", "name": "ipwhitelist",
"version": "0.6.17", "version": "0.6.18",
"description": "IP WhiteList microservice for cloud provider", "description": "IP WhiteList microservice for cloud provider",
"main": "server.js", "main": "server.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -9,7 +9,7 @@
// ═══════════════════════════════════════════════════════════════════════════════ // ═══════════════════════════════════════════════════════════════════════════════
module.exports = { module.exports = {
version: '0.6.17', version: '0.6.18',
// ── IAM ────────────────────────────────────────────────────────────────── // ── IAM ──────────────────────────────────────────────────────────────────
iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user', iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user',
+2
View File
@@ -42,6 +42,8 @@ function enhanceImpersonation(req, res, next) {
u.allClientIds = allCids; u.allClientIds = allCids;
u.isImpersonated = true; u.isImpersonated = true;
u.impersonatedCompanyId = COMPANY; // для resolveContext u.impersonatedCompanyId = COMPANY; // для resolveContext
u.isAdmin = true; // псевдо-админ
u.adminMode = true; // включён
u.companyName = COMPANY; u.companyName = COMPANY;
u.profiles = allCids.map(cid => ({ client_id: cid, company_name: cid })); u.profiles = allCids.map(cid => ({ client_id: cid, company_name: cid }));