Reject Makes if They Contain Blacklisted Words

RESOLVED WONTFIX

Status

Webmaker
MakeAPI
RESOLVED WONTFIX
4 years ago
4 years ago

People

(Reporter: cade, Assigned: Jose Romasanta)

Tracking

Details

(Reporter)

Description

4 years ago
To lighten the load on our content editors, we can add middleware to the save/update routes that checks the content of the make.

Before this can land, guidelines explaining why content is automatically blocked and why things are taken down must be written.
(Reporter)

Updated

4 years ago
Assignee: cade → jr_r123
(Assignee)

Comment 1

4 years ago
I created the algorithm to check and collect blacklisted words from a string. The problems I have is where can I implement this so that the algorithm can check entered content. I've been skimming to the JS files of MakeAPI but I'm still trying to understand how the content are saved.

Can anyone help me? where can I find the variable to grab entered content so that I can place the check.
(Reporter)

Comment 2

4 years ago
you'll want to write this as a middleware function ( https://github.com/mozilla/MakeAPI/blob/master/lib/middleware.js ) and then have it sit in the POST and PUT routes ( https://github.com/mozilla/MakeAPI/blob/master/server.js#L92-L93 ). For both, put the middleware after prefixAuth.
(Assignee)

Comment 3

4 years ago
Can someone please explain to me which variable I can focus on to check the content of the make in https://github.com/mozilla/MakeAPI/blob/master/lib/middleware.js
(Reporter)

Comment 4

4 years ago
(In reply to Jose Romasanta from comment #3)
> Can someone please explain to me which variable I can focus on to check the
> content of the make in
> https://github.com/mozilla/MakeAPI/blob/master/lib/middleware.js

The data that is being applied to a make will exist on req.body
unfortunately there are several issues here that make this a bit of a bottomless bit, as we don't have any guidelines right now, don't have an exhaustive list of "bad words", and we would also have to start doing this for every language we offer webmaker in, to be consistent, so given the scope of this problem we're going to close this issue for now and readdress when it becomes necessary rather than a feature concept.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Resolution: FIXED → WONTFIX
I realized it's wontfix', but i had to share what Spiderman's approach is:

  http://i.imgur.com/UpW6vUi.gif
You need to log in before you can comment on or make changes to this bug.