Tor middleware #499

Merged
bones7242 merged 16 commits from tor-middleware into master 2018-06-29 02:59:56 +02:00
2 changed files with 27 additions and 18 deletions
Showing only changes of commit aed4e05b24 - Show all commits

View file

@ -32,8 +32,8 @@ const getTorList = (req, res) => {
.then(() => {
return db.Tor.findAll({
attributes: ['address', 'fingerprint'],
})
.map(el => el.get({ plain: true }));
raw: true,
});
})
.then( result => {
logger.debug('number of records', result.length);

View file

@ -1,23 +1,32 @@
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
const logger = require('winston');
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
function ipIsInTorList (ip) {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return true;
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
}
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
const db = require('../models');
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
const torCheck = ({ ip, headers, body }, res, next) => {
logger.debug(`tor check for:`, {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
ip,
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
headers,
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
body,
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
});
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
// check the tor node list
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
if (ipIsInTorList(ip)) {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return res.status('400').json({
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
success: 'false',
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
message: 'Unfortunately this api route is not currently available for tor users. We are working on a solution that will allow tor users to use this endpoint in the future.',
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
logger.debug(`tor check for: ${ip}`);
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return db.Tor.findAll(
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
{
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
where: {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
address: ip,
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
},
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
raw: true,
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
})
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
.then(result => {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
logger.debug('tor check results:', result);
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
if (result.length >= 1) {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
logger.debug('this is a tor ip');
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
const failureResponse = {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
success: 'false',
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
message: 'Unfortunately this api route is not currently available for tor users. We are working on a solution that will allow tor users to use this endpoint in the future.',
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
};
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return res.status(400).json(failureResponse);
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
} else {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
logger.debug('this is not a tor ip');
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return next();
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
}
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
})
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
.catch(error => {
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
logger.error(error);
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
});
}
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
return next();
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
};
module.exports = torCheck;

neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.
neb-b commented 2018-06-28 23:38:26 +02:00 (Migrated from github.com)
Review

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.

Maybe you should just stop the request here? Not sure, if there are other routes in that may be blocked in the future it will be simpler to add. If it's gonna be only the /publish route then this is probably fine.
bones7242 commented 2018-06-29 02:22:00 +02:00 (Migrated from github.com)
Review

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.

Yeah, I think that would be the better way to handle it. That way the middleware can be placed on any route and response is handled from the middleware, rather than having to handle in all the routes.