Skip to content
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

[#1672] Reworked auth backends, contacts to support non-unique (digid) emails #760

Merged

Conversation

Bartvaderkin
Copy link
Contributor

@Bartvaderkin Bartvaderkin commented Sep 8, 2023

Progress on #736

@Bartvaderkin Bartvaderkin force-pushed the feature/1672-email-unique-modified branch from 838571e to 3f90673 Compare September 8, 2023 10:15
@Bartvaderkin Bartvaderkin changed the title [#1672] PR Update WIP for CI [#1672] Reworked auth backends, contacts to support non-unique digid emails Sep 8, 2023
@Bartvaderkin Bartvaderkin changed the title [#1672] Reworked auth backends, contacts to support non-unique digid emails [#1672] Reworked auth backends, contacts to support non-unique (digid) emails Sep 8, 2023
@codecov-commenter
Copy link

Codecov Report

Merging #760 (1253be2) into feature/1672-email-unique (e34b559) will decrease coverage by 0.04%.
The diff coverage is 89.89%.

@@                      Coverage Diff                      @@
##           feature/1672-email-unique     #760      +/-   ##
=============================================================
- Coverage                      96.36%   96.33%   -0.04%     
=============================================================
  Files                            693      694       +1     
  Lines                          24538    24540       +2     
=============================================================
- Hits                           23647    23641       -6     
- Misses                           891      899       +8     
Files Changed Coverage Δ
src/open_inwoner/accounts/managers.py 87.23% <0.00%> (-1.90%) ⬇️
...c/open_inwoner/accounts/tests/test_auth_2fa_sms.py 100.00% <ø> (ø)
.../open_inwoner/accounts/tests/test_contact_views.py 100.00% <ø> (ø)
src/open_inwoner/accounts/tests/test_logging.py 100.00% <ø> (ø)
src/open_inwoner/accounts/tests/test_message.py 100.00% <ø> (ø)
.../open_inwoner/accounts/tests/test_profile_views.py 100.00% <ø> (ø)
src/open_inwoner/haalcentraal/tests/test_signal.py 100.00% <ø> (ø)
src/open_inwoner/plans/tests/test_logging.py 100.00% <ø> (ø)
src/open_inwoner/search/tests/test_logging.py 100.00% <ø> (ø)
src/open_inwoner/accounts/backends.py 86.88% <50.00%> (-7.56%) ⬇️
... and 5 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

📢 Have feedback on the report? Share it here.

@@ -33,6 +33,8 @@ def get_by_rsin(self, rsin):
return self.get_queryset().get(rsin=rsin)

def eherkenning_create(self, rsin, **kwargs):
raise NotImplementedError("old code, please verify before use")
# TODO what is this @rsin.com email hostname? @example.org is bad enough but this actually exists
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't use eHerkenning at the moment, but we will later this year for companies. Not within scope atm

@@ -219,44 +222,86 @@ class Meta:
verbose_name = _("User")
verbose_name_plural = _("Users")

constraints = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to continue with this next week. I like these more flexible unique constraints, having them depending on the login time makes sense in my eyes.


@classmethod
def setUpTestData(cls):
cls.msg_dupes = _("This email is already taken.")
cls.msg_inactive = _("This account has been deactivated")

# TODO use factories and valid Users (eg: bsn AND LoginTypeChoices.digid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be continued next week


@requests_mock.Mocker()
def test_digid_user_non_digid_duplicate_fail(self, m):
# TODO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be continued next week

Copy link
Member

@alextreme alextreme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better than that it was, but I expect we'll need a few patch releases next week during testing.

@alextreme alextreme marked this pull request as ready for review September 8, 2023 16:39
@alextreme alextreme merged commit 5eb514d into feature/1672-email-unique Sep 8, 2023
7 checks passed
@alextreme alextreme deleted the feature/1672-email-unique-modified branch September 8, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants