Store password reset requests in database #610
Değerlendirici yok
Etiketler
Etiket Yok
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
Kilometre Taşı Yok
Proje yok
Atanan Kişi Yok
1 participant
Bildirimler
Bitiş Tarihi
Bitiş tarihi atanmadı.
Bağımlılıklar
Bağımlılık yok.
Referans: Plume/Plume#610
Yükleniyor…
Tablo ekle
Yeni konuda referans
Herhangi bir açıklama sağlanmadı.
"feature/persist_password_reset" Dalını Sil
Bir dalı silmek kalıcıdır. Her ne kadar silinen dal tamamen kaldırılana kadar çok kısa bir süre yaşamını sürdürse de, çoğu durumda bu işlem GERİ ALINAMAZ. Devam edilsin mi?
Had a go at closing #600.
New to lots of stuff here (Rust, Diesel, Rocket, Plume...) so all feedback appreciated.
TODO
@ -243,4 +223,4 @@
form: Form<NewPasswordForm>,
rockets: PlumeRocket,
) -> Result<Flash<Redirect>, Ructe> {
form.validate()
The logic to detect an expired token is private to the model now. Not sure how important having a specific error is. We could maybe return a custom Diesel error?
It would be good to test that old password reset requests are ignored.
The simplest way I can think of would be to insert a record, and then update its
creation_date
with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.What you did so far looks great! Thank you for helping with that.
thread::sleep(2 * 60 * 60 * 1000)
More seriously, I think you can pass tuples to
diesel::insert_into(...).values()
, like:You can probably use it instead of
PasswordResetRequest::insert
in this test.@ -243,4 +223,4 @@
form: Form<NewPasswordForm>,
rockets: PlumeRocket,
) -> Result<Flash<Redirect>, Ructe> {
form.validate()
Maybe, instead of mapping the error to
to_validation
, you could have a closure that returns the specific error that was previously returned?Codecov Report
@ -243,4 +223,4 @@
form: Form<NewPasswordForm>,
rockets: PlumeRocket,
) -> Result<Flash<Redirect>, Ructe> {
form.validate()
I ended up adding a new
Expired
error variant - it felt generic enough to be useful elsewhere in the app too. Happy to iterate on this more if it doesn't feel like a good approach though.Pretty happy with this now. Still a couple of CI failures but they look random to me
Yes the CI fails sometimes because it doesn't have enough memory to build…
Everything seems to work fine. Thank you! 😊