-
Notifications
You must be signed in to change notification settings - Fork 915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Multiple Data Source] Support SigV4 as a new auth type of datasource with aliased client #3470
[Multiple Data Source] Support SigV4 as a new auth type of datasource with aliased client #3470
Conversation
Enable usage of `@opensearch-project/opensearch@^2.x` features without breaking plugins that directly depend on `1.x` Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
Signed-off-by: Josh Romero <[email protected]>
…ct#3058) * [Multiple DataSource] Add support for SigV4 authentication Signed-off-by: Su <[email protected]>
…h-project/opensearch-next` alias Revert change to `osd-opensearch` Signed-off-by: Josh Romero <[email protected]>
logger.warn( | ||
`Error closing OpenSearch client when removing from aws client pool: ${error.message}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a common practice in OSD to issue warnings with the term "Error"? If not, we should change this to
logger.warn( | |
`Error closing OpenSearch client when removing from aws client pool: ${error.message}` | |
logger.warn( | |
`OpenSearch client failed to close while disposing from the client pool: ${error.message}` |
Also, why "AWS", that too lowercase?
} | ||
}, | ||
}); | ||
this.logger.info(`Created data source aws client pool of size ${size}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message needs rewording.
@@ -3,27 +3,38 @@ | |||
* SPDX-License-Identifier: Apache-2.0 | |||
*/ | |||
|
|||
import { Client } from 'elasticsearch'; | |||
import { Client } from '@opensearch-project/opensearch-next'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This dependency update is not needed. We are using elasticsearch
everywhere in data_source/server/legacy
, that's to support MD in legacy client use case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want a follow-up PR for main
then - that's in the original PR: https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3058/files#diff-442cda9a371f9aa2ce417631ddf7a8b80f9ec6ade15676b1cfe390f1c25b3fe7R6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad, I didn't see the new lines below. No need to change. elasticsearch
is being added in line 7.
@@ -137,7 +137,7 @@ describe('configureClient', () => { | |||
configureClient(dataSourceClientParams, clientPoolSetup, config, logger) | |||
).rejects.toThrowError(); | |||
|
|||
expect(ClientMock).toHaveBeenCalledTimes(1); | |||
expect(ClientMock).not.toHaveBeenCalled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This previously made sure it was called but also that it was called only once; is that no longer true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer true. The logic was imporved. If password determined to be contaminated, there's no need to call the Client()
to create client
@@ -113,7 +142,7 @@ const getRootClient = ( | |||
* make wrap401Errors default to false, because we don't want login pop-up from browser | |||
*/ | |||
const callAPI = async ( | |||
client: Client, | |||
client: LegacyClient, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean we are changing something that used the newer client to use the legacy client?
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## 2.x #3470 +/- ##
==========================================
- Coverage 66.54% 66.37% -0.18%
==========================================
Files 3203 3205 +2
Lines 61397 61551 +154
Branches 9453 9492 +39
==========================================
- Hits 40859 40854 -5
- Misses 18284 18424 +140
- Partials 2254 2273 +19
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-posted another PR against main
#3471, to address the below issues
- The aliasing solution should be posted against
main
, and then backport to2.x
. Because main has merged in the fix to updateyarn
version in package.json to unblock Plugin CI. If we post PR against2.x
, the same CI issue will happen again for plugins on2.x
branch.yarn
version incompatibility issue blocks Dashboards plugins CI, docker-image, windows build opensearch-build#3210
error @opensearch-project/[email protected]: The engine "yarn" is incompatible with this module. Expected version "^1.22.10". Got "1.21.1"
error Found incompatible module.
- all files under data_source component should be re-imported to use aliases, this PR is missing changes in few files.
client_config.ts
anderror.test.ts
- typo
@@ -3,7 +3,7 @@ | |||
* SPDX-License-Identifier: Apache-2.0 | |||
*/ | |||
|
|||
import { ApiResponse } from '@opensearch-project/opensearch'; | |||
import { ApiResponse } from '@opensearch-project/opensearc-next'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
Thanks Josh. We have this PR opened to backport MD sigv4 feature #3477 |
Description
Draft PR to validate that #3469 is sufficient to enable the
2.x
backporting of #3058Issues Resolved
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr