Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Meta] Middlewares have different HTTP response codes for auth errors #17

Open
jamietanna opened this issue May 29, 2024 · 1 comment
Open

Comments

@jamietanna
Copy link
Member

Looks like this should be aligned everywhere.

case *openapi3filter.SecurityRequirementsError:
return http.StatusUnauthorized, err

https://github.com/oapi-codegen/echo-middleware/blob/bd401ffc8b5c352e067dc6a2bf2a47fcb6b4e2d2/oapi_validate.go#L174

@mromaszewicz
Copy link
Member

IMO, every bug we hit where a hardcoded behavior is incorrect or inconsistent is an opportunity to allow the user to parameterize the response. I'll think about how to do this. We don't want to change existing behavior, but also we need to allow users to handle that error themselves.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants