cognitect-labs / aws-api

AWS, data driven
Apache License 2.0
730 stars 100 forks source link

Pass extra args to underlying http-client #199

Open kkrausse opened 2 years ago

kkrausse commented 2 years ago

Dependencies

{:deps {com.cognitect.aws/api       {:mvn/version "0.8.292"}
        com.cognitect.aws/endpoints {:mvn/version "1.1.11.532"}
        com.cognitect.aws/s3        {:mvn/version "714.2.430.0"}}}

Enhancement Description

I'm using the api with a custom HttpClient, and I'd like the ability to pass http-client-specific arguments to this client on a per-request bases. I see this being an extra field in the op-map that gets propagated to the request so it can be used by the underlying HttpClient. Right now I'm only able to achieve this by monkey-patching the cognitect.aws.interceptors/modify-http-request methods.

fogus commented 2 years ago

Hello! Thank you for the ticket. We're planning the possibilities around a bring-your-own client mode but have not landed on a solution yet. The underlying mechanisms certainly allow for injections your own (as you proved) but they should not be relied on to stay the same into the future. To that point I would hesitate to make changes to allow options pass through for now until a formal approach to bring-your-own is designed and implemented.