Repository navigation
fix(oauth): record and log why an OAuth start failed - #574
Merged
Merged
Conversation
The catch dropped the error, so a refused redirect and a dead provider left the same bare start_failed event and nothing in the log.
CodeQL treats a value read from the provider config as sensitive. The route parameter is the same id.
CodeQL flagged the route parameter in the log entry. Line breaks are the part of it that could forge another entry, so they are removed from the whole message, including the error text.
The event already records the provider, so the log entry does not need a value from the request.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
startOAuthLogincaught every error and dropped it. A refused redirect and an unusable provider both leftoauth_login_failedwith reasonstart_failedand no log line. RoxTarget production recorded these for three weeks with nothing to say why, and the cause had to be worked out from load balancer logs.Change
reason: start_failedand addsdetail:redirect_not_allowedorprovider_unusable.Testing
npm test,npm run lint, typecheck and Prettier pass. New test: an app scheme with no allowlist entry answers 400 withdetail: redirect_not_allowed.