diff --git a/Dockerfile b/Dockerfile index 9d36be6..b7f94f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -90,6 +90,9 @@ ENV LOGIN_URL=$LOGIN_URL ARG LOGOUT_URL ENV LOGOUT_URL=$LOGOUT_URL +ARG AUTH_TOKEN_ENDPOINT +ENV AUTH_TOKEN_ENDPOINT=$AUTH_TOKEN_ENDPOINT + ARG REMOTE_1_URL ENV REMOTE_1_URL=$REMOTE_1_URL diff --git a/docker-compose.yaml b/docker-compose.yaml index a0f5ecd..522b05a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,13 +13,14 @@ services: cache_from: - mojaloop/reporting-hub-bop-shell environment: - - AUTH_API_BASE_URL=/ - - AUTH_MOCK_API=true - - REMOTE_API_BASE_URL=/ - - REMOTE_MOCK_API=false - - LOGIN_URL=https://your-login-url - - LOGOUT_URL=https://your-logout-url + # - AUTH_API_BASE_URL=/api + - AUTH_MOCK_API=false + - REMOTE_API_BASE_URL=/remote + - REMOTE_MOCK_API=true + - LOGIN_URL=http://127.0.0.1:4433/self-service/login/browser + - LOGOUT_URL=http://127.0.0.1:4433/self-service/logout - AUTH_ENABLED=true + - AUTH_TOKEN_ENDPOINT=http://127.0.0.1:4433/sessions/whoami - REMOTE_1_URL=http://localhost:8081 - REMOTE_2_URL=http://localhost:8082 ports: diff --git a/docker/createJSONConfig.sh b/docker/createJSONConfig.sh index 91ad096..e0059d0 100644 --- a/docker/createJSONConfig.sh +++ b/docker/createJSONConfig.sh @@ -7,6 +7,7 @@ echo "{ \"REMOTE_API_BASE_URL\": \"${REMOTE_API_BASE_URL}\", \"REMOTE_MOCK_API\": \"${REMOTE_MOCK_API}\", \"AUTH_ENABLED\": \"${AUTH_ENABLED}\", + \"AUTH_TOKEN_ENDPOINT\": \"${AUTH_TOKEN_ENDPOINT}\", \"LOGIN_URL\": \"${LOGIN_URL}\", \"LOGOUT_URL\": \"${LOGOUT_URL}\" }" | jq '.' > /usr/share/nginx/html/config.json diff --git a/package.json b/package.json index dd1cf4f..ac7ba48 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mojaloop/reporting-hub-bop-shell", - "version": "1.6.3", + "version": "1.6.4", "description": "", "main": "index.js", "scripts": { diff --git a/src/Config/build.ts b/src/Config/build.ts index 751b2cf..e915134 100644 --- a/src/Config/build.ts +++ b/src/Config/build.ts @@ -25,6 +25,7 @@ export default async (): Promise => { REMOTE_API_BASE_URL, REMOTE_MOCK_API, AUTH_ENABLED, + AUTH_TOKEN_ENDPOINT, LOGIN_URL, LOGOUT_URL, } = await fetch(`${baseUrl}/config.json`).then((response) => response.json()); @@ -52,6 +53,9 @@ export default async (): Promise => { if (AUTH_ENABLED !== undefined) { config.isAuthEnabled = AUTH_ENABLED !== 'false'; } + if (AUTH_TOKEN_ENDPOINT !== undefined) { + config.tokenEndpoint = AUTH_TOKEN_ENDPOINT; + } } catch (err) { // eslint-disable-next-line console.info('config returned error', err);