Unify auth handling in the Host class

- flatten auth config to an Authorization header when the Host is created
 - remove individual Authorization handling from connectors
 - removed incomplete support for per-request auth
 - use per-request headers to provide your own Authorization header per request
This commit is contained in:
Spencer Alger
2015-04-08 15:05:51 -07:00
parent 8b59530eed
commit 7f468d2064
10 changed files with 40 additions and 103 deletions

View File

@ -72,10 +72,10 @@ describe('Http Connector', function () {
var con = new HttpConnection(host, {});
var reqParams = con.makeReqParams();
expect(reqParams).to.not.have.property('auth');
expect(reqParams).to.eql({
method: 'GET',
protocol: 'http:',
auth: 'john:dude',
hostname: 'pizza.com',
port: 9200,
path: '/pizza/cheese?shrooms=true',
@ -142,7 +142,6 @@ describe('Http Connector', function () {
expect(reqParams).to.eql({
method: 'PUT',
protocol: 'http:',
auth: null,
hostname: 'google.com',
port: 80,
path: '/stuff',