Skip to content
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

[FEATURE] Avoid vendor-specific awsv4 library as a dependency #288

Open
dblock opened this issue Aug 29, 2022 · 2 comments
Open

[FEATURE] Avoid vendor-specific awsv4 library as a dependency #288

dblock opened this issue Aug 29, 2022 · 2 comments

Comments

@dblock
Copy link
Member

dblock commented Aug 29, 2022

Is your feature request related to a problem?

In #279 we have added a vendor-specific, aws4 library as a dependency. By design we avoid vendor-specific code to not advantage any one vendor one way or another.

What solution would you like?

A way to make that dependency optional or potentially splitting opensearch-js into opensearch-js and an addon called opensearch-aws-js.

@harshavamsi
Copy link
Collaborator

@dblock I can take a stab at this.

From my understanding, optionalDependencies exist in npm but don't work in this use case because we would need to somehow pull in the dependency if a user requests to use the signer. It merely allows us to check if the dependency is installed and proceed without if not.

We would just need to create a separate package that we can import if needed.

Essentially, const { AwsSigv4Signer } = require('@opensearch-project/opensearch/aws'); becomes const { AwsSigv4Signer } = require('@opensearch-project/opensearch-aws-js');. WDYT?

Also, I see from other client implementations that we have vendor specific code in every client with sigv4. Do we open a meta issue in OpenSearch Clients to fix all of them?

@dblock
Copy link
Member Author

dblock commented Sep 1, 2022

@harshavamsi Thanks

  1. I like your plan. Would call the package opensearch-js-aws.
  2. At least in https://github.com/opensearch-project/opensearch-java the dependencies are optional and you don't need to always drag them unless you want to do SigV4.
  3. Please do open a meta issue and if you see a client that doesn't do this, let's fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants