-
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/NIDpipelines #232
Jlc/NIDpipelines #232
Conversation
As username was changed as national_id, now the national_id needs to be loaded using other fields. So now user is looked up using: - safer_associate_user_by_national_id: extrainfo__national_id - safer_associate_user_by_social_auth_record: social_auth__uid__endswith Also there is other pipe that was separated to manage staff and superusers. - disallow_staff_superuser_users
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
could you add tests for the line 145 of eox_nelp/third_party_auth/pipeline.py?
|
||
class SaferAssociaciateUserBySocialAuthRecordTestCase(SaferAssociateUserUsingUid, TestCase): | ||
"""Test case for `safer_associate_user_by_social_auth_record`""" | ||
uid_pipe = staticmethod(safer_associate_user_by_social_auth_record) |
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.
just asking why this instead of uid_pipe = safer_associate_user_by_social_auth_record
?
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.
Because as is defined inside a class. When the function is called(self.uid_pipe()
) the first argument is filled with self
. So the order function fails...
|
||
self.backend.get_idp.return_value.get_user_permanent_id.return_value = test_uid | ||
self.backend.strategy.storage.user.get_user.return_value = past_user | ||
|
||
pipe_output = safer_associate_username_by_uid(self.request, self.backend, self.details, self.response) | ||
pipe_output = safer_associate_user_by_national_id(self.request, self.backend, self.details, self.response) |
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.
pipe_output = safer_associate_user_by_national_id(self.request, self.backend, self.details, self.response) | |
pipe_output = self.uid_pipe(self.request, self.backend, self.details, self.response) |
??? I Think it's the same but this suggestion keeps the style of other tests
@@ -94,7 +136,49 @@ def test_user_associate_username_with_uid(self): | |||
self.backend.get_idp.return_value.get_user_permanent_id.return_value = test_uid | |||
self.backend.strategy.storage.user.get_user.return_value = past_user | |||
|
|||
pipe_output = safer_associate_username_by_uid(self.request, self.backend, self.details, self.response) | |||
pipe_output = safer_associate_user_by_social_auth_record( |
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.
same comment as above
cf82485
to
8b11e10
Compare
8b11e10
to
c69533b
Compare
Description
As username was changed as national_id, now the national_id needs to be
loaded using other fields.
eg
uid=1999444333
So now user is looked up using:
Also there is other pipe that was separated to manage staff and superusers.
Testing instructions
We need to change the pipelines functions in this way.
Before
After
Check if saml association are working =)
Additional information
Jira story
Checklist for Merge