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

Add endpoint to allow for blocking without authentication by using a pow #10

Merged
merged 12 commits into from
Dec 21, 2021

Conversation

ChrisSchinnerl
Copy link

PULL REQUEST

Overview

This MR adds a new /block endpoint similar to the existing one. The only difference is, that it requires some proof-of-work as spam protection.

Checklist

Review and complete the checklist to ensure that the PR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Verify if any changes impact the WebPortal Health Checks
  • Approriate documentation updated
  • Changelog file created

Issues Closed

@ChrisSchinnerl ChrisSchinnerl marked this pull request as ready for review December 20, 2021 08:57
@ChrisSchinnerl
Copy link
Author

F/U we should probably verify the tags in the endpoint. To prevent people from providing tags which we might have reserved internally.

err := api.staticDB.Ping(r.Context())

// Apply a timeout.
ctx, cancel := context.WithTimeout(r.Context(), 5*time.Second)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit could've been a constant

@peterjan
Copy link

I didn't thoroughly review the updated structure but it seemed like an improvement for sure.
Definitely the added testing and the fact that this works on dev1 were enough of a reason to GL the PR imo.

@peterjan
Copy link

Merging and deploying this must go together with redeploying the abuse skapp frontend.

@ChrisSchinnerl ChrisSchinnerl merged commit b273c31 into main Dec 21, 2021
@ro-tex ro-tex deleted the chris/pow-block branch December 21, 2021 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants