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

Delete expired SMS codes from database #160

Open
scy opened this issue Oct 2, 2023 · 3 comments
Open

Delete expired SMS codes from database #160

scy opened this issue Oct 2, 2023 · 3 comments
Labels
area:backend Related to the server component prio:C Nice to have, but optional type:enhancement New feature or request

Comments

@scy
Copy link
Collaborator

scy commented Oct 2, 2023

This is a follow-up to #122. The number_verification_requests table does not automatically remove entries with expired_at in the past. This could probably be done by a background task every hour or so.

However, we also wanted to have the feature “if someone repeatedly requests SMS but doesn’t enter the codes then, block this person”. This should probably also take already-expired requests into account.

Make sure to also have a look at the implementation in get_new_sms_auth_code to ensure it matches the design.

@scy scy added type:enhancement New feature or request area:backend Related to the server component labels Oct 2, 2023
@scy
Copy link
Collaborator Author

scy commented Oct 2, 2023

Since 25a121e or bb34f9f, the blocking of logins handles expired and non-expired attempts pretty well. Deleting the expired codes is therefore now really just an optional housekeeping task.

@scy scy added the prio:C Nice to have, but optional label Oct 11, 2023
@jbethune
Copy link
Collaborator

I'm thinking about adding an API endpoint to dearmep/api/v1.py. Maybe something like /maintenance/clean/{what} where what can be sms-codes. This removes all expired sms codes from the database. That endpoint can then be curled from a cronjob or any other timer. WDYT?

@scy
Copy link
Collaborator Author

scy commented Dec 15, 2024

Nah, we already have background jobs (see get_background_tasks in schedules/__init__.py), we don't need an endpoint for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:backend Related to the server component prio:C Nice to have, but optional type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants