Skip to content

Commit

Permalink
Merge branch 'master' into production
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronschachter committed Dec 5, 2018
2 parents 02edef9 + f61ecc8 commit ee24ea8
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 223 deletions.
3 changes: 0 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ NEW_RELIC_ENABLED=false
NEW_RELIC_LICENSE_KEY=totallysecret
NEW_RELIC_LOGGING_LEVEL=info

STATHAT_APP_NAME=gambit-local-default
STATHAT_EZ_KEY=puppet.sloth@dosomething.org

##
## Optional settings
##
Expand Down
159 changes: 0 additions & 159 deletions app.json

This file was deleted.

2 changes: 0 additions & 2 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
const logger = require('winston');
const newrelic = require('newrelic');
const stathat = require('./stathat');
const helpers = require('./helpers/index');

// register helpers
Expand Down Expand Up @@ -49,7 +48,6 @@ module.exports.sendResponse = function (res, code, messageText) {
if (code > 200) {
type = 'error';
logger.error(messageText);
stathat.postStat(`${code}: ${messageText}`);
}

const response = {};
Expand Down
2 changes: 0 additions & 2 deletions lib/middleware/authenticate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const logger = require('winston');
const stathat = require('../../lib/stathat');

module.exports = function authenticateRequest(config = {}) {
return (req, res, next) => {
Expand All @@ -10,7 +9,6 @@ module.exports = function authenticateRequest(config = {}) {
}
const apiKey = req.get(config.apiKeyHeaderName) || req.query[config.apiKeyQueryName];
if (apiKey !== config.apiKey) {
stathat.postStat(`error: invalid ${config.apiKeyHeaderName}`);
logger.warn(`router invalid ${config.apiKeyHeaderName}:`, req.url);

return res.sendStatus(403);
Expand Down
39 changes: 0 additions & 39 deletions lib/stathat.js

This file was deleted.

9 changes: 2 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gambit-content",
"version": "6.0.0",
"version": "6.0.1",
"description": "Content API for the DoSomething.org chatbot.",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -62,7 +62,6 @@
"s3-upload-stream": "^1.0.7",
"serve-favicon": "^2.5.0",
"simple-oauth2": "^1.5.2",
"stathat": "0.0.8",
"superagent": "^3.8.3",
"throng": "^4.0.0",
"underscore": "^1.9.0",
Expand Down
2 changes: 0 additions & 2 deletions test/lib/contentful.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const underscore = require('underscore');

// app modules
const stubs = require('../../test/utils/stubs');
const stathat = require('../../lib/stathat');
const utilHelper = require('../../lib/helpers/util');
const contentfulAPI = require('contentful');
const broadcastContentfulFactory = require('../../test/utils/factories/contentful/broadcast');
Expand Down Expand Up @@ -46,7 +45,6 @@ const contentfulAPIStub = {
// Setup!
test.beforeEach(() => {
stubs.stubLogger(sandbox, logger);
sandbox.stub(stathat, 'postStat');
sandbox.stub(contentfulAPI, 'createClient')
.returns(contentfulAPIStub);
});
Expand Down
2 changes: 0 additions & 2 deletions test/lib/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const sinon = require('sinon');

// App Modules
const stubs = require('../../test/utils/stubs');
const stathat = require('../../lib/stathat');

// Module to test
const helpers = require('../../lib/helpers');
Expand All @@ -29,7 +28,6 @@ const sandbox = sinon.sandbox.create();
test.beforeEach((t) => {
stubs.stubLogger(sandbox, logger);
sandbox.stub(newrelic, 'addCustomParameters');
sandbox.stub(stathat, 'postStat');

// setup spies
sandbox.spy(helpers, 'sendErrorResponse');
Expand Down
5 changes: 0 additions & 5 deletions test/lib/middleware/authenticate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const sinon = require('sinon');
const sinonChai = require('sinon-chai');
const httpMocks = require('node-mocks-http');
const logger = require('winston');
const underscore = require('underscore');

const stathat = require('../../../lib/stathat');
const config = require('../../../config/lib/middleware/authenticate');
const stubs = require('../../utils/stubs');

Expand All @@ -26,13 +24,10 @@ const sandbox = sinon.sandbox.create();

// stubs
const endpointStub = '/v1/topics';
const stathatStub = underscore.noop;

// Setup!
test.beforeEach((t) => {
stubs.stubLogger(sandbox, logger);
sandbox.stub(stathat, 'postStat').returns(stathatStub);

// setup res mock
t.context.res = httpMocks.createResponse();
});
Expand Down

0 comments on commit ee24ea8

Please sign in to comment.