Open marcbowes opened 3 years ago
I needed this ability in some S3 client code I'm working on. I was able to hack something together that does the job, replacing the entire user agent with a custom string. It's not pretty and it involved copy-pasting some code from inside the AWS Rust SDK. Hopefully this helps the next person who needs this ability:
BTW, thanks to @guyilin-amazon and awslabs/amazon-qldb-shell#196 for providing the initial clue as to how to reach into the tangled nest of abstractions in AWS smithy-rs and find the right place to modify the HTTP headers for each request.
@anelson - I want to understand your requirements better. Did you see that there is an AppName
config that you can use to append to the SDK's user agent? And is that flexible enough for your use-case?
Hi @jdisanti
I saw app_name
but it does not solve the problem. In my case I'm working with the Amazon APN as a partner, and they require that our product use a specific user agent string when storing objects in S3 so that those objects can be associated with our partner account. I have more details than that but I think I received them under NDA with Amazon so I can't share them here. If you like I can put you in touch with our APN partner rep to get more details about this requirement.
In short, setting an app name just adds the app name string towards the end of the SDK-generated user agent. In this case I need to control the start of the user agent string. So if app_name
were set as the prefix of the user agent, with all SDK-generated user agent components appended to the app name, this would have solved my problem. As it is it's not flexible enough.
Community Note
Tell us about your request I'd like to customize the user-agent for my application.
Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? I'm migrating from rusoto where I can add stuff to the user-agent:
Are you currently working around this issue? I'm not!
Additional context N/A
Attachments N/A