-
Notifications
You must be signed in to change notification settings - Fork 2
EUI-2976: ExUI strategic solution #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
paul-graham
wants to merge
125
commits into
master
Choose a base branch
from
EUI-2976-exui-strategic
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
125 commits
Select commit
Hold shift + click to select a range
b0a3edb
EUI-2976
paul-graham e294b18
Update server.js
paul-graham d3a0636
Update server.js
paul-graham 36714d3
Update cors.js
paul-graham f190a45
Refactor
paul-graham c72f4bb
Redis instantiator
paul-graham 10b3f97
Redis persistence
paul-graham 329a8b7
Track what each socket is doing
paul-graham 93ae2ae
Update activity-service.js
paul-graham f479ba1
Update package.json
paul-graham 9396497
Update activity-service.js
paul-graham 38f84ff
Update index.js
paul-graham 4bcbf05
lint
paul-graham 8d853af
Update instantiator.js
paul-graham 569d85b
Refactoring
paul-graham 7cd2c17
Update activity-service.js
paul-graham 2e4e5bc
Tests
paul-graham 8c30b43
Unit tests
paul-graham 46dde6a
Unit tests
paul-graham cbc6c22
Key space and tests
paul-graham b2bf897
Update keys.js
paul-graham 9a0a6f2
Unit tests
paul-graham b30efab
Fixed the subscriptions
paul-graham 985bdc3
Unit tests
paul-graham caee0ae
Redis subscriber
paul-graham 7f8a678
Unit tests
paul-graham 2762b67
moment
paul-graham 3288a68
Fixed underscore CVE issue
paul-graham a4000c9
Refactor for testing
paul-graham 23abf9d
Create ttl-score-generator.spec.js
paul-graham 9f5a85f
Update store-cleanup-job.js
paul-graham 753d42f
Update store-cleanup-job.js
paul-graham 52d0395
Update server.js
paul-graham af4a7d8
CVE issue
paul-graham a8a177e
Socket TTLs
paul-graham 5558216
console.logs
paul-graham 8b5881f
Update custom-environment-variables.yaml
paul-graham d37a5ee
No need for 'register' event
paul-graham 67acec7
Update activity-service.js
paul-graham 166cdfe
Update index.js
paul-graham 3b20e7e
Update index.spec.js
paul-graham b2e40f1
Version
paul-graham 745a45f
Update values.preview.template.yaml
paul-graham 19b59f0
Update values.preview.template.yaml
paul-graham 32c725d
User name for logging
paul-graham e14501f
Merge branch 'master' into EUI-2976-exui-strategic
paulhowes-HMCTS 15350c3
Update packages
paulhowes-HMCTS 4bf8c81
Yarn audit
paulhowes-HMCTS f48e972
Known issues temporary workaround
paulhowes-HMCTS ec39d6b
Merge branch 'master' into EUI-2976-exui-strategic
paulhowes-HMCTS ebecf5c
Merge branch 'master' into EUI-2976-exui-strategic
phillip-whitaker-hmcts 0da814d
CVE test
phillip-whitaker-hmcts bf49b0c
Updated CVE audit known issues file
phillip-whitaker-hmcts 2236909
Merge branch 'master' into EUI-2976-exui-strategic
phillip-whitaker-hmcts 7fc3372
EUI-2976: Merge master into branch and fix conflicts
LucaDelBuonoHMCTS 799da22
EUI-2976: Fix linting
LucaDelBuonoHMCTS 61ba69f
EUI-2976: Force rebuild
LucaDelBuonoHMCTS b4f0845
Resolve preview issue
danlysiak f24fc6a
Merge branch 'master' into EUI-2976-exui-strategic
danlysiak 2c4f094
EUI-2976: Whitelist everything
LucaDelBuonoHMCTS a9b29d4
Merge branch 'EUI-2976-exui-strategic' of github.com:hmcts/ccd-case-a…
LucaDelBuonoHMCTS 685355f
EUI-2976: Whitelist everything
LucaDelBuonoHMCTS 8ee832d
EUI-2976: Whitelist everything
LucaDelBuonoHMCTS ea379e7
EUI-2976: Update node-fetch
LucaDelBuonoHMCTS 0a79c13
EUI-2976: Reduce ttl to 30 secs for testing
LucaDelBuonoHMCTS 3f19129
Merge branch 'master' into EUI-2976-exui-strategic
LucaDelBuonoHMCTS c92554e
Merge branch 'master' into EUI-2976-exui-strategic
andywilkinshmcts 0e04b63
update dependencies
andywilkinshmcts c9c7a18
yarn conflic fix
balajisridharanhmcts 242d126
yarn pkg conflict fix
balajisridharanhmcts 0c00236
EUI-2976 activity tracker changes
balajisridharanhmcts faf3e64
EUI-2976 activity tracker changes
balajisridharanhmcts 805b16f
EUI-2976 activity tracker changes
balajisridharanhmcts 7890ecd
EUI-2976 activity tracker changes
balajisridharanhmcts 493da28
EUI-2976 activity tracker changes
balajisridharanhmcts cee7995
try add redis img to preview.yaml
Josh-HMCTS 5fe0531
test old redis ver
Josh-HMCTS 907883a
fix indent
Josh-HMCTS 9fbeb67
activity ttl sec increased to 3000
balajisridharanhmcts 2482124
clean up
balajisridharanhmcts ce55c1d
code cleanup
balajisridharanhmcts c9d873d
log update
balajisridharanhmcts 7268e03
vulnerability fix
balajisridharanhmcts a7a1789
stop viewing case for user added
balajisridharanhmcts 998ad83
lint fix
balajisridharanhmcts 735a341
socket handshake checks added
balajisridharanhmcts dfdba24
yarn fix
balajisridharanhmcts e890654
audit suppression added
balajisridharanhmcts d5c92f4
loggers added for socket check demo
balajisridharanhmcts 3084f0e
lint fix
balajisridharanhmcts 8ce74e1
yarn test fix
balajisridharanhmcts 1db8ff2
more log added
balajisridharanhmcts e0e6fb1
more logs added
balajisridharanhmcts e6b83da
lint fix
balajisridharanhmcts 32e6e47
more logs added
balajisridharanhmcts 84e1965
more logs added
balajisridharanhmcts 869c016
more logs added socket issue
balajisridharanhmcts 416b170
websocket change
balajisridharanhmcts 1463210
temp commented auth check
balajisridharanhmcts e3fc50c
auth error handling temp commented
balajisridharanhmcts b71e538
added error handling back
balajisridharanhmcts f332519
auth added again
balajisridharanhmcts afbadc7
lint fix
balajisridharanhmcts 7a35ace
lint fix
balajisridharanhmcts 19d54fc
lint fix
balajisridharanhmcts 8df6e1b
user json log
balajisridharanhmcts 24530fa
socket server log added
balajisridharanhmcts 6b1e3e2
user auth uid log
balajisridharanhmcts 361a3eb
pubsub log added
balajisridharanhmcts d9529dd
socket server cors update
balajisridharanhmcts 3e38fcb
index js update socket
balajisridharanhmcts 406074f
index js update socket
balajisridharanhmcts d90b96a
index js update socket
balajisridharanhmcts 7fca32a
test lint fix
balajisridharanhmcts f5265c8
origin all cred false temp
balajisridharanhmcts b8e3ad2
dummy commit
balajisridharanhmcts 64b3177
index js reverted
balajisridharanhmcts 46cf9a7
socket io redis adapter added
balajisridharanhmcts 9a370dd
lint fix
balajisridharanhmcts d5f67e3
handle errors added
balajisridharanhmcts 9c04399
dummy commit
balajisridharanhmcts e9cb340
multi pod test
balajisridharanhmcts b7d9b86
Merge branch 'master' into EUI-2976-exui-strategic
RebeccaBaker 1a90037
dummy commit
balajisridharanhmcts 261cd8f
Merge branch 'master' into EUI-2976-exui-strategic
RebeccaBaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,13 @@ | ||
| module.exports = { | ||
| "extends": "airbnb-base", | ||
| "env": { | ||
| "mocha": true, | ||
| "jasmine": true | ||
| }, | ||
| "rules": { | ||
| "comma-dangle": 0, | ||
| "arrow-body-style": 0, | ||
| "no-param-reassign": [ 2, { props: false } ], | ||
| "linebreak-style": [ "error", process.platform === 'win32' ? 'windows' : 'unix' ] | ||
| } | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,4 @@ | ||
| ## RELEASE NOTES | ||
|
|
||
| ### Version 0.1.0-socket-alpha | ||
| **EUI-2976** Socket-based Activity Tracking. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,46 @@ | ||
| const config = require('config'); | ||
| const Redis = require('ioredis'); | ||
|
|
||
| const ERROR = 0; | ||
| const RESULT = 1; | ||
| const ENV = config.util.getEnv('NODE_ENV'); | ||
|
|
||
| module.exports = (debug) => { | ||
| const redis = new Redis({ | ||
| port: config.get('redis.port'), | ||
| host: config.get('redis.host'), | ||
| password: config.get('secrets.ccd.activity-redis-password'), | ||
| tls: config.get('redis.ssl'), | ||
| keyPrefix: config.get('redis.keyPrefix'), | ||
| // log unhandled redis errors | ||
| showFriendlyErrorStack: ENV === 'test' || ENV === 'dev', | ||
| }); | ||
|
|
||
| /* redis pipeline returns a reply of the form [[op1error, op1result], [op2error, op2result], ...]. | ||
| error is null in case of success */ | ||
| redis.logPipelineFailures = (plOutcome, message) => { | ||
| if (Array.isArray(plOutcome)) { | ||
| const operationsFailureOutcome = plOutcome.map((operationOutcome) => operationOutcome[ERROR]); | ||
| const failures = operationsFailureOutcome.filter((element) => element !== null); | ||
| failures.forEach((f) => debug(`${message}: ${f}`)); | ||
| } | ||
| return plOutcome; | ||
| }; | ||
|
|
||
| redis.extractPipelineResults = (pipelineOutcome) => { | ||
| const results = pipelineOutcome.map((operationOutcome) => operationOutcome[RESULT]); | ||
| debug(`pipeline results: ${results}`); | ||
| return results; | ||
| }; | ||
|
|
||
| redis | ||
| .on('error', (err) => { | ||
| // eslint-disable-next-line no-console | ||
| debug(`Redis error: ${err.message}`); | ||
| }).on('connect', () => { | ||
| // eslint-disable-next-line no-console | ||
| debug('connected to Redis'); | ||
| }); | ||
|
|
||
| return redis; | ||
| }; |
This file contains hidden or 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,47 +1,3 @@ | ||
| const config = require('config'); | ||
| const debug = require('debug')('ccd-case-activity-api:redis-client'); | ||
| const Redis = require('ioredis'); | ||
|
|
||
| const ERROR = 0; | ||
| const RESULT = 1; | ||
| const ENV = config.util.getEnv('NODE_ENV'); | ||
|
|
||
| const redis = new Redis({ | ||
| port: config.get('redis.port'), | ||
| host: config.get('redis.host'), | ||
| password: config.get('secrets.ccd.activity-redis-password'), | ||
| tls: config.get('redis.ssl'), | ||
| keyPrefix: config.get('redis.keyPrefix'), | ||
| // log unhandled redis errors | ||
| showFriendlyErrorStack: ENV === 'test' || ENV === 'dev', | ||
| }); | ||
|
|
||
| /* redis pipeline returns a reply of the form [[op1error, op1result], [op2error, op2result], ...]. | ||
| error is null in case of success */ | ||
| redis.logPipelineFailures = (plOutcome, message) => { | ||
| if (Array.isArray(plOutcome)) { | ||
| const operationsFailureOutcome = plOutcome.map((operationOutcome) => operationOutcome[ERROR]); | ||
| const failures = operationsFailureOutcome.filter((element) => element !== null); | ||
| failures.forEach((f) => debug(`${message}: ${f}`)); | ||
| } else { | ||
| debug(`${plOutcome} is not an Array...`); | ||
| } | ||
| return plOutcome; | ||
| }; | ||
|
|
||
| redis.extractPipelineResults = (pipelineOutcome) => { | ||
| const results = pipelineOutcome.map((operationOutcome) => operationOutcome[RESULT]); | ||
| debug(`pipeline results: ${results}`); | ||
| return results; | ||
| }; | ||
|
|
||
| redis | ||
| .on('error', (err) => { | ||
| // eslint-disable-next-line no-console | ||
| console.log(`Redis error: ${err.message}`); | ||
| }).on('connect', () => { | ||
| // eslint-disable-next-line no-console | ||
| console.log('connected to Redis'); | ||
| }); | ||
|
|
||
| module.exports = redis; | ||
| module.exports = require('./instantiator')(debug); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,10 +1,10 @@ | ||
| const config = require('config'); | ||
| const moment = require('moment'); | ||
| const debug = require('debug')('ccd-case-activity-api:score-generator'); | ||
|
|
||
| exports.getScore = () => { | ||
| const now = moment(); | ||
| const score = now.add(config.get('redis.activityTtlSec'), 'seconds').valueOf(); | ||
| debug(`generated score out of current timestamp '${now.valueOf()}' plus ${config.get('redis.activityTtlSec')} sec`); | ||
| const now = Date.now(); | ||
| const ttl = parseInt(config.get('redis.activityTtlSec'), 10) || 0; | ||
| const score = now + (ttl * 1000); | ||
| debug(`generated score out of current timestamp '${now}' plus ${ttl} sec`); | ||
| return score; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.