From d72bb84d25a635057bddcf7326ec70751de571f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 17 Jun 2026 14:44:04 +0400 Subject: [PATCH] =?UTF-8?q?v0.5.155:=20src/auth.js=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=B5=D0=B4=D1=91=D0=BD=20=D0=BD=D0=B0=20v2/config?= =?UTF-8?q?=20IAM=5FAPI=5FBASE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/auth.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1216cac..f083972 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.5.154", + "version": "0.5.155", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/src/auth.js b/src/auth.js index 358f3c1..d0c0dfb 100644 --- a/src/auth.js +++ b/src/auth.js @@ -25,7 +25,8 @@ const jwt = require('jsonwebtoken'); const crypto = require('crypto'); const https = require('https'); const http = require('http'); -const { IAM_API_URL } = require('./config'); +const { iamApiBase } = require('../v2/src/config'); +const IAM_API_URL = iamApiBase; // ── Конфигурация из окружения ──────────────────────────────────────────────── const ISSUER = process.env.JWT_ISSUER || 'mock-auth-api'; @@ -286,7 +287,7 @@ function verifyAnyToken(token, devMode) { */ async function fetchIamUser(token) { const raw = await new Promise((resolve, reject) => { - const url = new URL(IAM_API_URL + '/api/v1/auth/user'); + const url = new URL(IAM_API_URL + '/auth/user'); const lib = url.protocol === 'https:' ? https : http; const req = lib.request({ hostname: url.hostname, @@ -343,7 +344,7 @@ async function fetchIamUser(token) { async function switchProfile(token, profileId) { const body = JSON.stringify({ profile_id: profileId }); const raw = await new Promise((resolve, reject) => { - const url = new URL(IAM_API_URL + '/api/v1/user/switch-profile'); + const url = new URL(IAM_API_URL + '/user/switch-profile'); const lib = url.protocol === 'https:' ? https : http; const req = lib.request({ hostname: url.hostname,