read the `key` query parameter and validate its format; reject unexpected characters to avoid redis key probing/injection :return: validated key or None
()
| 49 | |
| 50 | |
| 51 | def get_request_key(): |
| 52 | """ |
| 53 | read the `key` query parameter and validate its format; |
| 54 | reject unexpected characters to avoid redis key probing/injection |
| 55 | :return: validated key or None |
| 56 | """ |
| 57 | key = request.args.get('key') |
| 58 | if key and not VALID_KEY_PATTERN.match(key): |
| 59 | abort(400, description='invalid key parameter') |
| 60 | return key |
| 61 | |
| 62 | |
| 63 | def filter_proxies_by_area(proxies, area): |
no outgoing calls
no test coverage detected