-
Notifications
You must be signed in to change notification settings - Fork 124
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
Updated Code samples to AWS SDK 2.x #63
Conversation
Can we merge this PR? |
Came here to update the same docs! First, https://github.com/awsdocs/aws-request-signing-apache-interceptor is not maintained, I am working on getting it archived. Evidenced by awsdocs/aws-request-signing-apache-interceptor#1 and awsdocs/aws-request-signing-apache-interceptor#2. It was an attempt at resurrecting the one in awslabs, but didn't get proper ownership. I think we should stop copy-pasting There's now a maintained community fork that is AWS SDK 2.0 and has been released to maven: https://github.com/acm19/aws-request-signing-apache-interceptor. I have a demo using that in https://github.com/dblock/opensearch-java-client-demo. So I propose:
We should also (maybe later):
I've also raised to the AWS SDK team the possibility of bringing the fork back under an AWS org, but we don't have to wait for it. @arunx2 WDYT? I will push this one through into the docs in either state. |
Hi @arunx2, I'm so sorry that I missed this. For some reason I wasn't receiving notifications of this change, so I didn't see it until someone pointed it out to me today. I will test this out tomorrow to make sure it works, and then merge. |
@arunx2 do you have any comment on Daniel's comment above? |
@dblock I'll exclude the code and update the zip file. @lizsnyder You can review after the changes with the code. |
I think we should reference acm19.* because 1) that's an open-source package just like org.apache.http.* or org.opensearch.action.index.* which aren't managed by AWS either, 2) customers reading the documentation will not be copy-pasting eventually outdated, potentially buggy, or worse, insecure code. Can we expand the zip in GitHub, so developer can see code changes, and replace the link to the zip to a link to GitHub? A zip is very developer unfriendly, we can't see history, etc. @lizsnyder Do you have any objections? |
Sure, all of that sounds great to me |
@dblock I totally agree with samples in a GitHub repository than the zip file. Do we have GitHub for this sample? @lizsnyder I've a hesitation to refer this acm19* in official documentation and in my opinion, org.apache.* and org.opensearch.* is backed by a large community and vetted process to get some changes into them. I'm not very familiar with this acm19.* package and not sure if this should be referred in AWS documentation. What's your take? |
Can we just use this repo? sample_code/java/amazon-opensearch-docs-sample-client/...? Just not as a zip.
Note that maven artifacts can't be removed from maven central. And FWIW, I am a co-maintainer on the acm19 project along with @acm19 who doesn't work for Amazon (I do). If it were to disappear I'd fork it back into opensearch-project at a minimum. The alternative is to copy-paste (aka fork) code. I definitely don't support that, we want users to get bug fixes. |
Unfortunately I have to agree with @arunx2. It's not an official AWS library, so recommending it would be tough. Looking at this a little more, I think it's best to wait for the AWS SDK team to bring the fork back under an AWS org. Thoughts? Can we expedite that somehow? |
I don't think we should expect to anything to happen with the AWS SDK team, nor should we wait for it to correct the product documentation that is currently obsolete or has bugs. @arunx2 want to update this PR with whichever state you think is right based on this discussion and we'll try to see what @lizsnyder is comfortable with merging? |
doc_source/request-signing.md
Outdated
return RestClient.builder(HttpHost.create(host)).setHttpClientConfigCallback(hacb -> hacb.addInterceptorLast(interceptor)).build(); | ||
} | ||
} | ||
``` | ||
|
||
If you prefer the high\-level REST client, which offers most of the same features and simpler code, try the following sample, which also uses the [Amazon Web Services Request Signing Interceptor](https://github.com/awslabs/aws-request-signing-apache-interceptor): | ||
If you prefer the high\-level REST client, which offers most of the same features and simpler code, try the following sample, which also uses the [Amazon Web Services Request Signing Interceptor](https://github.com/awsdocs/aws-request-signing-apache-interceptor): |
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.
At the very least this link needs to be removed. The code in that repo is old and should not be used.
Sounds good to me, thanks. |
Apologies for the delay. I inherited the bug fix to the sample code and referred source code instead of zip file. |
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 looks good enough to me!
I do think we should put SPDX-like copyright headers https://github.com/acm19/aws-request-signing-apache-interceptor/blob/master/src/main/java/io/github/acm19/aws/interceptor/http/AwsRequestSigningApacheInterceptor.java#L1 on all Java files here, but NBD.
You guys are awesome! Let me take a day to review/test everything and will hopefully be able to merge tomorrow. |
Merged. Changes should show up in the public docs in about an hour or two. |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.