mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Maps] Use client-side authc.getCurrentUser from core.security (#186915)
Part of https://github.com/elastic/kibana/issues/186574 Background: This PR serves as an example of a plugin migrating away from depending on the Security plugin, which is a high priority effort for the last release before 9.0. The Maps plugin uses the `authc.getCurrentUser` in the `es_search_source` utility. ### Checklist Delete any items that are not applicable to this PR. - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
d5b0ddda62
commit
e7c867f34a
3 changed files with 2 additions and 10 deletions
|
@ -19,12 +19,7 @@ import { Adapters } from '@kbn/inspector-plugin/common/adapters';
|
|||
import { SortDirection, SortDirectionNumeric } from '@kbn/data-plugin/common';
|
||||
import { getTileUrlParams } from '@kbn/maps-vector-tile-utils';
|
||||
import { AbstractESSource } from '../es_source';
|
||||
import {
|
||||
getHttp,
|
||||
getSearchService,
|
||||
getSecurityService,
|
||||
getTimeFilter,
|
||||
} from '../../../kibana_services';
|
||||
import { getCore, getHttp, getSearchService, getTimeFilter } from '../../../kibana_services';
|
||||
import {
|
||||
addFieldToDSL,
|
||||
getField,
|
||||
|
@ -532,7 +527,7 @@ export class ESSearchSource extends AbstractESSource implements IMvtVectorSource
|
|||
if (!(await this._isDrawingIndex())) {
|
||||
return {};
|
||||
}
|
||||
const user = await getSecurityService()?.authc.getCurrentUser();
|
||||
const user = await getCore().security.authc.getCurrentUser();
|
||||
const timestamp = new Date().toISOString();
|
||||
return {
|
||||
created: {
|
||||
|
|
|
@ -90,7 +90,6 @@ export const getUrlForApp = () => coreStart.application.getUrlForApp;
|
|||
export const getNavigateToUrl = () => coreStart.application.navigateToUrl;
|
||||
export const getSavedObjectsTagging = () => pluginsStart.savedObjectsTagging;
|
||||
export const getPresentationUtilContext = () => pluginsStart.presentationUtil.ContextProvider;
|
||||
export const getSecurityService = () => pluginsStart.security;
|
||||
export const getSpacesApi = () => pluginsStart.spaces;
|
||||
export const getTheme = () => coreStart.theme;
|
||||
export const getApplication = () => coreStart.application;
|
||||
|
|
|
@ -36,7 +36,6 @@ import type { FileUploadPluginStart } from '@kbn/file-upload-plugin/public';
|
|||
import type { PresentationUtilPluginStart } from '@kbn/presentation-util-plugin/public';
|
||||
import type { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-plugin/public';
|
||||
import type { ChartsPluginStart } from '@kbn/charts-plugin/public';
|
||||
import type { SecurityPluginStart } from '@kbn/security-plugin/public';
|
||||
import type { SpacesPluginStart } from '@kbn/spaces-plugin/public';
|
||||
import type { CloudSetup } from '@kbn/cloud-plugin/public';
|
||||
import type { LensPublicSetup } from '@kbn/lens-plugin/public';
|
||||
|
@ -123,7 +122,6 @@ export interface MapsPluginStartDependencies {
|
|||
visualizations: VisualizationsStart;
|
||||
savedObjectsTagging?: SavedObjectTaggingPluginStart;
|
||||
presentationUtil: PresentationUtilPluginStart;
|
||||
security?: SecurityPluginStart;
|
||||
spaces?: SpacesPluginStart;
|
||||
mapsEms: MapsEmsPluginPublicStart;
|
||||
contentManagement: ContentManagementPublicStart;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue