Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Include rejected queued posts in the user archive export #10859

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

riking
Copy link
Contributor

@riking riking commented Oct 7, 2020

Requested at https://meta.discourse.org/t/where-can-a-user-find-the-post-that-was-rejected-by-the-moderator/165671?u=riking

Field selection was hard to determine here, because there's no guarantee about what's in the json payload. I decided to include the entire thing, as it gets passed to the PostCreator with no field whitelisting.

Additionally, I spotted a stray IP address in the payload field on an older forum.

@riking
Copy link
Contributor Author

riking commented Oct 7, 2020

@eviltrout you wrote most of the new Reviewable code - is there anything that might generically end up in payload that needs to be kept secret & not exported?

@riking riking requested a review from eviltrout October 7, 2020 20:55
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/where-can-a-user-find-the-post-that-was-rejected-by-the-moderator/165671/4

@eviltrout
Copy link
Contributor

@riking it seems a bit dangerous to export everything in the JSON by default. I know some plugins like twohat for example are storing metadata in there about their classification.

I think we should only export certain things. We could start with the raw post and that would likely be sufficient.

Requested at https://meta.discourse.org/t/where-can-a-user-find-the-post-that-was-rejected-by-the-moderator/165671?u=riking

Field whitelisting is applied to the json field using Hash#slice, which was activesupport until Ruby 2.5.
@riking
Copy link
Contributor Author

riking commented Oct 27, 2020

@eviltrout Found Hash#slice for quickly whitelisting fields.

@riking riking merged commit e35fcd3 into master Oct 27, 2020
@riking riking deleted the exporting-queued branch October 27, 2020 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants