#36002: Errors in RemoteUserMiddleware/PersistentRemoteUserMiddleware docstrings
and code comments
-------------------------------------+-------------------------------------
Reporter: Anders Einar Hilden | Owner: Anders
Type: | Einar Hilden
Cleanup/optimization | Status: closed
Component: contrib.auth | Version: dev
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
RemoteUserMiddleware, | Unreviewed
PersistentRemoteUserMiddleware |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce):
There is a configurable `header` attribute and in the docs there is an
[https://docs.djangoproject.com/en/5.1/howto/auth-remote-
user/#configuration example configuring it]
{{{
from django.contrib.auth.middleware import RemoteUserMiddleware
class CustomHeaderMiddleware(RemoteUserMiddleware):
header = "HTTP_AUTHUSER"
}}}
By default, the value is `"REMOTE_USER"`. This header can only be set via
an environment variable.
I think the comment above the `header` also hints at this
{{{
# Name of request header to grab username from. This will be the key
as
# used in the request.META dictionary, i.e. the normalization of
headers to
# all uppercase and the addition of "HTTP_" prefix apply.
header = "REMOTE_USER"
}}}
As there are different ways to set headers, I don't think it's wrong to
refer to this as a header 🤔
----
We might be able to make the docstring clearer, but I'm not convinced that
it's clearly wrong
--
Ticket URL: <https://code.djangoproject.com/ticket/36002#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070193bad331c8-db1c15bb-a137-4299-9dd7-7c2fa622f18d-000000%40eu-central-1.amazonses.com.