test/helpers/apiMock.js
/**
 * Verifies if access is valid by matching to the globally defined apiKey.
 *
 * @param {Object} opts - Request options
 * @return {Object} - Response
 */
Verifies if access is valid by matching to the globally defined apiKey.
@param {Object} opts - Request options
@return {Object} - Response
Verifies if access is valid by matching to the globally defined apiKey . @param { Object } opts - Request options @return { Object } - Response
function validAccess (opts) {
  if (opts.headers.authorization === apiKey || opts.headers.authorization === operatorApiKey) {
    return responses.access.operator
  } else if (opts.headers.authorization === appApiKey) {
    return responses.access.application
  } else {
    return responses.error.generic
  }
}
function validAccess ( opts ) { if ( opts . headers . authorization === apiKey || opts . headers . authorization === operatorApiKey ) { return responses . access . operator } else if ( opts . headers . authorization === appApiKey ) { return responses . access . application } else { return responses . error . generic } }
Verifies if access is valid by matching to the globally defined apiKey.
Verifies if access is valid by matching to the globally defined apiKey .