-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ingest Manager] Support registration of server side callbacks for Cr…
…eate Datasource API (#69428) * Ingest: Expose `registerExternalCallback()` method out of Ingest server `start` lifecycle * Ingest: Add support for External Callbacks on REST `createDatasourceHandler()` * Ingest: expose DatasourceServices to Plugin start interface * Endpoint: Added Endpoint Ingest handler for Create Datasources - Also moved the temporary logic from the middleware to the handler (still temporary) Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
- Loading branch information
1 parent
904be02
commit a104e5a
Showing
15 changed files
with
553 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { loggingSystemMock, savedObjectsServiceMock } from 'src/core/server/mocks'; | ||
import { IngestManagerAppContext } from './plugin'; | ||
import { encryptedSavedObjectsMock } from '../../encrypted_saved_objects/server/mocks'; | ||
import { securityMock } from '../../security/server/mocks'; | ||
import { DatasourceServiceInterface } from './services/datasource'; | ||
|
||
export const createAppContextStartContractMock = (): IngestManagerAppContext => { | ||
return { | ||
encryptedSavedObjectsStart: encryptedSavedObjectsMock.createStart(), | ||
savedObjects: savedObjectsServiceMock.createStartContract(), | ||
security: securityMock.createSetup(), | ||
logger: loggingSystemMock.create().get(), | ||
isProductionMode: true, | ||
kibanaVersion: '8.0.0', | ||
}; | ||
}; | ||
|
||
export const createDatasourceServiceMock = () => { | ||
return { | ||
assignPackageStream: jest.fn(), | ||
buildDatasourceFromPackage: jest.fn(), | ||
bulkCreate: jest.fn(), | ||
create: jest.fn(), | ||
delete: jest.fn(), | ||
get: jest.fn(), | ||
getByIDs: jest.fn(), | ||
list: jest.fn(), | ||
update: jest.fn(), | ||
} as jest.Mocked<DatasourceServiceInterface>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.