Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opensearch-project/OpenSearch-Dashboards
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 105a81e0fc3950c0ee7cf901bb33d3bca3688bc8
Choose a base ref
..
head repository: opensearch-project/OpenSearch-Dashboards
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fbd76f2b118a9352176d4eb2f886687eba3f2f7d
Choose a head ref
Showing with 1 addition and 45 deletions.
  1. +1 −0 CHANGELOG.md
  2. +0 −45 src/plugins/data_source/server/client/configure_client.ts
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -62,6 +62,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- [Data] Update `createAggConfig` so that newly created configs can be added to beginning of `aggConfig` array ([#3160](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3160))
- Add disablePrototypePoisoningProtection configuration to prevent JS client from erroring when cluster utilizes JS reserved words ([#2992](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2992))
- [Multiple DataSource] Add support for SigV4 authentication ([#3058](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3058))
- [Multiple DataSource] Refactor test connection to support SigV4 auth type ([#3456](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3456))

### 🐛 Bug Fixes

45 changes: 0 additions & 45 deletions src/plugins/data_source/server/client/configure_client.ts
Original file line number Diff line number Diff line change
@@ -82,51 +82,6 @@ export const configureClient = async (
}
};

export const configureTestClient = async (
{ savedObjects, cryptography, dataSourceId }: DataSourceClientParams,
dataSourceAttr: DataSourceAttributes,
openSearchClientPoolSetup: OpenSearchClientPoolSetup,
config: DataSourcePluginConfigType,
logger: Logger
): Promise<Client> => {
try {
const {
auth: { type, credentials },
} = dataSourceAttr;
let requireDecryption = false;

const rootClient = getRootClient(
dataSourceAttr,
openSearchClientPoolSetup.getClientFromPool,
dataSourceId
) as Client;

if (dataSourceId) {
if (
(type === AuthType.UsernamePasswordType && !credentials?.password) ||
(type === AuthType.SigV4 && !credentials?.accessKey && !credentials?.secretKey)
) {
dataSourceAttr = await getDataSource(dataSourceId, savedObjects);
requireDecryption = true;
}
}

return getQueryClient(
dataSourceAttr,
openSearchClientPoolSetup.addClientToPool,
config,
cryptography,
rootClient,
dataSourceId,
requireDecryption
);
} catch (error: any) {
logger.error(`Failed to get test client. ${error}: ${error.stack}`);
// Re-throw as DataSourceError
throw createDataSourceError(error);
}
};

/**
* Create a child client object with given auth info.
*