-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add endpoint validation to create data source API
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
- Loading branch information
1 parent
22e2a70
commit 6121267
Showing
6 changed files
with
120 additions
and
19 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/plugins/data_source/server/data_source_service.mock.ts
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,16 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
// eslint-disable-next-line @osd/eslint/no-restricted-paths | ||
import { opensearchClientMock } from '../../../../src/core/server/opensearch/client/mocks'; | ||
import { DataSourceServiceSetup } from './data_source_service'; | ||
|
||
const dataSourceClient = opensearchClientMock.createInternalClient(); | ||
const create = () => | ||
(({ | ||
getDataSourceClient: jest.fn(() => Promise.resolve(dataSourceClient)), | ||
getDataSourceLegacyClient: jest.fn(), | ||
} as unknown) as jest.Mocked<DataSourceServiceSetup>); | ||
|
||
export const dataSourceServiceSetupMock = { create }; |
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
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
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,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export const DATA_SOURCE_TITLE_LENGTH_LIMIT = 32; |