如何将AWSRequestSigningApacheInterceptor与AWS开发工具包2结合使用 [英] How to use AWSRequestSigningApacheInterceptor with AWS SDK2

查看:260
本文介绍了如何将AWSRequestSigningApacheInterceptor与AWS开发工具包2结合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在已经使用Apache HTTP客户端的现有Java代码上使用对Neptune SPARQL的REST调用。我不想混合使用AWS SDK1和SDK2(我将owl的S3部分加载到Neptune中使用)。

I am trying to use REST calls to Neptune SPARQL on existing Java code which already uses Apache HTTP clients. I'd like to not mix and match AWS SDK1 and SDK2 (which I use for the S3 portion of loading owl to Neptune).

我看到了以下解决方案:

I see these solutions:


  • 与SDK1兼容的AWSRequestSigningApacheInterceptor ,但在SDK2中找不到等效项。

  • AWSRequestSigningApacheInterceptor that works with SDK1, but can't find the equivalent in SDK2.

github上的aws-request-signing-apache-interceptor 用于构建适配器类,因此可以在具有混合和匹配SDK 1&的SDK 2中使用。 2

aws-request-signing-apache-interceptor on github for building an adaptor class so it can be used in SDK 2 with mix-and-match SDK 1 & 2

javaquery / Examples Vicky Thakor变得更加通用,并为任何Java REST实现实施了V4签名

javaquery/Examples where Vicky Thakor has gone even more generic and just implemented the V4 signing for any Java REST implementation

是我期望的:适用于AWS开发工具包2的Apache Interceptor的AWS或Apache实现。

But none of these is what I expected: an AWS or Apache implmentation of an Apache Interceptor for AWS SDK 2.

是否存在这种情况?还是以上解决方案之一是目前最合适的解决方案?

Is there such a thing? or is one of the above solutions the best available at the moment?

推荐答案

所以,我选择了第二种方法注意:它不处理AWS_SESSION_TOKEN。这是一个简单的修复。我已经将其与原始答案一起发布在 http:// github上。 com / awslabs / aws-request-signing-apache-interceptor /

So, I settled on the second option with an important caveat: it does not handle AWS_SESSION_TOKEN. This is a simple fix. I've posted it along with the original answer at http://github.com/awslabs/aws-request-signing-apache-interceptor/

这篇关于如何将AWSRequestSigningApacheInterceptor与AWS开发工具包2结合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆