Open robrap opened 2 years ago
Note: I was wondering if the relaxing of business requirements might make this problem more tractable at this time, but not sure. I'm sure there are lots of additional things to look at, like:
Thanks for the detailed writeup. It is confusing that email activation is sometimes required and sometimes not, and that it may depend on undocumented settings.
I support the change in behavior.
If email activation is a community-desired feature, I'd rather it be re-implemented either via a hooks plugin, or in edx-platform using a more explicit field, something like UserProfile.is_email_activated
.
Regarding:
(This needs to be confirmed.) The original business rule was relaxed, and now login is allowed on certain deployments, even without email activation. However, API endpoints using SessionAuthentication continue to block access.
Unconfirmed, but I assume SKIP_EMAIL_VALIDATION is how certain deployments relax this business rule?
Thanks for the thoughts @kdmccormick.
Unconfirmed, but I assume SKIP_EMAIL_VALIDATION is how certain deployments relax this business rule?
At edX.org this is using the default, which is False, so not sure. I'm also not certain about the relaxed business rules, other than knowing about the Mobile vs Web split. I plan to add some text to make this potentially easier to digest by Product, and to ensure that the Product WG gets to see this to help weigh-in on the business rules.
As you noted, no matter what the rules, there should be another way to implement.
I am a big fan of this change. One point which I don't think was fully captured here: the way that the platform currently uses is_active
in a non-standard way causes issues when integrating third party django apps that expect it to work the way it does in every other django service. DRF is mentioned as one example, but python-social-auth is another and I believe there have been more. So extra work is required to modify those apps to work with edx-platform instead of just being able to use them.
@feanil: FYI: I added a roadmap issue to get Product input on requirements: https://github.com/openedx/platform-roadmap/issues/266. Feel free to update the roadmap issue as you see fit.
[inform] I just found the decorator view_auth_classes which is used in many place in edx-platform, and buries behind it use of SessionAuthenticationAllowInactiveUser
.
Proposal Date
2022-12-08
Target Ticket Acceptance Date
2022-12-23
Earliest Open edX Named Release Without This Functionality
Palm - 2023-04 (Q+ more likely)
Rationale
In LMS/Studio, we currently have a non-standard use of Django's
user.is_active
which often adds confusion, and cause incompatibilities with third party libraries that expect a the more typical use ofuser.is_active
. Our non-standard muddiesis_active
by also possibly meaning whether or not the user's email has been activated. See the following history for more details.Historical context:
Removal
Replacement
activation_timestamp
?SessionAuthenticationAllowInactiveUser
would be replaced bySessionAuthentication
. (Same with BearerAuthentication classes, but BearerAuthentication should have its own DEPR ticket.)Deprecation
The main function affected,
is_active
, will not actually be deprecated, but will be changing behavior.Some classes like SessionAuthenticationAllowInactiveUser would be deprecated, and could be marked as such.
Migration
Needs planning:
activation_timestamp
as-is, or do we need to back-fill?has_unusable_password
and other disabling capabilities. In theory, everyone could temporarily be set to is_active = True once we have replacement explicit checks for email/account activation that is separate.Additional Info
Once
is_active
is no longer tied to email/account activation, this would open up the following possibilities:is_active
to the original Django meaning of this field, where it can be set to false to disable (soft delete) user accounts. This might require changes wherehas_usable_password
was being used for disabled accounts.is_active
check to JwtAuthentication, which would now be limited to checking if an account were disabled.Other Thoughts: