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

[Enterprise Search] Request handler refactors/enhancements + update existing routes to use shared handler #76106

Merged
merged 8 commits into from
Aug 28, 2020

Commits on Aug 27, 2020

  1. Refactor enterprise_search_request_handler to a class that stores con…

    …fig/log
    
    - So that routes don't have to continuously pass it in - just params that actually change (paths, queries)
    
    + misc refactors/lint fixes from code review
    cee-chen committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    4804aee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ffb659f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95c20aa View commit details
    Browse the repository at this point in the history
  4. Update /api/app_search/engines route to use new handler

    - This required updating the shared handler to accept custom params set by the route, since the engines route transmutes some param names
    - createRequest mock also had to be updated to correctly reflect a curried function in order to get tests passing
    cee-chen committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    9fae604 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    134d13c View commit details
    Browse the repository at this point in the history
  6. Update shared handler to output specific message for auth errors

    - Check for /login URL (indicates auth issue)
    - Refactor final catch return to allow being passed messages from previous throw
    - Change hasValidData fallback to only log (potentially sensitive?) JSON data to server, not to client
    - Minor test cleanup - move error tests to single describe block, minor URL/newline cleanup
    cee-chen committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    4d1f6f9 View commit details
    Browse the repository at this point in the history
  7. Update handler to pass method & body requests + pass back response code

    - This will support future POST requests as well as support (e.g.) 404 responses
    
    Minor test refactors:
    - Set up new request defaults (method, empty body) + expected output & convert KibanaAuthHeader to string since they're set so close to one another
    - group request pass tests into a describe block, remove response body portion of their tests (since we don't really care about that for those tests)
    - group response tests into describe block
    - clarify how passed handler params arg overrides request.params
    cee-chen committed Aug 27, 2020
    Configuration menu
    Copy the full SHA
    74a4149 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f6a709d View commit details
    Browse the repository at this point in the history