django-easy-audit
django-easy-audit copied to clipboard
Request : lookup a list of headers to determine the IP
We are sending an array of headers name to django-axes to determine the IP of the client, we would like to do the same thing for django-easy-audit, instead of forcing only one header that might not exist in a specific environment. Would you be open to a PR for this?
I'm thinking about this specifically https://github.com/jazzband/django-axes/blob/98c404b442e400796960450c94f78d7e0ac5bf12/axes/helpers.py#L146
We do have an open issue regarding adding support for user agent so I do think we're eager to get something for sure.
If we can agree on which data, and how to store it, we can move fairly quick on it I'm sure.
We do still support MySQL <5.7 and thus we cannot guarantee native JSON support in the model itself, unfortunately. We can do casting though, just no indexes. The data type and concern around multiple migrations is mostly why this hasn't yet been done.
Potentially we could have a subclassed RequestEvent which explicitly supports JSON, and then it's up to the application which they choose to use.
Im actually not talking about adding more info to RequestEvent. Im talking about lookup a different header field for the IP and not make django-easy-audit fails if the header does not exists (and move the next preferred header).
Happy to review a PR for this. I'm sure it will help solidify the rationale as well as add to the flexibility for configuration of programmatic logic.