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

Provide url rewritten in onPreRouting interceptor #80810

Merged
merged 4 commits into from
Oct 20, 2020

Conversation

mshustov
Copy link
Contributor

Summary

Provide an original url rewritten in onPreRouting interceptor as KibanaRequest.rewrittenUrl property.
Closes #80485

Checklist

For maintainers

Plugin API Changes

Original URL rewritten in onPreRouting interceptor is provided in KibanaRequest.rewrittenUrl property.

@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. v8.0.0 v7.11.0 labels Oct 16, 2020
@mshustov mshustov requested a review from a team as a code owner October 16, 2020 09:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@mshustov mshustov requested a review from thomheymann October 16, 2020 09:45
@thomheymann
Copy link
Contributor

Nice, looks great - Thanks for adding this so quickly! ❤️

const appState = request.app as KibanaRequestState | undefined;
this.id = appState?.requestId ?? uuid.v4();
this.uuid = appState?.requestUuid ?? uuid.v4();
this.rewrittenUrl = appState?.rewrittenUrl;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we default to request.url or do we want rewrittenUrl to be explicitly undefined when no interceptor rewrites it? Either way, we probably should add a test for this behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd prefer it to be undefined. I will add a test

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mshustov mshustov merged commit eb29ab8 into elastic:master Oct 20, 2020
@mshustov mshustov deleted the issue-80485-original-url branch October 20, 2020 05:56
mshustov added a commit to mshustov/kibana that referenced this pull request Oct 20, 2020
* keep url rewritten in onPreRouting interceptor

* update docs

* add test on undefined
mshustov added a commit that referenced this pull request Oct 20, 2020
* keep url rewritten in onPreRouting interceptor

* update docs

* add test on undefined
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 20, 2020
…lout-for-warm-and-cold-tier

* 'master' of github.com:elastic/kibana: (126 commits)
  Add cumulative sum expression function (elastic#80129)
  [APM] Fix link to trace (elastic#80993)
  Provide url rewritten in onPreRouting interceptor (elastic#80810)
  limit renovate to npm packages
  Fix bug in logs UI link (elastic#80943)
  [Monitoring] Fix bug with setup mode appearing on pages it shouldn't (elastic#80343)
  [Security Solution][Detection Engine] Fixes false positives caused by empty records in threat list
  docs test (elastic#81080)
  Fixed alerts ui test timeout issue, related to the multiple server calls for delete all alerts, by reducing the number of alerts to the two and increasing retry timeout. (elastic#81067)
  [APM] Fix service map highlighted edge on node select (elastic#80791)
  Fix typo in toast, slight copy adjustment. (elastic#80843)
  [Security Solution] reduce optimizer limits (elastic#80997)
  [maps] 7.10 documentation updates (elastic#79917)
  [Workplace Search] Fix Group Prioritization route and clean up design (elastic#80903)
  [Enterprise Search] Added reusable HiddenText component to Credentials (elastic#80033)
  Upgrade EUI to v29.5.0 (elastic#80753)
  [Maps] Fix layer-flash when changing style (elastic#80948)
  [Security Solution] [Detections] Disable edit button when user does not have actions privileges w/ rule + actions (elastic#80220)
  [Enterprise Search] Handle loading state on Credentials page (elastic#80035)
  [Monitoring] Fix cluster listing page in how it handles global state (elastic#78979)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.11.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request object should provide original url after url re-writing
5 participants