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

Preserving boom error headers for index pattern exceptions #17725

Merged
merged 3 commits into from
Apr 18, 2018

Conversation

kobelb
Copy link
Contributor

@kobelb kobelb commented Apr 16, 2018

Fixes the specific situation outlined here: #9583

This PR does expose the entire Elasticsearch Boom error in the HTTP response, were we concerned about disclosing too much information when doing this previously that we switched to always wrapping it and only maintaining the error message and status code @kjbekkelund ?

A more holistic approach is explored here but it has it's short-comings.

"Release Note: Resolving issue with the index pattern APIs not responding with WWW-Authenticate headers on 401s which caused basic auth via Kibana to not work appropriately in some configurations"

@kobelb kobelb requested review from spalger and kimjoar April 16, 2018 20:13
@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@kimjoar kimjoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, damn — great find. When I initially added the same code (5009435) it was because Boom.wrap started throwing when it received a "Boom object", so the test case was only focused on that. That's why I ended up removing it again when moving to Boom.boomify in b19c823.

I don't think there are any problems with this approach in the short-term, but I agree that long-term #17724 would be a better approach.

LGTM

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I had no idea that Boom.boomify would reinitialize the error.output property completely... There might be other places this is necessary... but I'm happy with what you have here to address the index_patterns API specifically.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:fix Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v6.3.0 v7.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants