-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/EUI-1685-global-tokens
- Loading branch information
Showing
28 changed files
with
346 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as express from 'express' | ||
import {getConfigValue} from '../configuration' | ||
import { | ||
PROTOCOL, | ||
SERVICES_IDAM_CLIENT_ID, | ||
SERVICES_IDAM_LOGIN_URL, | ||
SERVICES_IDAM_OAUTH_CALLBACK_URL, | ||
} from '../configuration/references' | ||
|
||
export const router = express.Router({mergeParams: true}) | ||
|
||
router.get('/', configurationUIRoute) | ||
|
||
/** | ||
* All the following environmental variables are passed to the UI. | ||
*/ | ||
async function configurationUIRoute(req, res) { | ||
res.status(200).send({ | ||
clientId: getConfigValue(SERVICES_IDAM_CLIENT_ID), | ||
idamWeb: getConfigValue(SERVICES_IDAM_LOGIN_URL), | ||
oAuthCallback: getConfigValue(SERVICES_IDAM_OAUTH_CALLBACK_URL), | ||
protocol: getConfigValue(PROTOCOL), | ||
}) | ||
} | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import * as connectRedis from 'connect-redis' | ||
import * as session from 'express-session' | ||
import * as redis from 'redis' | ||
import * as sessionFileStore from 'session-file-store' | ||
import {getConfigValue, showFeature} from '../configuration' | ||
import { | ||
FEATURE_REDIS_ENABLED, | ||
NOW, | ||
REDIS_CLOUD_URL, | ||
REDIS_KEY_PREFIX, | ||
REDIS_TTL | ||
} from '../configuration/references' | ||
|
||
const RedisStore = connectRedis(session) | ||
const FileStore = sessionFileStore(session) | ||
|
||
let store = null | ||
|
||
export const getRedisStore = () => { | ||
console.log('using RedisStore') | ||
|
||
const tlsOptions = { | ||
prefix: getConfigValue(REDIS_KEY_PREFIX), | ||
} | ||
|
||
const redisClient = redis.createClient( | ||
getConfigValue(REDIS_CLOUD_URL), | ||
tlsOptions | ||
) | ||
|
||
redisClient.on('ready', () => { | ||
console.log('redis client connected successfully') | ||
}) | ||
|
||
redisClient.on('error', console.error) | ||
|
||
return new RedisStore({ | ||
client: redisClient, | ||
ttl: getConfigValue(REDIS_TTL), | ||
}) | ||
} | ||
|
||
export const getFileStore = () => { | ||
console.log('using FileStore') | ||
return new FileStore({ | ||
path: getConfigValue(NOW) ? '/tmp/sessions' : '.sessions', | ||
}) | ||
} | ||
|
||
export const getStore = () => { | ||
if (!store) { | ||
if (showFeature(FEATURE_REDIS_ENABLED)) { | ||
store = getRedisStore() | ||
} else { | ||
store = getFileStore() | ||
} | ||
} | ||
return store | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as express from 'express' | ||
import getConfigurationUIRouter from './configurationUI' | ||
|
||
const router = express.Router({ mergeParams: true }) | ||
|
||
router.use('/configuration-ui', getConfigurationUIRouter) | ||
|
||
export default router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
apiVersion: v1 | ||
name: xui-webapp | ||
home: https://github.com/hmcts/rpx-xui-webapp | ||
version: 0.1.31 | ||
version: 0.1.39 | ||
description: Expert UI | ||
maintainers: | ||
- name: HMCTS RPX XUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
dependencies: | ||
- name: nodejs | ||
version: 1.9.0 | ||
version: ~1.9.0 | ||
repository: '@hmctspublic' | ||
- name: redis | ||
version: ~7.1.0 | ||
repository: "@stable" | ||
condition: redis.enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.