-
-
Notifications
You must be signed in to change notification settings - Fork 565
Description
Is your feature request related to a problem? Please describe.
Due to my loadbalancer configuration, I have an application-specific way I need to get my client's IP address.
The existing Ninja implementation assumes the X-Forwarded-For or ip_addr fields are suitable, but they are not in my specific scenario.
This logic is hardcoded inside get_ident, so not easily customisable in my case.
Describe the solution you'd like
I already use the django-axes package for rate limiting logins on my non-Ninja app. This works great for my needs, because it has a setting AXES_CLIENT_IP_CALLABLE, which I can set to a function with signature def get_client_ip(request: HttpRequest) -> str:.
This allows me to add my app-specific IP resolution logic.
It would be great if Ninja's throttle feature had similar optional customisability.