lib/util

Methods

(inner) basicAuth(req, res, callback)

Source:

sets and parses basic auth headers if they exist

Parameters:
Name Type Description
req http.IncomingMessage

http request object

res http.ServerResponse

http response

callback function

function(username, password, error)

(inner) createAction(opts, req, res) → {Service}

Source:

responds with the correct service depending on the action

Parameters:
Name Type Description
opts Object

options to pass Service

req http.IncomingMessage

http request object

res http.ServerResponse

http response

Returns:
Type
Service

(inner) infoResponse(git, repo, service, req, res)

Source:

sends http response using the appropriate output from service call

Parameters:
Name Type Description
git Git

an instance of git object

repo String

the repository

service String

the method that is responding infoResponse (push, pull, clone)

req http.IncomingMessage

http request object

res http.ServerResponse

http response

(inner) noCache(res)

Source:

adds headers to the response object to add cache control

Parameters:
Name Type Description
res http.ServerResponse

http response

(inner) onExit(ps, callback)

Source:

returns when process has fully exited

Parameters:
Name Type Description
ps EventEmitter

event emitter to listen to

callback function

function(code, signature)

(inner) parseGitName(repo) → {String}

Source:

parses a git string and returns the repo name

Parameters:
Name Type Description
repo String

the raw repo name containing .git

Returns:

returns the name of the repo

Type
String

(inner) serviceRespond(dup, service, repoLocation, res)

Source:

execute given git operation and respond

Parameters:
Name Type Description
dup HttpDuplex

duplex object to catch errors

service String

the method that is responding infoResponse (push, pull, clone)

repoLocation String

the repo path on disk

res http.ServerResponse

http response