bravado icon indicating copy to clipboard operation
bravado copied to clipboard

Should not rewrite custom auth headers from _request_options

Open aviskase opened this issue 6 years ago • 0 comments

Hi, I'm using bravado for end-to-end checks. One use case is :

  1. Use default_apikey for every request
  2. Create new_apikey using API
  3. Check that requests with new_apikey applied work.

Currently to make this work one should wrap SwaggerClient/RequestsClient or create separate SwaggerClients for each api key. Reason is that ApiKeyAuthenticator.apply overwrites any custom auth headers from _request_options.

It would be better if ApiKeyAuthenticator.apply could skip setting request.headers[self.param_name] if this header already exists.

I suppose similar thing is applicable to other Authenticator variations.

aviskase avatar Jun 14 '18 04:06 aviskase