Mercurial > p > roundup > code
comparison roundup/cgi/wsgi_handler.py @ 7556:273c8c2b5042
fix(api): - issue2551063 - Rest/Xmlrpc interfaces needs failed login protection.
Failed API login rate limiting with expiring lockout added.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 19 Jul 2023 20:37:45 -0400 |
| parents | 07ce4e4110f5 |
| children | 0fe2b9f6e19f |
comparison
equal
deleted
inserted
replaced
| 7555:451232f83244 | 7556:273c8c2b5042 |
|---|---|
| 19 from roundup.cgi.client import BinaryFieldStorage | 19 from roundup.cgi.client import BinaryFieldStorage |
| 20 | 20 |
| 21 BaseHTTPRequestHandler = http_.server.BaseHTTPRequestHandler | 21 BaseHTTPRequestHandler = http_.server.BaseHTTPRequestHandler |
| 22 DEFAULT_ERROR_MESSAGE = http_.server.DEFAULT_ERROR_MESSAGE | 22 DEFAULT_ERROR_MESSAGE = http_.server.DEFAULT_ERROR_MESSAGE |
| 23 | 23 |
| 24 try: | |
| 25 # python2 is missing this definition | |
| 26 http_.server.BaseHTTPRequestHandler.responses[429] | |
| 27 except KeyError: | |
| 28 http_.server.BaseHTTPRequestHandler.responses[429] = ( | |
| 29 'Too Many Requests', | |
| 30 'The user has sent too many requests in ' | |
| 31 'a given amount of time ("rate limiting")' | |
| 32 ) | |
| 24 | 33 |
| 25 class Headers(object): | 34 class Headers(object): |
| 26 """ Idea more or less stolen from the 'apache.py' in same directory. | 35 """ Idea more or less stolen from the 'apache.py' in same directory. |
| 27 Except that wsgi stores http headers in environment. | 36 Except that wsgi stores http headers in environment. |
| 28 """ | 37 """ |
