From 30001062d463819a7f4b33ccd170df7af9597cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CNaeel=E2=80=9D?= Date: Wed, 17 Jun 2026 10:12:52 +0400 Subject: [PATCH] =?UTF-8?q?v0.5.149:=20config.iamApiBase=20=E2=80=94=20ENV?= =?UTF-8?q?=20IAM=5FAPI=5FBASE=20=D0=B4=D0=BB=D1=8F=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20IAM=20?= =?UTF-8?q?API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- v2/server.js | 9 +++++---- v2/src/config/index.js | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 32a66bc..ec6a88e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipwhitelist", - "version": "0.5.148", + "version": "0.5.149", "description": "IP WhiteList microservice for cloud provider", "main": "server.js", "scripts": { diff --git a/v2/server.js b/v2/server.js index ee142bd..6ede9c5 100644 --- a/v2/server.js +++ b/v2/server.js @@ -69,7 +69,7 @@ function createV2Router() { const token = req.session && req.session.token; if (!token) return res.send('

Нет токена

Войти

'); try { - const raw = await iamFetch(token, 'https://auth-api-test.ngcloud.ru/api/v1/auth/user'); + const raw = await iamFetch(token, config.iamApiBase + '/auth/user'); res.set('Content-Type', 'text/html; charset=utf-8'); res.send(rawPage('IAM TEST', raw)); } catch (e) { @@ -82,7 +82,7 @@ function createV2Router() { const token = req.session && req.session.token; if (!token) return res.send('

Нет токена

Войти

'); try { - const raw = await iamFetch(token, 'https://auth-api-dev.ngcloud.ru/api/v1/auth/user'); + const raw = await iamFetch(token, config.iamApiBase + '/auth/user'); res.set('Content-Type', 'text/html; charset=utf-8'); res.send(rawPage('IAM DEV', raw)); } catch (e) { @@ -95,10 +95,11 @@ function createV2Router() { const token = req.session && req.session.token; if (!token) return res.send('

Нет токена

Войти

'); + const base = config.iamApiBase; const tests = [ { name: 'auth-api /auth/user', - url: 'https://auth-api.ngcloud.ru/api/v1/auth/user', + url: base + '/auth/user', }, { name: 'lk-api-gateway /iam/auth/user', @@ -106,7 +107,7 @@ function createV2Router() { }, { name: 'auth-api /impersonation/status', - url: 'https://auth-api.ngcloud.ru/api/v1/impersonation/status', + url: base + '/impersonation/status', }, ]; diff --git a/v2/src/config/index.js b/v2/src/config/index.js index ae7a0d5..eb8800f 100644 --- a/v2/src/config/index.js +++ b/v2/src/config/index.js @@ -13,6 +13,7 @@ module.exports = { // ── IAM ────────────────────────────────────────────────────────────────── iamUrl: process.env.V2_IAM_URL || 'https://auth-api.ngcloud.ru/api/v1/auth/user', + iamApiBase: process.env.IAM_API_BASE || 'https://auth-api.ngcloud.ru/api/v1', // ── OIDC (Keycloak) ────────────────────────────────────────────────────── kcBaseUrl: process.env.V2_KC_BASE_URL || 'https://italo.kube5s.ru:8080/realms/ipwhitelist',