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

LEGAL_API: 5xx return masking Auth and other Errors #2143

Closed
thorwolpert opened this issue Dec 14, 2019 · 0 comments
Closed

LEGAL_API: 5xx return masking Auth and other Errors #2143

thorwolpert opened this issue Dec 14, 2019 · 0 comments
Assignees
Labels
ENTITY Business Team

Comments

@thorwolpert
Copy link
Collaborator

Describe the bug
A 5xx error is being returned by the server, instead of a 4xx error

The correct error is generated (as seen in the log):
flask_jwt_oidc.exceptions.AuthError: ({'code': 'authorization_header_missing', 'description': 'Authorization header is expected'}, 401)

But the error handler that ensure messages are sent to Sentry is then swallowing this error and message and raising a new 5xx error that is returned to the caller.

The error handler should be changed to re-raise the error if it is appropriate to deliver the caller, or if it is truly an unhandled exception, log to sentry and return a 5xx.

To Reproduce
Steps to reproduce the behavior:
curl https://{host-env}/api/v1/businesses/CP0000088/filings?some junk

Expected behavior
valid response or a 401

@thorwolpert thorwolpert added the ENTITY Business Team label Dec 14, 2019
This was referenced Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ENTITY Business Team
Projects
None yet
Development

No branches or pull requests

2 participants