diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts index 60375a918398c..9a4a3b6e1c0ce 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/anonymization_fields/helpers.ts @@ -11,7 +11,7 @@ import { AnonymizationFieldResponse, AnonymizationFieldUpdateProps, } from '@kbn/elastic-assistant-common/impl/schemas/anonymization_fields/bulk_crud_anonymization_fields_route.gen'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { CreateAnonymizationFieldSchema, EsAnonymizationFieldsSchema, diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.test.ts index e8ccdbc1d25ca..6e9cc39597bd7 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.test.ts @@ -9,7 +9,7 @@ import { elasticsearchServiceMock } from '@kbn/core-elasticsearch-server-mocks'; import { createAttackDiscovery } from './create_attack_discovery'; import { AttackDiscoveryCreateProps, AttackDiscoveryResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { getAttackDiscovery } from './get_attack_discovery'; import { loggerMock } from '@kbn/logging-mocks'; const mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.ts index 937c78e4b9eb1..e7df1fbb020f9 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/create_attack_discovery.ts @@ -6,10 +6,9 @@ */ import { v4 as uuidv4 } from 'uuid'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { AttackDiscoveryCreateProps, AttackDiscoveryResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; import { getAttackDiscovery } from './get_attack_discovery'; import { CreateAttackDiscoverySchema } from './types'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/find_attack_discovery_by_connector_id.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/find_attack_discovery_by_connector_id.ts index 28a99cb644951..532c35ac89c05 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/find_attack_discovery_by_connector_id.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/find_attack_discovery_by_connector_id.ts @@ -5,9 +5,8 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { AttackDiscoveryResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { EsAttackDiscoverySchema } from './types'; import { transformESSearchToAttackDiscovery } from './transforms'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/get_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/get_attack_discovery.ts index 57d4e167d2fa9..d0cf6fd19ae05 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/get_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/get_attack_discovery.ts @@ -5,9 +5,8 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { AttackDiscoveryResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { EsAttackDiscoverySchema } from './types'; import { transformESSearchToAttackDiscovery } from './transforms'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.test.ts index df8615d0336cf..9664465c264b9 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.test.ts @@ -14,7 +14,7 @@ import { AttackDiscoveryStatus, AttackDiscoveryUpdateProps, } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; jest.mock('./get_attack_discovery'); const mockEsClient = elasticsearchServiceMock.createElasticsearchClient(); const mockLogger = loggerMock.create(); diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.ts index 8db6a2ed2968a..667e5e36e82f5 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/attack_discovery/update_attack_discovery.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { AttackDiscoveryResponse, AttackDiscoveryStatus, @@ -13,7 +13,6 @@ import { Provider, UUID, } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import * as uuid from 'uuid'; import { EsReplacementSchema } from '../conversations/types'; import { getAttackDiscovery } from './get_attack_discovery'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.test.ts index 624eab7d30bbd..6fba2f9c8b606 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.test.ts @@ -12,7 +12,7 @@ import { estypes } from '@elastic/elasticsearch'; import { EsConversationSchema } from './types'; import { getConversation } from './get_conversation'; import { ConversationCreateProps, ConversationResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; jest.mock('./get_conversation', () => ({ getConversation: jest.fn(), diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.ts index 0a5472e79b12c..b98b8a1f4cc27 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/create_conversation.ts @@ -6,14 +6,13 @@ */ import { v4 as uuidv4 } from 'uuid'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { ConversationCategoryEnum, ConversationCreateProps, ConversationResponse, } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; import { getConversation } from './get_conversation'; import { CreateMessageSchema } from './types'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.test.ts index 1c1dd0c2fdb24..a5a292c096cdc 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.test.ts @@ -5,14 +5,13 @@ * 2.0. */ -import type { Logger } from '@kbn/core/server'; +import type { AuthenticatedUser, Logger } from '@kbn/core/server'; import { elasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; import { getConversation } from './get_conversation'; import { estypes } from '@elastic/elasticsearch'; import { EsConversationSchema } from './types'; import { loggingSystemMock } from '@kbn/core-logging-server-mocks'; import { ConversationResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; export const getConversationResponseMock = (): ConversationResponse => ({ createdAt: '2020-04-20T15:25:31.830Z', diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.ts index 7d011c9f21433..c4e40caa6654b 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/get_conversation.ts @@ -5,9 +5,8 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { ConversationResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { EsConversationSchema } from './types'; import { transformESSearchToConversations } from './transforms'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.test.ts index 38426dd06a36f..c177ea261ad90 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.test.ts @@ -7,7 +7,7 @@ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import type { UpdateByQueryRequest } from '@elastic/elasticsearch/lib/api/types'; import { AIAssistantConversationsDataClient } from '.'; -import { AuthenticatedUser } from '@kbn/security-plugin/server'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { getUpdateConversationSchemaMock } from '../../__mocks__/conversations_schema.mock'; import { AIAssistantDataClientParams } from '..'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.ts index c937e86a982f6..72c51d8f917aa 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AuthenticatedUser } from '@kbn/security-plugin/server'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { ConversationCreateProps, ConversationResponse, diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.test.ts index f106a1f3bf7f5..d3e4fff018abb 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.test.ts @@ -14,7 +14,7 @@ import { } from './update_conversation'; import { getConversation } from './get_conversation'; import { ConversationResponse, ConversationUpdateProps } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; export const getUpdateConversationOptionsMock = (): ConversationUpdateProps => ({ id: 'test', diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.ts index 30888ea219401..47a9594f42cab 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/conversations/update_conversation.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { ConversationResponse, Reader, @@ -15,7 +15,6 @@ import { ConversationSummary, UUID, } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { getConversation } from './get_conversation'; import { getUpdateScript } from './helpers'; import { EsReplacementSchema } from './types'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.test.ts index 4838c70882f19..d6910f67f1167 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.test.ts @@ -6,7 +6,7 @@ */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; import { AIAssistantDataClient, AIAssistantDataClientParams } from '.'; -import { AuthenticatedUser } from '@kbn/security-plugin/server'; +import { AuthenticatedUser } from '@kbn/core-security-common'; const date = '2023-03-28T22:27:28.159Z'; let logger: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts index 5bc84e05c8087..9c88765863724 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts @@ -5,11 +5,10 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { ESSearchRequest, ESSearchResponse } from '@kbn/es-types'; -import { AuthenticatedUser } from '@kbn/security-plugin/server'; import { estypes } from '@elastic/elasticsearch'; import { IIndexPatternString } from '../types'; import { getIndexTemplateAndPattern } from '../lib/data_stream/helpers'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts index 90c0850c503fe..97060a0f48aa6 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts @@ -6,13 +6,12 @@ */ import { v4 as uuidv4 } from 'uuid'; -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { KnowledgeBaseEntryCreateProps, KnowledgeBaseEntryResponse, } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; import { getKnowledgeBaseEntry } from './get_knowledge_base_entry'; import { CreateKnowledgeBaseEntrySchema } from './types'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/get_knowledge_base_entry.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/get_knowledge_base_entry.ts index c021e022765d0..7820abfbcfe25 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/get_knowledge_base_entry.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/get_knowledge_base_entry.ts @@ -5,9 +5,8 @@ * 2.0. */ -import { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { KnowledgeBaseEntryResponse } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { EsKnowledgeBaseEntrySchema } from './types'; import { transformESSearchToKnowledgeBaseEntry } from './transforms'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts index 3a64dc8bb3252..83d7713c23f1f 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/prompts/helpers.ts @@ -11,7 +11,7 @@ import { PromptResponse, PromptUpdateProps, } from '@kbn/elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { CreatePromptSchema, EsPromptsSchema, UpdatePromptSchema } from './types'; export const transformESToPrompts = (response: EsPromptsSchema[]): PromptResponse[] => { diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts index adf31630fdf04..b9079c59a0643 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts @@ -10,7 +10,7 @@ import { IndicesGetDataStreamResponse } from '@elastic/elasticsearch/lib/api/typ import { errors as EsErrors } from '@elastic/elasticsearch'; import { ReplaySubject, Subject } from 'rxjs'; import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; -import { AuthenticatedUser } from '@kbn/security-plugin/server'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { conversationsDataClientMock } from '../__mocks__/data_clients.mock'; import { AIAssistantConversationsDataClient } from '../ai_assistant_data_clients/conversations'; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts index 351508da01a5a..02d54ef31ab75 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.ts @@ -7,10 +7,9 @@ import { DataStreamSpacesAdapter, FieldMap } from '@kbn/data-stream-adapter'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; -import type { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { AuthenticatedUser, Logger, ElasticsearchClient } from '@kbn/core/server'; import type { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; import type { MlPluginSetup } from '@kbn/ml-plugin/server'; -import { AuthenticatedUser } from '@kbn/security-plugin/server'; import { Subject } from 'rxjs'; import { attackDiscoveryFieldMap } from '../ai_assistant_data_clients/attack_discovery/field_maps_configuration'; import { getDefaultAnonymizationFields } from '../../common/anonymization'; diff --git a/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.test.ts b/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.test.ts index ed6edae590c99..35653878fa2d2 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.test.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.test.ts @@ -5,13 +5,12 @@ * 2.0. */ -import type { ElasticsearchClient, Logger } from '@kbn/core/server'; +import type { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { loggingSystemMock, elasticsearchServiceMock } from '@kbn/core/server/mocks'; import { getCreateConversationSchemaMock, getUpdateConversationSchemaMock, } from '../../__mocks__/conversations_schema.mock'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; import { DocumentsDataWriter } from './documents_data_writer'; describe('DocumentsDataWriter', () => { diff --git a/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.ts b/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.ts index 3cae3972c8bf6..2b8e7237435ba 100644 --- a/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.ts +++ b/x-pack/plugins/elastic_assistant/server/lib/data_stream/documents_data_writer.ts @@ -11,9 +11,8 @@ import type { BulkResponseItem, Script, } from '@elastic/elasticsearch/lib/api/types'; -import type { Logger, ElasticsearchClient } from '@kbn/core/server'; +import type { AuthenticatedUser, Logger, ElasticsearchClient } from '@kbn/core/server'; import { UUID } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; export interface BulkOperationError { message: string; diff --git a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.test.ts index 769bd069cb040..e8055de3b12b9 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.test.ts @@ -14,7 +14,7 @@ import { getEmptyFindResult, getFindAnonymizationFieldsResultWithSingleHit, } from '../../__mocks__/response'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { bulkActionAnonymizationFieldsRoute } from './bulk_actions_route'; import { getAnonymizationFieldMock, diff --git a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.test.ts index 9d5ba91abdaf4..3ae236f12902f 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.test.ts @@ -11,7 +11,7 @@ import { requestContextMock } from '../../__mocks__/request_context'; import { getPromptsBulkActionRequest, requestMock } from '../../__mocks__/request'; import { ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION } from '@kbn/elastic-assistant-common'; import { getEmptyFindResult, getFindPromptsResultWithSingleHit } from '../../__mocks__/response'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; import { bulkPromptsRoute } from './bulk_actions_route'; import { getCreatePromptSchemaMock, diff --git a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts index 1bfdf33fdb146..75b05dced83ec 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts @@ -56,7 +56,7 @@ export class RequestContextFactory implements IRequestContextFactory { const getSpaceId = (): string => startPlugins.spaces?.spacesService?.getSpaceId(request) || DEFAULT_NAMESPACE_STRING; - const getCurrentUser = () => startPlugins.security?.authc.getCurrentUser(request); + const getCurrentUser = () => coreContext.security.authc.getCurrentUser(); return { core: coreContext, diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.test.ts index 3fbb83534b1dd..39c25ac6749e9 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.test.ts @@ -15,7 +15,7 @@ import { getUpdateConversationSchemaMock, } from '../../__mocks__/conversations_schema.mock'; import { appendConversationMessageRoute } from './append_conversation_messages_route'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Append conversation messages route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.test.ts index 09247b1c47cb4..582651b4cdc9b 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.test.ts @@ -21,7 +21,7 @@ import { getPerformBulkActionSchemaMock, getUpdateConversationSchemaMock, } from '../../__mocks__/conversations_schema.mock'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Perform bulk action route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.test.ts index 5b2737436fa8c..0659b8d43a38f 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.test.ts @@ -17,7 +17,7 @@ import { getQueryConversationParams, } from '../../__mocks__/conversations_schema.mock'; import { ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Create conversation route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.test.ts index 4204a7e51ef9d..128a380c9221a 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.test.ts @@ -15,7 +15,7 @@ import { getConversationMock, getQueryConversationParams, } from '../../__mocks__/conversations_schema.mock'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Delete conversation route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.test.ts index 36dd3045b9d23..d2ea1bb5936d3 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.test.ts @@ -14,7 +14,7 @@ import { getQueryConversationParams, } from '../../__mocks__/conversations_schema.mock'; import { ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID } from '@kbn/elastic-assistant-common'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Read conversation route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.test.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.test.ts index 6b1f41c46c1bf..dd3b7bf1e577d 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.test.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.test.ts @@ -14,7 +14,7 @@ import { getUpdateConversationSchemaMock, } from '../../__mocks__/conversations_schema.mock'; import { updateConversationRoute } from './update_route'; -import { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import { AuthenticatedUser } from '@kbn/core-security-common'; describe('Update conversation route', () => { let server: ReturnType; diff --git a/x-pack/plugins/elastic_assistant/server/types.ts b/x-pack/plugins/elastic_assistant/server/types.ts index 50028bfcfd198..10bd2a3fe62c6 100755 --- a/x-pack/plugins/elastic_assistant/server/types.ts +++ b/x-pack/plugins/elastic_assistant/server/types.ts @@ -10,6 +10,7 @@ import type { PluginStartContract as ActionsPluginStart, } from '@kbn/actions-plugin/server'; import type { + AuthenticatedUser, CoreRequestHandlerContext, CoreSetup, AnalyticsServiceSetup, @@ -17,12 +18,12 @@ import type { IRouter, KibanaRequest, Logger, + SecurityServiceStart, } from '@kbn/core/server'; import { type MlPluginSetup } from '@kbn/ml-plugin/server'; import { DynamicStructuredTool, Tool } from '@langchain/core/tools'; import { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server'; import { TaskManagerSetupContract } from '@kbn/task-manager-plugin/server'; -import { AuthenticatedUser, SecurityPluginStart } from '@kbn/security-plugin/server'; import { RetrievalQAChain } from 'langchain/chains'; import { ElasticsearchClient } from '@kbn/core/server'; import { @@ -99,7 +100,7 @@ export interface ElasticAssistantPluginSetupDependencies { export interface ElasticAssistantPluginStartDependencies { actions: ActionsPluginStart; spaces?: SpacesPluginStart; - security: SecurityPluginStart; + security: SecurityServiceStart; } export interface ElasticAssistantApiRequestHandlerContext { diff --git a/x-pack/plugins/elastic_assistant/tsconfig.json b/x-pack/plugins/elastic_assistant/tsconfig.json index d5fef57edaf09..f63a8da530196 100644 --- a/x-pack/plugins/elastic_assistant/tsconfig.json +++ b/x-pack/plugins/elastic_assistant/tsconfig.json @@ -34,12 +34,10 @@ "@kbn/core-saved-objects-utils-server", "@kbn/core-elasticsearch-client-server-mocks", "@kbn/task-manager-plugin", - "@kbn/security-plugin", "@kbn/es-query", "@kbn/es-types", "@kbn/config-schema", "@kbn/spaces-plugin", - "@kbn/security-plugin-types-common", "@kbn/ml-response-stream", "@kbn/data-plugin", "@kbn/i18n",