Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

8. Sunbird will have phone based throttling. API throttling or OTP API Throttling
 
-- OTP generation will have following setting :

...

Table structure to store OTP:


Keydata typepurpose
idtype+keytext (composite primary key)



typetextpossible values are email or phone. Based on type we can identify key having value as email or phone
keytext (encrypted in DB)source against which OTP is generated (key will have value as either email or phone)
OTPtextgenerated OTP
createdOntimestampat which time it was generated
updatedOntimestampwhen it was last used
retryCountinthow many time user already retried it
isLockedbooleanif retry count exceed limit then isLocked true
lockedOntimestampwhen it was locked.

...

                   1.  Use TTL and cassandra will automatically removed that records from table. (Accepted solution: OTP cleanup will happen based on ttl)

                   2. When ever user try next time , and then based on business logic if he is applicable for new OTP then remove old one

...

Accepted Solution is proposed solution 1