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

Add support for protocol type "query" #2

Open
britzl opened this issue Nov 5, 2018 · 4 comments
Open

Add support for protocol type "query" #2

britzl opened this issue Nov 5, 2018 · 4 comments

Comments

@britzl
Copy link
Owner

britzl commented Nov 5, 2018

https://github.com/britzl/aws-sdk-lua/blob/master/aws-sdk/core/request_handlers/query.lua

@SirLynix
Copy link
Contributor

I tried to implement this for SNS and managed to have it working (at least for the request part, handling the response require XML).

I had to remove the content type header (by returning nil in content_type.lua) and add the action to the query (the only way I managed to do that is by changing aws-sdk/sns.lua).

Do you have a better idea on how to fix this (without changing the generator)?

@britzl
Copy link
Owner Author

britzl commented Dec 13, 2018

Hi! I'm happy to work with you on this. I've created a branch where I've started working on this:

https://github.com/britzl/aws-sdk-lua/tree/query_support

Two changes I've made:

Both of the above changes required a small change to the Mustache template.

I haven't tried any of this yet. Some questions:

  • Should "query" requests really by HTTP POST? The API spec seems to indicate this, but what would the post data be? An empty string?
  • When signing the request I assume it is the entire request URI that should be passed to the V4 signer including all of the query args?

@SirLynix
Copy link
Contributor

I found this about query requests: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html

It looks like some requests may be GET request as well, although it doesn't look very common in AWS.

It looks like it doesn't expect any POST data actually, in my tests I just didn't send anything.
As for v4 signers, I guess it isn't much different from json protocol (as I did manage to make requests using a slightly modified version of the json protocol file for queries).

Your changes look pretty good in my opinion. It's really nice from you to still work on this.

@britzl
Copy link
Owner Author

britzl commented Dec 13, 2018

I'll try to find some time to configure and test an AWS service that uses query requests. You're using SNS right?

For XML parsing I think xml2lua will do just fine: https://github.com/manoelcampos/xml2lua

@britzl britzl mentioned this issue Oct 11, 2020
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