__init__.py 517 B

1234567891011121314151617181920212223
  1. # SPDX-License-Identifier: AGPL-3.0-or-later
  2. """.. _botdetection src:
  3. Implementations used for bot detection.
  4. """
  5. from ._helpers import dump_request
  6. from ._helpers import get_real_ip
  7. from ._helpers import get_network
  8. from ._helpers import too_many_requests
  9. __all__ = ['dump_request', 'get_network', 'get_real_ip', 'too_many_requests']
  10. redis_client = None
  11. cfg = None
  12. def init(_cfg, _redis_client):
  13. global redis_client, cfg # pylint: disable=global-statement
  14. redis_client = _redis_client
  15. cfg = _cfg