feat(auth): kayıt, giriş, çıkış ve oturum (argon2 + JWT httpOnly cookie)

- Kayıt: kullanıcı + hane + örnek kategori/ödeme türü tek transaction'da
- Giriş: beni hatırla (30 gün / oturum), e-posta başına deneme sınırı
- AuthUser extractor: cookie'deki JWT'yi doğrular
- ValidJson: JSON + doğrulama, Türkçe hata mesajları
- api.http: auth istekleri eklendi
- Birim testleri: şifre, JWT, deneme sınırı, seed (11 test)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-11 23:37:52 +03:00
parent 4103b90e4b
commit d6136959b1
27 changed files with 1573 additions and 32 deletions
+6 -2
View File
@@ -4,12 +4,16 @@ use std::sync::Arc;
use mongodb::Database;
use crate::config::Config;
use crate::{
auth::{jwt::Jwt, limiter::LoginLimiter},
config::Config,
};
/// `Clone` ucuzdur: `Database` ve `Arc` içte referans sayımı kullanır, veri kopyalanmaz.
#[derive(Clone)]
pub struct AppState {
pub db: Database,
#[allow(dead_code)] // Faz 1 – Adım 3'te kullanılacak
pub config: Arc<Config>,
pub jwt: Arc<Jwt>,
pub login_limiter: Arc<LoginLimiter>,
}