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
Missing credentials result in 401 UNAUTHORIZED responses from conjure-undertow #656
Conversation
Generate changelog in
|
.../src/main/java/com/palantir/conjure/java/undertow/runtime/ConjureAuthorizationExtractor.java
Outdated
Show resolved
Hide resolved
...java-undertow-runtime/src/test/java/com/palantir/conjure/java/undertow/runtime/AuthTest.java
Outdated
Show resolved
Hide resolved
...java-undertow-runtime/src/test/java/com/palantir/conjure/java/undertow/runtime/AuthTest.java
Outdated
Show resolved
Hide resolved
…e-undertow Previously we responded with a 400 bad request status, which isn't as accurate as we would like. Added cusom `Conjure` namespaced ErrorTypes for better observability, updated existing FrameworkExceptions to do the same.
beadfe3
to
b71ba24
Compare
return new FrameworkException(message, StatusCodes.UNPROCESSABLE_ENTITY, cause, args); | ||
static FrameworkException unprocessableEntity( | ||
@CompileTimeConstant String message, Throwable cause, Arg<?>... args) { | ||
return new FrameworkException(message, UNPROCESSABLE_ENTITY, StatusCodes.UNPROCESSABLE_ENTITY, cause, args); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should get the status code out of the ErrorType.Code
directly rather than potentially creating a mismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FrameworkException is an internal detail of conjure-undertow to support failures which do not have a status code in ErrorType.Code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never mind, I guess you can't really do that since that enum doesn't define a code for 412 nor 415 🙄
...tow-runtime/src/main/java/com/palantir/conjure/java/undertow/runtime/FrameworkException.java
Show resolved
Hide resolved
👍 |
Previously we responded with a 400 bad request status, which isn't quite accurate.
Added custom
Conjure
namespaced ErrorTypes for better observability,updated existing FrameworkExceptions to do the same.
After this PR
==COMMIT_MSG==
Missing credentials result in 401 UNAUTHORIZED responses from conjure-undertow
Previously we responded with a 400 bad request status, which isn't as accurate as we would like.
==COMMIT_MSG==