v0.5.149: config.iamApiBase — ENV IAM_API_BASE для переключения IAM API
This commit is contained in:
+5
-4
@@ -69,7 +69,7 @@ function createV2Router() {
|
||||
const token = req.session && req.session.token;
|
||||
if (!token) return res.send('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>');
|
||||
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('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>');
|
||||
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('<h2>Нет токена</h2><p><a href="/v2/login">Войти</a></p>');
|
||||
|
||||
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',
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user