Skip to content

Conversation

wagnerand-moz
Copy link
Member

@wagnerand-moz wagnerand-moz commented Oct 14, 2025

Fixes: mozilla/addons#15891

Description

This removes the waffle flag 2fa-enforcement-for-developers-and-special-users which has been in production for years and we are not going to turn it off again.

Context

Cleaning up old waffle stuff.

Testing

Many tests are covering 2FA. I'm not sure how to test this locally, where FxA login is explicitly bypassed.

Checklist

  • Add #ISSUENUM at the top of your PR to an existing open issue in the mozilla/addons repository.
  • Successfully verified the change locally.
  • The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
  • Add before and after screenshots (Only for changes that impact the UI).
  • Add or update relevant docs reflecting the changes made.

@wagnerand-moz wagnerand-moz marked this pull request as ready for review October 14, 2025 16:33
self.find_user = self.patch('olympia.accounts.views.find_user')
self.request = mock.MagicMock()
self.user = AnonymousUser()
self.user.is_addon_developer = False
Copy link
Member

Choose a reason for hiding this comment

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

If the code needs a real user we may as well use user_factory to create one rather than AnonymousUser

Copy link
Member Author

Choose a reason for hiding this comment

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

I can do that. I didn't want to make large changes to this test as I don't understand what exactly it is testing and more change tends to lead to more breaking.

Copy link
Member Author

Choose a reason for hiding this comment

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

@eviljeff I think I'd need some more guidance here. I am not sure how I can use user_factory here (without rewriting the entire test class I guess?) when user properties like id and email are set per individual test, e.g. identity = identity or {'uid': '1234', 'email': '[email protected]'}.

Copy link
Member

Choose a reason for hiding this comment

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

you'd change it to something like identity = {'uid': self.user.fxa_id, 'email': self.user.email} when it was supposed to be correct. But I'm having difficulties with switching it out for user_factory() - it seems to be redirecting to login instead (and so breaking all the tests) which is weird. It's probably just bad tests but I'm going to play around with it some more to confirm to myself there's not something actually broken.

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.

[Task]: Remove waffle flag 2fa-enforcement-for-developers-and-special-users

2 participants