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

Missing credentials result in 401 UNAUTHORIZED responses from conjure-undertow #656

Merged
merged 5 commits into from Nov 26, 2019

Conversation

carterkozak
Copy link
Contributor

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==

@changelog-app
Copy link

changelog-app bot commented Nov 22, 2019

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

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.

Check the box to generate changelog(s)

  • Generate changelog entry

carterkozak and others added 4 commits November 25, 2019 13:06
…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.
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);
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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 🙄

@dansanduleac
Copy link
Contributor

👍

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

Successfully merging this pull request may close these issues.

None yet

3 participants