Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Anonymous Ticket Portal Anonymous Ticket Portal
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • TPA
  • Anonymous Ticket PortalAnonymous Ticket Portal
  • Merge requests
  • !81

Rate-Limit Update

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged MariaV requested to merge rate_limiting into master Feb 11, 2021
  • Overview 0
  • Commits 26
  • Changes 8

Designed to overall security with rate-limiting via Django rate-limit.

  • Added Django-Ratelimit package to requirements.txt.
  • Enabled caching in settings.py
  • Updated sample_env.txt with new required keys.
  • Updated README.md with rate-limit settings needed to run.
  • Updated settings.py to call new rate-limit variables from .env
  • Added two decorators to views.py that take the .env settings via a new callable function to determine rate-limit (one for ip and one for form post method), which also include a custom field, "block_all"--when set to True in .env, will disable those views using decorators.
  • Added custom URL handler to catch Ratelimited 403 exception and render a custom template with response.status_code 403.
  • Added rate_limit template.html
  • Added tests in anonticket/tests.py for rate-limiting, including cache-clearing between tests during tearDown.

All tests passing with 94 percent coverage via python coverage.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: rate_limiting