Data structure
Entities (tables)
Authentication factors
This entity defines authentication factors entity information structure:
Column | Type | M/O | Purpose |
---|---|---|---|
id | uuid | M | |
user_id | uuid | M | User FK |
type | varchar | M | |
factor | varchar | O | Factor value |
is_active | boolean | M | |
inserted_at | timestamp | M | |
updateed_at | timestamp | M |
type | factor |
---|---|
SMS | "+380677778899" |
PHONE | "+380677778899" |
"pupkin.vasya@gmail.com" |
Users
This entity enrich a few attributes:
Store counters parameters for 2FA in `users.priv_settings` as structure :
{
"login_error_counter"
:
0
,
"otp_error_counter"
:
0
}
Information about blocked directly in entity `users`.
Column Type Purpose is_blocked boolean block_reason varchar (255), NULL
Сonstraints
- user have one active 2FA factor ( one of any type)
- unique index on user_id+type