Skip to content
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

NN-4114: Caching of auth client credentials #2150

Merged
merged 6 commits into from
May 18, 2022

Conversation

sp-watson
Copy link
Contributor

No description provided.


logger.debug(`Oauth request for grant type 'client_credentials', result status: successful`)
return oauthResult
}

const debug = (operation: string, username: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We ought to remove this once we are confident it is working OK

@@ -48,6 +49,7 @@ app.set('view engine', 'njk')

nunjucksSetup(app)
phaseNameSetup(app, config)
clientCredsSetup(getTokenStore(config), apis.oauthApi)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add this setup code to facilitate testing

tls: config.app.production ? {} : false,
})

client.on('error', (e: Error) => logger.error('Redis client error', e))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesnt the e parameter come first?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean in the error function parameters? Hmm.. yes.. which means the other 2 places in DPS are wrong as well. I'll fix them

Good spot!

@sp-watson sp-watson merged commit 6bd1b87 into main May 18, 2022
@sp-watson sp-watson deleted the NN-4114-auth-client-creds-caching branch May 18, 2022 11:32
sp-watson added a commit that referenced this pull request May 18, 2022
timoj58 pushed a commit that referenced this pull request May 18, 2022
sp-watson added a commit that referenced this pull request May 18, 2022
timoj58 pushed a commit that referenced this pull request May 19, 2022
* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* NN-4114: Use system client for client creds cache

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
andrewrlee added a commit that referenced this pull request May 23, 2022
andrewrlee added a commit that referenced this pull request May 23, 2022
andrewrlee added a commit that referenced this pull request May 23, 2022
* Revert "Revert "NN-4019: Add catch wrapper for probation docs (#2147)" (#2162)"

This reverts commit 55e7399.

* Revert "DCS-1614 HMP Durham can access wpip (#2161)"

This reverts commit aadaefa.

* Revert "ESWE-287_feature_flag_neurodivergence_indicator_repair (#2158)"

This reverts commit 5fb3a57.

* Revert "NN-4114: Caching of auth client credentials (again) (#2155)"

This reverts commit 5afb927.

* Revert "VB-816: Update PVB_URL for link on tab (#2159)"

This reverts commit 901fd66.

* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* Revert "NN-4114: Caching of auth client credentials (#2150)"

This reverts commit 6bd1b87.

* Revert " NN-4065 changes to enable a case note to be added (#2152)"

This reverts commit 8c3fc4f.

* Revert "include result of rp check for profile service edit mode (#2151)"

This reverts commit 8c1faa1.

* Revert "NN-4019: Add catch wrapper for probation docs (#2147)"

This reverts commit 12f16e0.

* Revert "add to env (#2149)"

This reverts commit ef2640c.

* Revert "NN-4065 NN-4065 restricted patient access (#2146)"

This reverts commit 791102a.

* Revert "NN-4070: Conditionally remove previous and next links on pagination (#2145)"

This reverts commit 14f70f3.

* Revert "SDI-88: ⚰️ Remove unused file as app is using houseblockResultsSorter.js instead (#2141)"

This reverts commit bcea0a1.

* Revert "Revert "DCS-1614 HMP Durham can access wpip (#2161)""

This reverts commit c3cfa5c.
andrewrlee added a commit that referenced this pull request May 23, 2022
This reverts commit 707adb1.

Revert "DCS-1614 Hefty reverts (#2163)"

This reverts commit 707adb1.

DCS-1614 Hefty reverts (#2163)

* Revert "Revert "NN-4019: Add catch wrapper for probation docs (#2147)" (#2162)"

This reverts commit 55e7399.

* Revert "DCS-1614 HMP Durham can access wpip (#2161)"

This reverts commit aadaefa.

* Revert "ESWE-287_feature_flag_neurodivergence_indicator_repair (#2158)"

This reverts commit 5fb3a57.

* Revert "NN-4114: Caching of auth client credentials (again) (#2155)"

This reverts commit 5afb927.

* Revert "VB-816: Update PVB_URL for link on tab (#2159)"

This reverts commit 901fd66.

* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* Revert "NN-4114: Caching of auth client credentials (#2150)"

This reverts commit 6bd1b87.

* Revert " NN-4065 changes to enable a case note to be added (#2152)"

This reverts commit 8c3fc4f.

* Revert "include result of rp check for profile service edit mode (#2151)"

This reverts commit 8c1faa1.

* Revert "NN-4019: Add catch wrapper for probation docs (#2147)"

This reverts commit 12f16e0.

* Revert "add to env (#2149)"

This reverts commit ef2640c.

* Revert "NN-4065 NN-4065 restricted patient access (#2146)"

This reverts commit 791102a.

* Revert "NN-4070: Conditionally remove previous and next links on pagination (#2145)"

This reverts commit 14f70f3.

* Revert "SDI-88: ⚰️ Remove unused file as app is using houseblockResultsSorter.js instead (#2141)"

This reverts commit bcea0a1.

* Revert "Revert "DCS-1614 HMP Durham can access wpip (#2161)""

This reverts commit c3cfa5c.
andrewrlee pushed a commit that referenced this pull request May 23, 2022
* NN-4114: Implement oauth client cred caching

* NN-4114: Fix int tests

* NN-4114: Fix redis error logging

* NN-4114: More lenient expiry time checks

* NN-4114: Only log on non-prod systems

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
andrewrlee pushed a commit that referenced this pull request May 23, 2022
andrewrlee pushed a commit that referenced this pull request May 23, 2022
* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* NN-4114: Use system client for client creds cache

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
GurnankCheema pushed a commit that referenced this pull request May 23, 2022
* SDI-88: ⚰️ Remove unused file as app is using houseblockResultsSorter.js instead (#2141)

* NN-4070: Conditionally remove previous and next links on pagination (#2145)

* NN-4070: Conditionally remove previous and next links

* NN-4070: Add test for removal of next link

* NN-4070: Change variable names to make calculation simpler

Co-authored-by: sp-watson <77974320+sp-watson@users.noreply.github.com>

* NN-4065 NN-4065 restricted patient access (#2146)

* NN-4065 restricted patient access

* remove log

* use allcaseloads, and check active, note int tests are not putting the caseloads in session

* context test

* add path for cypress

* add undefined check due to cypress test and middleware filtering js calls

* use context in case notes

* add to env (#2149)

* NN-4019: Add catch wrapper for probation docs (#2147)

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
Co-authored-by: Nat Clamp <84783598+natclamp-moj@users.noreply.github.com>

* include result of rp check for profile service edit mode (#2151)

* NN-4065 changes to enable a case note to be added (#2152)

* changes to enable a case note to be added

* fix test, added POM role to client token too

* NN-4114: Caching of auth client credentials (#2150)

* NN-4114: Implement oauth client cred caching

* NN-4114: Fix int tests

* NN-4114: Fix redis error logging

* NN-4114: More lenient expiry time checks

* NN-4114: Only log on non-prod systems

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>

* Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)

This reverts commit 6bd1b87.

* VB-816: Update PVB_URL for link on tab (#2159)

* NN-4114: Caching of auth client credentials (again) (#2155)

* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* NN-4114: Use system client for client creds cache

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>

* ESWE-287_feature_flag_neurodivergence_indicator_repair (#2158)

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* ESWE-287: feature flag neurodiversity indicator refactor to restrict access to accelerated prisons

* Revert "NN-4019: Add catch wrapper for probation docs (#2147)" (#2162)

This reverts commit 12f16e0.

Co-authored-by: petergphillips <peter@greenthistle.co.uk>
Co-authored-by: Nat Clamp <84783598+natclamp-moj@users.noreply.github.com>
Co-authored-by: sp-watson <77974320+sp-watson@users.noreply.github.com>
Co-authored-by: Tim Wright <wright.tim.j@gmail.com>
Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
Co-authored-by: Paul Solecki <51918433+psoleckimoj@users.noreply.github.com>
Co-authored-by: mons <mons.kapinga@digital.justice.gov.uk>
andrewrlee pushed a commit that referenced this pull request May 23, 2022
* NN-4114: Implement oauth client cred caching

* NN-4114: Fix int tests

* NN-4114: Fix redis error logging

* NN-4114: More lenient expiry time checks

* NN-4114: Only log on non-prod systems

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
andrewrlee pushed a commit that referenced this pull request May 23, 2022
andrewrlee pushed a commit that referenced this pull request May 23, 2022
* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* NN-4114: Use system client for client creds cache

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
andrewrlee pushed a commit that referenced this pull request May 24, 2022
* NN-4114: Implement oauth client cred caching

* NN-4114: Fix int tests

* NN-4114: Fix redis error logging

* NN-4114: More lenient expiry time checks

* NN-4114: Only log on non-prod systems

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
andrewrlee pushed a commit that referenced this pull request May 24, 2022
andrewrlee pushed a commit that referenced this pull request May 24, 2022
* Revert "Revert "NN-4114: Caching of auth client credentials (#2150)" (#2154)"

This reverts commit c934a21.

* NN-4114: Use system client for client creds cache

Co-authored-by: sp-watson <steve.watson@digital,justice.gov.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants