-
Notifications
You must be signed in to change notification settings - Fork 123
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
Inherit AwsSigV4 in .child #725
Inherit AwsSigV4 in .child #725
Conversation
Thanks @bandinib-amzn would you explain what's usage for this enhancement. e.g. support what feature in OSD. and targeting which version of OSD release. @ananzh @kavilla @dblock and team would you help to take a look. |
@Flyingliuhub @BionIT @ZilongX @zengyan-amazon would you also help to take a look. |
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.
LGTM, just needs that console.log
removed
.catch(t.fail); | ||
|
||
child.on('request', (err, { meta }) => { | ||
debug('Count', count); |
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.
getCredentialsCalled
and count
are used similarly to track the count. Should we use a consistent name, or should we make count
more meaningful name 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.
getCredentialsCalled
is tracking how many times getCredentials
function called. and count
is tracking requests. I would keep count
to be consistent with other UT.
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
fbd1ee6
to
49971dc
Compare
We already have the In OpenSearch-Dashboards, when utilizing the multi-data source feature to create data sources, we employ the opensearch-js library to instantiate the client. Currently, we leverage .child for basic authentication, as demonstrated here. However, similar support for AWSSigV4 has not been implemented, necessitating the creation of a new client every time. With this modification, we can generate multiple child clients from the same parent client (on the same node and SSL) by passing credentials via We are targeting OSD 2.13 release. @dblock How is the release schedule look like for |
Signed-off-by: Bandini Bhopi <bandinib@amazon.com>
Description
There are some use cases where you may need multiple instances of the client. You can easily do that by calling new
Client()
as many times as you need, but you will lose all the benefits of using one single client, such as the long living connections and the connection pool handling.As of today, we have
client.child
API, which returns a new client instance that shares the connection pool with the parent client. But this only supported for Basic Authentication type (with username and password). This PR adds the child client support for AWSSigv4.Example:
Issues Resolved
#696
Check List
yarn run lint
doesn't show any errorsBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.