We've changed the claimed_by_user() to check disabled field.
There are other places we think this check should be done also. But I don't sure about them all, can you review them, please? And then we can make the changes.
User lookup for autocompletion (Allura/allura/controllers/project.py:406, ProjectController.user_search())
Finding users with named roles for given project (Allura/allura/model/project.py:708, Project.users())
Various lookups for notifications. Disabled users don't need to receive any, I guess.
I've merged your current commits. Go ahead and make the other changes as follows:
yes
yes
yes. Make sure to add proper handling if no user is found. Just one example is send_direct() which assumes it'll always find a user.
authenticate_request already checks for disabled. Yes for the rest.
Don't be overly concerned about testing all these spots. Some will be easy & good to test, others (e.g. ldap) probably don't have any existing tests, so I don't think its necessary to spend time now building out tests in that area.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ah, I guess I didn't run the tests properly earlier. I see the failures in allura.tests.functional.test_home:TestProjectHome.test_user_search_for_disabled_user and allura.tests.functional.test_auth:TestAuth.test_disabled_user now.
I've added similar code back, but set the user to *anonymous instead of test-admin if the auth lookup can't find a valid user. I also added matching code to basetest_neighborhood_root.py
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Created #363: [#6053] Check for disabled users in user lookups (2cp)
Related
Tickets:
#6053Closed #363.
je/42cc_6053
We've changed the
claimed_by_user()
to checkdisabled
field.There are other places we think this check should be done also. But I don't sure about them all, can you review them, please? And then we can make the changes.
Allura/allura/controllers/project.py:406
,ProjectController.user_search()
)Allura/allura/model/project.py:708
,Project.users()
)Notification.send_direct
(Allura/allura/model/notification.py:237
)Notification.send_digest
(Allura/allura/model/notification.py:261
)sendmail()
task (Allura/allura/tasks/mail_tasks.py:87
,Allura/allura/tasks/mail_tasks.py:99
)sendsimplemail()
task (Allura/allura/tasks/mail_tasks.py:149
)AuthenticationProvider.authenticate_request
(Allura/allura/lib/plugin.py:86
)LocalAuthenticationProvider.by_username
(Allura/allura/lib/plugin.py:236
)LocalAuthenticationProvider.user_by_project_shortname
(Allura/allura/lib/plugin.py:254
)LdapAuthenticationProvider.by_username
(Allura/allura/lib/plugin.py:318
)LdapAuthenticationProvider._login
(Allura/allura/lib/plugin.py:332
)I've merged your current commits. Go ahead and make the other changes as follows:
Don't be overly concerned about testing all these spots. Some will be easy & good to test, others (e.g. ldap) probably don't have any existing tests, so I don't think its necessary to spend time now building out tests in that area.
Created #376: [#6053] Check for disabled users in user lookups (followup) (2cp)
Related
Tickets:
#6053Closed #376.
je/42cc_6053_followup
This change seems unnecessary and tests pass without it, so I'm going to merge without it, unless there's some reason we need it:
Ah, I guess I didn't run the tests properly earlier. I see the failures in
allura.tests.functional.test_home:TestProjectHome.test_user_search_for_disabled_user
andallura.tests.functional.test_auth:TestAuth.test_disabled_user
now.I've added similar code back, but set the user to
*anonymous
instead oftest-admin
if the auth lookup can't find a valid user. I also added matching code tobasetest_neighborhood_root.py