Send web requests with HTTP auth

This commit is contained in:
James Allen 2014-11-17 14:35:07 +00:00
parent 66dfafdebe
commit ce587a00ba
3 changed files with 12 additions and 0 deletions

View file

@ -9,6 +9,10 @@ module.exports = WebApiManager =
request.post {
url: url
qs: {user_id}
auth:
user: settings.apis.web.user
pass: settings.apis.web.pass
sendImmediately: true
json: true
jar: false
}, (error, response, data) ->

View file

@ -13,6 +13,8 @@ module.exports =
apis:
web:
url: "http://localhost:3000"
user: "sharelatex"
pass: "password"
documentupdater:
url: "http://localhost:3003"
trackchanges:

View file

@ -15,6 +15,8 @@ describe 'WebApiManager', ->
apis:
web:
url: "http://web.example.com"
user: "username"
pass: "password"
"logger-sharelatex": @logger = { log: sinon.stub(), error: sinon.stub() }
describe "joinProject", ->
@ -33,6 +35,10 @@ describe 'WebApiManager', ->
url: "#{@settings.apis.web.url}/project/#{@project_id}/join"
qs:
user_id: @user_id
auth:
user: @settings.apis.web.user
pass: @settings.apis.web.pass
sendImmediately: true
json: true
jar: false
})