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

Migrate url shortener service #50896

Merged
merged 40 commits into from
Dec 11, 2019
Merged

Conversation

flash1293
Copy link
Contributor

This PR migrates as much as possible of the url shortener service.
In case of session storage for URL state is enabled, the url shortener service renders the app with an injected var which isn't possible in the new platform currently.

Because of this this part still resides in the legacy platform and the new url shortener service will redirect the request if session storage is enabled.

Depends on #50137

Related: #50775

@flash1293 flash1293 added Feature:SharingURLs Short URLs and Share URL features v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Feature:NP Migration v7.6.0 labels Nov 18, 2019
@flash1293 flash1293 requested a review from mshustov December 3, 2019 13:27
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@flash1293
Copy link
Contributor Author

flash1293 commented Dec 3, 2019

@elastic/kibana-security The last test failure (https://github.com/elastic/kibana/pull/50896/checks?check_run_id=331286604) looks a bit strange to me. Shouldn't the API return 403 instead of 500, so the behavior is correct but the test is assert the wrong behavior ? Not sure whether I'm missing something.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@legrego
Copy link
Member

legrego commented Dec 3, 2019

Shouldn't the API return 403 instead of 500, so the behavior is correct but the test is assert the wrong behavior ? Not sure whether I'm missing something.

I agree 403 is the correct response, rather than 500. I can't remember why it was returning 500 before -- it could have been the way the short url error handling logic was structured prior to this change.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@@ -1,6 +1,6 @@
{
"id": "share",
"version": "kibana",
"server": false,
"server": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intentional?

Copy link
Contributor

Choose a reason for hiding this comment

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

the plugin contains server part

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this means the platform should pick up the server directory for server side code. This PR moved the url shortener into the share plugin whereas before it was only a client side thing (handling the share registry)

Copy link
Contributor

@mshustov mshustov left a comment

Choose a reason for hiding this comment

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

NP part looks 👍

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

Code LGTM 👍 tested locally with state:storeInSessionStorage on/off, works as expected
one question: when you assert a valid url , wouldn't it be enough to check the url to start with /app ?

@flash1293
Copy link
Contributor Author

Merging despite app-arch code ownership. This PR will transfer ownership to the kibana app team.

@flash1293 flash1293 merged commit b6ea699 into elastic:master Dec 11, 2019
@flash1293 flash1293 deleted the migrate/url-shortener branch December 11, 2019 13:19
@flash1293
Copy link
Contributor Author

Code LGTM 👍 tested locally with state:storeInSessionStorage on/off, works as expected
one question: when you assert a valid url , wouldn't it be enough to check the url to start with /app ?

Good question, I just moved the existing functionality. As I'm always unsure in security related cases - ping @elastic/kibana-security is something blocking us to just check whether it's a valid URL that starts with the string /app? This would simplify the validation logic a bit.

flash1293 added a commit to flash1293/kibana that referenced this pull request Dec 11, 2019
jloleysens added a commit to jloleysens/kibana that referenced this pull request Dec 11, 2019
…le-sql-highlighting

* 'master' of github.com:elastic/kibana: (56 commits)
  Migrate url shortener service (elastic#50896)
  Re-enable datemath in from/to canvas timelion args (elastic#52159)
  [Logs + Metrics UI] Remove eslint exceptions (elastic#50979)
  [Logs + Metrics UI] Add missing headers in Logs & metrics (elastic#52405)
  [ML] API integration tests - initial tests for bucket span estimator (elastic#52636)
  [Watcher] New Platform (NP) Migration (elastic#50908)
  Decouple Authorization subsystem from Legacy API. (elastic#52638)
  [APM] Fix some warnings logged in APM tests (elastic#52487)
  [ui/public/utils] Delete unused base_object & find_by_param (elastic#52500)
  [ui/public/utils] Move items into ui/vis (elastic#52615)
  fix newlines in kbn-analytics build script
  Add top level examples folder and command to run, `--run-examples`. (elastic#52027)
  feat(NA): add trap for SIGINT in the git precommit hook (elastic#52662)
  [DOCS] Updtes description of elasticsearch.requestHeadersWhitelist (elastic#52675)
  [Telemetry/Pulse] Updates advanced settings text for usage data (elastic#52657)
  [SIEM][Detection Engine] Adds the default name space to the end of the signals index
  [Logs UI] Generalize ML module management (elastic#50662)
  Removing stateful saved object finder (elastic#52166)
  Shim oss telemetry (elastic#51168)
  [Reporting/Screenshots] Do not fail the report if request is aborted (elastic#52344)
  ...

# Conflicts:
#	src/legacy/core_plugins/console/public/legacy.ts
#	src/legacy/core_plugins/console/public/np_ready/application/models/legacy_core_editor/mode/elasticsearch_sql_highlight_rules.ts
#	src/legacy/core_plugins/console/public/np_ready/lib/autocomplete/components/full_request_component.ts
#	src/legacy/core_plugins/console/public/quarantined/src/sense_editor/row_parser.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:NP Migration Feature:SharingURLs Short URLs and Share URL features release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants