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] Support OpenSearch Serverless request signing #287

Closed
Tracked by #44
pingleig opened this issue Dec 3, 2022 · 5 comments
Closed
Tracked by #44

[FEATURE] Support OpenSearch Serverless request signing #287

pingleig opened this issue Dec 3, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@pingleig
Copy link

pingleig commented Dec 3, 2022

Is your feature request related to a problem?

Current builtin AwsSdk2Transport does not work with serverless https://aws.amazon.com/opensearch-service/features/serverless/ because:

External library does not work due to Content-Length

The official guide is using AWS SDK v1 https://github.com/awsdocs/amazon-opensearch-service-developer-guide/blob/master/sample_code/AmazonOpenSearchJavaClient-main/src/main/java/AmazonOpenSearchServiceSample.java

What solution would you like?

  • Document what customer can use when they want to interact with OpenSearch serverless using Java client. The full interceptor code is actually not long, e.g. my modified version
  • Allow configure service name, signer and Content-Length behavior in the AwsSdk2Transport (but I am not sure if we can valid it ...

What alternatives have you considered?

Do you have any additional context?

I have a demo repo https://github.com/pingleig/opensearch-unofficial-demo

@dblock
Copy link
Member

dblock commented Dec 9, 2022

Thanks for reporting this @pingleig!

@dblock
Copy link
Member

dblock commented Jan 3, 2023

Beyond request signing, APIs such as info() don't exist/work. We need a plan to support serverless similarly to how we support multiple versions of OpenSearch, except that now we have to deal with multiple target services and multiple semvers.

@wbeckler
Copy link

wbeckler commented Jan 6, 2023

Is it possible that someone could make it unnecessary to specify a service name and that the client would try aoss and es and it would find one that works?

@dblock
Copy link
Member

dblock commented Jan 8, 2023

Is it possible that someone could make it unnecessary to specify a service name and that the client would try aoss and es and it would find one that works?

I would say no.

Signatures contain the service name. So unless the service renames aoss to es I expect the client will continue to need to use one or the other.

You can recognize a service by a URL or by connecting to it and looking at headers.

  • I've seen code that examines the URL, e.g. ....us-west-2.aoss.amazonaws.com the service is aoss. However that only works when directly referring to the instance - you can very well have an instance behind API gateway, proxy, or, very likely, an internal DNS name like search.mycompany.com.
  • The protocol doesn't require a back-and-forth like Negotiate. I've seen code (e.g. ruby client) that makes a request to the server to figure out what it is. I think it's a bad idea because without authentication this is a 401/403, which creates noise in the number of errors counted on the server, and is an unnecessary roundtrip for the client.

@VachaShah
Copy link
Collaborator

@pingleig Support for OpenSearch Serverless is now available in opensearch-java 2.2.0.

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

No branches or pull requests

4 participants