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

fix(2fa): do not allow to enforce 2FA when having recovery codes only #77798

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

oioki
Copy link
Member

@oioki oioki commented Sep 19, 2024

Currently, when an owner has only recovery codes (backup interface), this still allows them to enforce 2FA for the organization what is wrong.

The requirement of having a proper 2FA method was implemented in #6812 but it was broken during HC changes in #44219.

The has_2fa() method has a different semantic in the regional silo:

def has_2fa(self) -> bool:
return len(self.authenticators) > 0

vs control silo:

def has_2fa(self) -> bool:
return Authenticator.objects.filter(
user_id=self.id, type__in=[a.type for a in available_authenticators(ignore_backup=True)]
).exists()

@oioki oioki requested a review from a team September 19, 2024 18:36
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 19, 2024
@oioki oioki merged commit e9498aa into master Sep 20, 2024
51 checks passed
@oioki oioki deleted the fix/require-personal-2fa-to-enforce-org-2fa branch September 20, 2024 09:06
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants