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 the bootstrap.js endpoint to Kibana Platform #54375

Closed
eliperelman opened this issue Jan 9, 2020 · 7 comments · Fixed by #92784
Closed

Migrate the bootstrap.js endpoint to Kibana Platform #54375

eliperelman opened this issue Jan 9, 2020 · 7 comments · Fixed by #92784
Assignees
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@eliperelman
Copy link
Contributor

Currently the logic for rendering the bootstrap.js endpoint exists in the legacy ui_render_mixin. Now that the server rendering service exists, we should be able to move this routing logic to the new platform.

@eliperelman eliperelman added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Jan 9, 2020
@elasticmachine
Copy link
Contributor

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

@pgayvallet
Copy link
Contributor

I think we are going to have an issue here because the '/bundles/app/{id}/bootstrap.js' route uses try HAPI authent mode which we do not support on NP (and that we are currently not planing to support, see #41959)

server.route({
path: '/bundles/app/{id}/bootstrap.js',
method: 'GET',
config: {
tags: ['api'],
auth: authEnabled ? { mode: 'try' } : false,
},

Other things to solve:

const app = server.getUiAppById(id) || server.getHiddenUiAppById(id);

and (I think ?)

...kbnServer.uiExports.styleSheetPaths

@joshdover
Copy link
Contributor

It looks like we're only using the try auth mode to guard getting the theme:darkMode uiSetting. I really don't think there's a security risk to using the Kibana internal user for getting this setting instead.

The getUiApp + getHiddenUiApp logic is obsolete in the new platform because we always render the same core bundle.

I believe the uiExports.stylesheet issue will be resolved once sass-loader is added to our Webpack config in #53532 and all plugins migrate to using webpack imports for styles.

@pgayvallet
Copy link
Contributor

The getUiApp + getHiddenUiApp logic is obsolete in the new platform because we always render the same core bundle.

Yes, however if we migrate now we will still need it to render legacy apps.

@joshdover joshdover added this to 7.9 - Tentative in kibana-core [DEPRECATED] Mar 16, 2020
@joshdover joshdover moved this from 7.9 - Tentative to 7.10 (tentative) in kibana-core [DEPRECATED] Apr 22, 2020
@joshdover joshdover added the Feature:Legacy Removal Issues related to removing legacy Kibana label Apr 26, 2020
@joshdover joshdover moved this from 7.10 - Tentative to 7.11 - Tenatitive in kibana-core [DEPRECATED] May 28, 2020
@tylersmalley
Copy link
Contributor

Instead of migrating bootstrap.js, could we get rid of it and move the logic to the main page template? I have always felt that the bootstrap file was a needless delay.

@pgayvallet
Copy link
Contributor

could we get rid of it and move the logic to the main page template? I have always felt that the bootstrap file was a needless delay.

We probably can yea, even if I'd prefer to first migrate the endpoint before trying to factorize it with the rendering service logic.

@pgayvallet
Copy link
Contributor

pgayvallet commented Feb 25, 2021

could we get rid of it and move the logic to the main page template? I have always felt that the bootstrap file was a needless delay.

TIL, because of our CSP policy, we can't inline bootstrap.js into our main app template easily, so using a real js file can't be avoided, unless some quite impacting changes in our csp returning logic to allow to add an nonce-XXX to inline the script.

@joshdover joshdover moved this from 7.13 - Tentative to In Progress in kibana-core [DEPRECATED] Mar 3, 2021
kibana-core [DEPRECATED] automation moved this from In Progress to Done (7.13) Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Legacy Removal Issues related to removing legacy Kibana Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
Development

Successfully merging a pull request may close this issue.

5 participants