Initial mfa support (for internal users) #93591
No reviewers
Labels
No Label
legacy project
Infrastructure: blender.org
legacy project
Infrastructure: Websites
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status::Confirmed
Status
Duplicate
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/blender-id#93591
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mfa"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
added support for totp, u2f (yubikey) and recovery codes
TODO out of scope for this PR
@ -0,0 +3,4 @@
A new {{ device_type }} multi-factor authenticator has been added to your Blender ID account {{ user.email }}
If this wasn't done by you, please reset your password immediately and contact blenderid@blender.org for support.
might be out of scope, but setting an
ADMIN_EMAIL
(like in DevFund) orSUPPORT_EMAIL
(not to be confused with builtinsettings.ADMINS
) configuration variable and passing it to the templates that need it is more maintainable than hard-coding it in multiple files.@ -0,0 +79,4 @@
<p>
Store your recovery codes safely (e.g. in a password manager or use a printed copy) and don't share them.
Each code can be used only once.
You can generate a new set of recovery codes at any time, any remaining old codes will become invalidated.
"will be invalided" or "will become invalid"
@ -0,0 +69,4 @@
for device in devices_for_user(self.request.user):
device.delete()
if self.request.user.confirmed_email_at:
bid_main.tasks.send_mfa_disabled_email(self.request.user.pk)
DevFund and other services use
send_mail_*
for the most part: it's easier to parse visually@ -0,0 +82,4 @@
):
# Forbid setting up recovery codes unless the user already has some other method
return HttpResponseBadRequest("can't setup recovery codes before other methods")
user.staticdevice_set.all().delete()
From this line it's not clear that this is recovery codes that are being deleted
@ -0,0 +94,4 @@
class InvalidateRecoveryView(mixins.MfaRequiredIfConfiguredMixin, View):
def post(self, request, *args, **kwargs):
user = self.request.user
user.staticdevice_set.all().delete()
same as above
@ -0,0 +139,4 @@
class U2fRegisterView(mixins.MfaRequiredIfConfiguredMixin, FormView):
form_class = U2fRegisterForm
success_url = reverse_lazy('bid_main:mfa')
template_name = "bid_main/mfa/u2f_register.html"
is
context['first_device'] = not devices_for_user(self.request.user)
necessary here as well?@ -0,0 +132,4 @@
self.clean_agent()
return self.cleaned_data
def save(self):
might not be necessary at all, since this isn't a
ModelForm
?Awesome sauce 🎉
Great to see long awaited MFA finally happening!
WIP: mfato mfamfato Initial mfa support (for internal users)