refactor: verifyRequest => validateOauthSecurity #1494
Merged
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.
Resolves #1482
The existing
verifyRequest()
does too much work for a utility function (non-middleware) attached to EOV:elevate=true
This PR separates these tasks into two new Express middlewares and limits the renamed EOV utility function to checking scopes.
As far as handling OP outages, the current code actually does a fair job with that. There are three scenarios to handle:
In real-world testing, the current code and this PR both handle scenario 2 well, although the error message has been improved in this PR. Scenarios 1 and 3 are handled better by this PR since the timeouts for the JWKS request were reduced from 30s to 5s.
Recommend refactoring our JWKS key fetch/cache/log/retrieve operations and consider moving much of it to local code and remove the
jwks-rsa
dependency. But that's for another day.