-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jlc/palm mig/patch generate passwords #130
Conversation
b700e1b
to
3b56f1b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please rebase, add this feature to the testing list and verify its behavior in alpha
65f43eb
to
c5e16ed
Compare
feat: first version of monkey patching feat: add django-password-validators==1.7.3 This is the latest (now), feb5-2024 feat: add edx-django-utils pck feat: add generate password to init pipeline chore: add natural docstring style: pylint and isort feat: add logging msg of generation password feat: add edx-django-utils style: pass flake8 long line error chore: remove duplicated req
c5e16ed
to
f925718
Compare
from edx_django_utils import user | ||
|
||
from eox_nelp.user_authn.utils import generate_password | ||
user.generate_password = generate_password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @johanseto for the fix today.
I believe we should patch the generate password locally inside the importing modules:
from lms.djangoapps.support.views import manage_user
manage_user.generate_password = generate_password
Otherwise the imports won't be updated in manage_user
due to the patch being too late in the import order.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forking edx_django_utils is also an option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @OmarIthawi the patching locally is managed this PR.
https://github.com/eduNEXT/eox-nelp/pull/208/files
Is doing what you recommend using eox-tenant and seems working. Let us check out the behavior.
Description
This PR is a monkey patch to generate_password.
This was a PR of edx-platform but now this is included in eox-nelp.
As the feature of the PR needs django-password-validators this PR add to eox-nelp the possibility to install it.
Also edx-django-utils is included in requirements, but is a normal package of edx-platform.
I added a logger to know that the password is generated via eox-nelp.
Testing instructions
install this package with this branch
Configure auth password validators in settings with custom rules, you could use this as eg.
Check into
/register
in the password field that you custom rules are loaded.Use a saml integration in your local env and complete a register flow, then check that the process is complete without problem. Check into logs that eox-nelp geneate the password.
After
Screencast.from.05-02-24.15.44.04.webm
Additional information
PRs related
nelc/edx-platform#4
eduNEXT/edunext-platform#676