okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.
MIT License
772 stars 94 forks source link

Override default Python requests user agent to something specific to awscurl #213

Open noah-guillory opened 1 month ago

noah-guillory commented 1 month ago

Hi! What do you think about setting the user agent that's sent along with requests to something that indicates that requests are coming from awscurl? I ask because I've had it come up where it would have been useful during debugging something on my end that someone used your tool to call our API.

This is something that seems like a straightforward change since requests has an option that lets you set the user agent. I'm thinking something similar to the user agent of Curl where it's just awscurl/${version_number}.

Your thoughts? I'm happy to contribute a PR for this as well.

okigan commented 1 month ago

Hey Noah,Thanks for the idea!Could you do that now by passing user agent header[1] in the command line?[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-AgentOn Oct 18, 2024, at 8:38 AM, Noah Guillory @.***> wrote: Hi! What do you think about setting the user agent that's sent along with requests to something that indicates that requests are coming from awscurl? I ask because I've had it come up where it would have been useful during debugging something on my end that someone used your tool to call our API. This is something that seems like a straightforward change since requests has an option that lets you set the user agent. I'm thinking something similar to the user agent of Curl where it's just awscurl/${version_number}. Your thoughts? I'm happy to contribute a PR for this as well.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

noah-guillory commented 1 month ago

That is fair, could get around this by passing through the header with the -H flag. I guess it's more of a question to you if a default user agent header that contains awscurl is desirable or not?

okigan commented 1 month ago

Right, I guess I am not sure of the use case, but happy to be convinced!On Oct 18, 2024, at 8:47 AM, Igor Okulist @.> wrote:Hey Noah,Thanks for the idea!Could you do that now by passing user agent header[1] in the command line?[1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-AgentOn Oct 18, 2024, at 8:38 AM, Noah Guillory @.> wrote: Hi! What do you think about setting the user agent that's sent along with requests to something that indicates that requests are coming from awscurl? I ask because I've had it come up where it would have been useful during debugging something on my end that someone used your tool to call our API. This is something that seems like a straightforward change since requests has an option that lets you set the user agent. I'm thinking something similar to the user agent of Curl where it's just awscurl/${version_number}. Your thoughts? I'm happy to contribute a PR for this as well.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>