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

Two-factor refactoring. #241

Merged
merged 2 commits into from
Dec 20, 2019
Merged

Two-factor refactoring. #241

merged 2 commits into from
Dec 20, 2019

Conversation

jwag956
Copy link
Collaborator

@jwag956 jwag956 commented Dec 19, 2019

Pull out totp code into separate class and make that class settable as part
of initial app config.
Add stubs for getting and setting the last_counter so folks can easily add
replay-attack protection.

Also - this will be part of the new passwordless implementation - so wanted
these pieces reusable.

Add calc_username() to UserMixin which calculates an appropriate username based on
the IDENTITY_ATTRIBUTES. This is useful in forms, urls etc (and came from
the recent PR to fix the two-factor qrcode URI).
Modify the twofactor email templates to use this rather than assuming that
all user models have 'username'.

Very minor improvements to localization of some fields in 2FA forms - the submit
buttons label should come from the form definition - not be hard-coded (english).

@Kishi85 If you have a few minutes to look this over - that'd be great.

Pull out totp code into separate class and make that class settable as part
of initial app config.
Add stubs for getting and setting the last_counter so folks can easily add
replay-attack protection.

Also - this will be part of the new passwordless implementation - so wanted
these pieces reusable.

Add calc_username() to UserMixin which calculates an appropriate username based on
the IDENTITY_ATTRIBUTES. This is useful in forms, urls etc (and came from
the recent PR to fix the two-factor qrcode URI).
Modify the twofactor email templates to use this rather than assuming that
all user models have 'username'.

Very minor improvements to localization of some fields in 2FA forms - the submit
buttons label should come from the form definition - not be hard-coded (english).
@Kishi85
Copy link
Contributor

Kishi85 commented Dec 20, 2019

Looking good from what I see

@jwag956 jwag956 merged commit 9b2d86a into master Dec 20, 2019
@jwag956 jwag956 deleted the rf3 branch December 20, 2019 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants