twitter-archive / diffy

Find potential bugs in your services with Diffy
https://twitter.com/diffyproject
Apache License 2.0
3.83k stars 368 forks source link

Substitute headers #46

Open PilchardFriendly opened 8 years ago

PilchardFriendly commented 8 years ago

There are some cases where the upstream client would like to control which headers are sent to the downstream servers.

An example of this is where prior authentication has occurred, and so unique Authorisation headers must be sent separately to primary, secondary and candidate servers.

In the PR, I've designed it so that, for HTTP(S) protocols only, headers will be rewritten (or dropped) if they are prefixed by "primary", "secondary", "candidate_".

For instance, the header "primary_Authorization: Bearer ajdskhasqqjkh19qw1h2" will be sent to only primary, as "Authorization: Bearer ajdskhasqqjkh19qw1h2".

This maintains diffy's stateless communications, but supports testing through Postman, etc.

PilchardFriendly commented 8 years ago

Travis CI seems to have a borked setup - builds pass on 4/6 environments.

PilchardFriendly commented 8 years ago

Looks like something wrong with java 1.7.0_91 - this has been EOLd on 25 Feb 2015. Is it still necessary? If so - we can have a look at what is causing Travis to coredump.

codecov-io commented 8 years ago

Current coverage is 37.51%

Merging #46 into master will increase coverage by 1.01%

@@             master        #46   diff @@
==========================================
  Files            29         31     +2   
  Lines           789        821    +32   
  Methods         772        801    +29   
  Messages          0          0          
  Branches         17         20     +3   
==========================================
+ Hits            288        308    +20   
- Misses          501        513    +12   
  Partials          0          0          

Powered by Codecov. Last updated by 8586972...625182d

CLAassistant commented 5 years ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.