-
Notifications
You must be signed in to change notification settings - Fork 27
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-auth per user (ποΈ ) #5061
π¨ Two-factor-auth per user (ποΈ ) #5061
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #5061 +/- ##
=========================================
+ Coverage 87.0% 88.1% +1.0%
=========================================
Files 1212 563 -649
Lines 50712 28558 -22154
Branches 1083 198 -885
=========================================
- Hits 44149 25173 -18976
+ Misses 6324 3335 -2989
+ Partials 239 50 -189
Flags with carried forward coverage won't be shown. Click here to find out more.
|
7eb2e87
to
df32bae
Compare
ππΌ |
Code Climate has analyzed commit 49206df and detected 0 issues on this pull request. View more on Code Climate. |
Kudos, SonarCloud Quality Gate passed!Β Β 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great explanation and adding 2FA at the user level!
I didn't know there was 2FA at the app level (not sure I understand what that means π), at the product level is clear.
Maybe an issue to link is this one about saving a default 2FA method: ITISFoundation/osparc-issues#1053
It is of course not going to be solved in this PR, but maybe something to think about now. E.g. if that issue had in mind users from Asia, allowing them to disable 2FA would solver
packages/postgres-database/src/simcore_postgres_database/models/users.py
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed
What do these changes do?
Currently the activate of 2FA is defined as a property of the app and/or product (due to requirements) denoted
LOGIN_2FA_REQUIRED
. This PR now adds an analogous property at user level denotedtwo_factor_enabled
which default totrue
.First, we determine whether 2fa is active in the product. For that we resolve resolve
app.LOGIN_2FA_REQUIRED
which can be overriden byproduct.LOGIN_2FA_REQUIRED
i.e.app.LOGIN_2FA_REQUIRED
product.LOGIN_2FA_REQUIRED
*
is any value and-
is undefined.Then, if the 2fa is activated in the product (and only in that case* then the flag in the user determines whether to require 2fa to a user or not is
user.two_factor_enabled
. The latter is by defaultTrue
to preserve the current policy.Why this change?
Related issue/s
How to test
Dev Checklist
DevOps Checklist
users.two_factor_enabled
(migration defaults all to True)