diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4cc72d046fd4..f14bc37a5ae7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -72,7 +72,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Workspace] Add update workspace page ([#6270](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6270))
- [Multiple Datasource] Make sure customer always have a default datasource ([#6237](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6237))
- [Workspace] Add workspace list page ([#6182](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6182))
-
+- [Workspace] Add workspaces column to saved objects page ([#6225](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6225))
+- [Multiple Datasource] Add multi data source support to sample vega visualizations ([#6218](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6218))
### 🐛 Bug Fixes
@@ -93,6 +94,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [BUG][Multiple Datasource] Fix data source filter bug and add tests ([#6152](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6152))
- [BUG][Multiple Datasource] Fix obsolete snapshots for test within data source management plugin ([#6185](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6185))
- [Workspace] Add base path when parse url in http service ([#6233](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6233))
+- [Multiple Datasource] Fix sslConfig for multiple datasource to handle when certificateAuthorities is unset ([#6282](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6282))
+- [BUG][Multiple Datasource]Fix bug in data source aggregated view to change it to depend on displayAllCompatibleDataSources property to show the badge value ([#6291](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6291))
### 🚞 Infrastructure
@@ -124,6 +127,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### 🪛 Refactoring
- Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110))
+- [Multiple Datasource] Move data source selectable to its own folder, fix test and a few type errors for data source selectable component ([#6287](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6287))
### 🔩 Tests
diff --git a/src/core/server/index.ts b/src/core/server/index.ts
index d3df420710e5..713b1494940d 100644
--- a/src/core/server/index.ts
+++ b/src/core/server/index.ts
@@ -322,6 +322,8 @@ export {
importSavedObjectsFromStream,
resolveSavedObjectsImportErrors,
SavedObjectsDeleteByWorkspaceOptions,
+ updateDataSourceNameInVegaSpec,
+ extractVegaSpecFromSavedObject,
} from './saved_objects';
export {
diff --git a/src/core/server/saved_objects/import/index.ts b/src/core/server/saved_objects/import/index.ts
index eafab25aebd4..f265f714cac9 100644
--- a/src/core/server/saved_objects/import/index.ts
+++ b/src/core/server/saved_objects/import/index.ts
@@ -43,3 +43,4 @@ export {
SavedObjectsResolveImportErrorsOptions,
SavedObjectsImportRetry,
} from './types';
+export { updateDataSourceNameInVegaSpec, extractVegaSpecFromSavedObject } from './utils';
diff --git a/src/core/server/saved_objects/import/utils.ts b/src/core/server/saved_objects/import/utils.ts
index 9bb1d10cd0eb..10481c8227b6 100644
--- a/src/core/server/saved_objects/import/utils.ts
+++ b/src/core/server/saved_objects/import/utils.ts
@@ -6,15 +6,24 @@
import { parse, stringify } from 'hjson';
import { SavedObject, SavedObjectsClientContract } from '../types';
+/**
+ * Given a Vega spec, the new datasource (by name), and spacing, update the Vega spec to add the new datasource name to each local cluster query
+ *
+ * @param {string} spec - the stringified Vega spec (HJSON or JSON)
+ * @param {string} newDataSourceName - the datasource name to append
+ * @param {number} [spacing=2] - how large the indenting should be after updating the spec (should be set to > 0 for a readable spec)
+ */
export interface UpdateDataSourceNameInVegaSpecProps {
spec: string;
newDataSourceName: string;
+ spacing?: number;
}
export const updateDataSourceNameInVegaSpec = (
props: UpdateDataSourceNameInVegaSpecProps
): string => {
- const { spec } = props;
+ const { spec, spacing } = props;
+ const stringifiedSpacing = spacing || 2;
let parsedSpec = parseJSONSpec(spec);
const isJSONString = !!parsedSpec;
@@ -39,6 +48,7 @@ export const updateDataSourceNameInVegaSpec = (
: stringify(parsedSpec, {
bracesSameLine: true,
keepWsc: true,
+ space: stringifiedSpacing,
});
};
diff --git a/src/plugins/data_source/server/client/client_config.test.ts b/src/plugins/data_source/server/client/client_config.test.ts
index e6aef818f7de..838b8bc882b4 100644
--- a/src/plugins/data_source/server/client/client_config.test.ts
+++ b/src/plugins/data_source/server/client/client_config.test.ts
@@ -46,7 +46,7 @@ describe('parseClientOptions', () => {
ssl: {
requestCert: true,
rejectUnauthorized: false,
- ca: [],
+ ca: undefined,
},
})
);
@@ -109,4 +109,31 @@ describe('parseClientOptions', () => {
})
);
});
+
+ test('test ssl config with verification mode set to full with no ca list', () => {
+ const config = {
+ enabled: true,
+ ssl: {
+ verificationMode: 'full',
+ },
+ clientPool: {
+ size: 5,
+ },
+ } as DataSourcePluginConfigType;
+ mockReadFileSync.mockReset();
+ mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`);
+ const parsedConfig = parseClientOptions(config, TEST_DATA_SOURCE_ENDPOINT);
+ expect(mockReadFileSync).toHaveBeenCalledTimes(0);
+ mockReadFileSync.mockClear();
+ expect(parsedConfig).toEqual(
+ expect.objectContaining({
+ node: TEST_DATA_SOURCE_ENDPOINT,
+ ssl: {
+ requestCert: true,
+ rejectUnauthorized: true,
+ ca: undefined,
+ },
+ })
+ );
+ });
});
diff --git a/src/plugins/data_source/server/client/client_config.ts b/src/plugins/data_source/server/client/client_config.ts
index f77986810f1b..0de0ebcf37fa 100644
--- a/src/plugins/data_source/server/client/client_config.ts
+++ b/src/plugins/data_source/server/client/client_config.ts
@@ -56,7 +56,7 @@ export function parseClientOptions(
config.ssl?.certificateAuthorities
);
- sslConfig.ca = certificateAuthorities || [];
+ sslConfig.ca = certificateAuthorities;
}
const clientOptions: ClientOptions = {
diff --git a/src/plugins/data_source/server/legacy/client_config.test.ts b/src/plugins/data_source/server/legacy/client_config.test.ts
index 67445a686f90..b8a6b1664abd 100644
--- a/src/plugins/data_source/server/legacy/client_config.test.ts
+++ b/src/plugins/data_source/server/legacy/client_config.test.ts
@@ -44,7 +44,7 @@ describe('parseClientOptions', () => {
host: TEST_DATA_SOURCE_ENDPOINT,
ssl: {
rejectUnauthorized: false,
- ca: [],
+ ca: undefined,
},
})
);
@@ -105,4 +105,30 @@ describe('parseClientOptions', () => {
})
);
});
+
+ test('test ssl config with verification mode set to full with no ca list', () => {
+ const config = {
+ enabled: true,
+ ssl: {
+ verificationMode: 'full',
+ },
+ clientPool: {
+ size: 5,
+ },
+ } as DataSourcePluginConfigType;
+ mockReadFileSync.mockReset();
+ mockReadFileSync.mockImplementation((path: string) => `content-of-${path}`);
+ const parsedConfig = parseClientOptions(config, TEST_DATA_SOURCE_ENDPOINT);
+ expect(mockReadFileSync).toHaveBeenCalledTimes(0);
+ mockReadFileSync.mockClear();
+ expect(parsedConfig).toEqual(
+ expect.objectContaining({
+ host: TEST_DATA_SOURCE_ENDPOINT,
+ ssl: {
+ rejectUnauthorized: true,
+ ca: undefined,
+ },
+ })
+ );
+ });
});
diff --git a/src/plugins/data_source/server/legacy/client_config.ts b/src/plugins/data_source/server/legacy/client_config.ts
index a3704d3ec099..a2dc81d6dc11 100644
--- a/src/plugins/data_source/server/legacy/client_config.ts
+++ b/src/plugins/data_source/server/legacy/client_config.ts
@@ -55,7 +55,7 @@ export function parseClientOptions(
config.ssl?.certificateAuthorities
);
- sslConfig.ca = certificateAuthorities || [];
+ sslConfig.ca = certificateAuthorities;
}
const configOptions: ConfigOptions = {
diff --git a/src/plugins/data_source/server/util/tls_settings_provider.test.ts b/src/plugins/data_source/server/util/tls_settings_provider.test.ts
index 3458ea8e6ccf..6852bb959310 100644
--- a/src/plugins/data_source/server/util/tls_settings_provider.test.ts
+++ b/src/plugins/data_source/server/util/tls_settings_provider.test.ts
@@ -40,7 +40,7 @@ describe('readCertificateAuthorities', () => {
expect(mockReadFileSync).toHaveBeenCalledTimes(0);
mockReadFileSync.mockClear();
expect(certificateAuthorities).toEqual({
- certificateAuthorities: [],
+ certificateAuthorities: undefined,
});
});
@@ -52,7 +52,7 @@ describe('readCertificateAuthorities', () => {
expect(mockReadFileSync).toHaveBeenCalledTimes(0);
mockReadFileSync.mockClear();
expect(certificateAuthorities).toEqual({
- certificateAuthorities: [],
+ certificateAuthorities: undefined,
});
});
});
diff --git a/src/plugins/data_source/server/util/tls_settings_provider.ts b/src/plugins/data_source/server/util/tls_settings_provider.ts
index 0924041a756d..1b86c91c3b6b 100644
--- a/src/plugins/data_source/server/util/tls_settings_provider.ts
+++ b/src/plugins/data_source/server/util/tls_settings_provider.ts
@@ -8,7 +8,7 @@ import { readFileSync } from 'fs';
export const readCertificateAuthorities = (
listOfCertificateAuthorities: string | string[] | undefined
) => {
- let certificateAuthorities: string[] | undefined = [];
+ let certificateAuthorities: string[] | undefined;
const addCertificateAuthorities = (ca: string[]) => {
if (ca && ca.length) {
diff --git a/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
index 2c789f04da12..e4f4b1f67c67 100644
--- a/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
+++ b/src/plugins/data_source_management/public/components/data_source_aggregated_view/__snapshots__/data_source_aggregated_view.test.tsx.snap
@@ -1,7 +1,49 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DataSourceAggregatedView should render normally with data source filter 1`] = `
-
+
- Data sources
+
- All
+
+ All
+
-
+
+
+
+
+
+
+
-
+
`;
exports[`DataSourceAggregatedView should render normally with local cluster and actice selections 1`] = `
-
+
- Data sources
+
- 1
+
+ 1
+
-
+
+
+
+
+
+
+
-
+
`;
exports[`DataSourceAggregatedView should render normally with local cluster hidden and all options 1`] = `
-
+
- Data sources
+
- All
+
+ 0
+
-
+