RFC #33561 -- Synchronize user attributes on every authentication with RemoteUserBackend

2022-03-04 Thread Adrian Torres Justo
Hello all,

I'd like to get your feedback and comments regarding the ticket mentioned 
in the subject line: adding a mechanism/hook to the RemoteUserBackend that 
allows for synchronization of user attributes between the remote system and 
the django server on each authentication attempt.

Synchronizing data between the remote system and the django server is 
useful for obvious reasons, however the ticket was marked as WONTFIX 
arguing that the same can be achieved by overriding authenticate().

While the behavior is similar, it is not the same: My implementation (see 
linked patch in Trac) synchronizes data right before the return line of the 
authenticate() method, which checks whether the user can authenticate by 
calling user_can_authenticate() whose result can be influenced by the 
synchronization, which is why I did it right before it.

You could argue that then one can simply override user_can_authenticate() 
and call the synchronization method from there, and you would be right, 
however this is not obvious to RemoteUserBackend implementors and feels 
more like a hack than anything else, not to mention you wouldn't know this 
without reading the source code, which is what I had to do in order to 
implement this functionality in another project (and what led me to submit 
the patch in the first place).

Ultimately, the argument could be used for the clean_username hook too, why 
have such a hook if one can simply override authenticate() and perform the 
cleaning right before calling authenticate()?

Another idea would be to use configure_user() for both initial 
configuration and synchronization by passing an extra parameter "created" 
to it, and calling it just before the authenticate method's return line, 
but I figured this change would be more disruptive for existing 
implementations. 

Thank you in advance for your inputs,
Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/e0e832cd-9b73-4824-a537-5f34a78a9b85n%40googlegroups.com.


Re: Google Group's django-updates issue

2022-03-04 Thread Florian Apolloner
Oh. AWS just hates us :) Thanks, we are looking into it.

On Friday, March 4, 2022 at 5:55:00 PM UTC+1 charettes wrote:

> Hi everyone,
>
> I'm not sure if we're already aware of the issue but it seems that Trac 
> hasn't published any changes to the Django Updates Google Group[0] since 
> March 27th while there was clear activity that took place since then[1].
>
> It seems the updates were published over SMTP[2] and I assume something 
> broke around the time the latest changes were pushed to the repository on 
> the 27th[3].
>
> Cheers,
> Simon
>
> [0] https://groups.google.com/g/django-updates
> [1] https://code.djangoproject.com/timeline
> [2] 
> https://github.com/django/code.djangoproject.com/blob/19a7a14206dea8485ef8e2befed2b8e406208b53/trac-env/conf/trac.ini#L111
> [3] 
> https://github.com/django/code.djangoproject.com/commit/19a7a14206dea8485ef8e2befed2b8e406208b53
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/165b49b1-e2cd-4f70-a14f-bfddb11368den%40googlegroups.com.


Google Group's django-updates issue

2022-03-04 Thread charettes
Hi everyone,

I'm not sure if we're already aware of the issue but it seems that Trac 
hasn't published any changes to the Django Updates Google Group[0] since 
March 27th while there was clear activity that took place since then[1].

It seems the updates were published over SMTP[2] and I assume something 
broke around the time the latest changes were pushed to the repository on 
the 27th[3].

Cheers,
Simon

[0] https://groups.google.com/g/django-updates
[1] https://code.djangoproject.com/timeline
[2] 
https://github.com/django/code.djangoproject.com/blob/19a7a14206dea8485ef8e2befed2b8e406208b53/trac-env/conf/trac.ini#L111
[3] 
https://github.com/django/code.djangoproject.com/commit/19a7a14206dea8485ef8e2befed2b8e406208b53

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/9b1f1e37-57d0-4b4b-9f94-8f2293e85108n%40googlegroups.com.