Skip to content

Commit

Permalink
Address comments:
Browse files Browse the repository at this point in the history
  - lib/auth/auth.js :
      write some JSdoc for `function generateV4Headers` and
      `function doAuth`
  • Loading branch information
Antonin Coulibaly committed Aug 5, 2016
1 parent 009d9f2 commit eae51c6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ function extractParams(request, log, awsService, data) {
return { err: null, params: publicUserInfo };
}

/**
* This function will check validity of request parameters to authenticate
*
* @param {Http.Request} request - Http request object
* @param {object} log - Logger object
* @param {function} cb - the callback
* @param {string} awsService - Aws service related
* @param {RequestContext} requestContext - an instance of a RequestContext
* @return {undefined}
*/
function doAuth(request, log, cb, awsService, requestContext) {
const res = extractParams(request, log, awsService, request.query);
if (res.err) {
Expand Down Expand Up @@ -121,6 +131,18 @@ function doAuth(request, log, cb, awsService, requestContext) {
return cb(errors.InternalError);
}


/**
* This function will generate a version 4 header
*
* @param {Http.Request} request - Http request object
* @param {object} data - Parameters from queryString parsing or body of
* POST request
* @param {string} accessKey - the accessKey
* @param {string} secretKeyValue - the secretKey
* @param {string} awsService - Aws service related
* @return {undefined}
*/
function generateV4Headers(request, data, accessKey, secretKeyValue,
awsService) {
Object.assign(request, { headers: {} });
Expand Down

0 comments on commit eae51c6

Please sign in to comment.