You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fonksiyonun docstring'i get_ws_user'ın HTTP karşılığı olduğunu söylüyor; ancak get_ws_user kullanıcıyı döndürmeden önce if user is None or not user.is_active: return None kontrolü yaparken resolve_optional_useris_active'e bakmadan döndürüyor. Deaktive edilmiş ama token'ı iptal edilmemiş bir admin, bakım modu kapısını aşabilir. (İki ayrı reviewer bağımsız olarak tespit etti.)
get_ws_user: if user is None or not user.is_active: return None — resolve_optional_user'da bu kontrol yok.
Öneri: Son satırı user = await get_user_by_id(...); return user if (user and user.is_active) else None olarak değiştir.
2. BRANDING_LOGO kategorisi yetkisiz kullanıcıya açık
FileCategory.BRANDING_LOGO için site-geneli bir Cloudinary klasör yolu yazıldı, ancak yalnızca admin/superadmin'in bu kategoriyle yükleme yapabileceğini doğrulayan bir RBAC kontrolü yok. /upload endpoint'i CurrentActiveUser ile korunduğundan herhangi bir aktif kullanıcı category=branding_logo ile site branding klasörüne dosya yazabilir.
if category is FileCategory.BRANDING_LOGO:folder = f"{settings.CLOUDINARY_UPLOAD_FOLDER}/{category.value}"
Öneri: Kategori kontrolünün öncesine if category is FileCategory.BRANDING_LOGO and current_user.role not in (SystemRole.ADMIN, SystemRole.SUPERADMIN): raise HTTPException(403, ErrorMessages.INSUFFICIENT_PERMISSIONS) guard'ı ekle.
maintenance_mode_middleware, resolve_optional_user ve get_db'yi app.api.deps'ten import ediyor. core/ tüm katmanların import ettiği taban katmandır; api/'dan import yapması bağımlılık yönünü tersine çevirir.
REVIEW.md §3.1: "api → services → repositories → models — bu sıra bozulamaz."
Öneri:resolve_optional_user'ı app/core/security.py veya app/utils/'e, get_db'yi app/core/db.py'ye taşı; böylece core/ → api/ bağımlılığı ortadan kalkar.
Bakım modu middleware'i tüm API trafiğini kapı altına alır ve hatalı çalışması tüm kullanıcıları etkiler, ancak davranışını doğrulayan test yok. Admin bypass, exempt path mantığı ve session açma akışı test kapsamı dışında.
REVIEW.md §5.9: "Yeni endpoint için test yok (auth/security/payment-impacting'se major)."
PATCH /admin/system-settings/{key} güvenlik etkili ayarları (maintenance_mode, registration_enabled) değiştirir, ancak RBAC, tip doğrulama, bilinmeyen anahtar ve başarılı güncelleme senaryolarını kapsayan test yok.
REVIEW.md §5.9 / §6.7: auth/güvenlik etkili mutasyon endpoint'leri için test major önceliklidir.
list_all, get_public_settings ve update_setting, kod tabanındaki diğer servislerin (update_user_service, deactivate_own_account_service) tutarlı kullandığı adlandırma kuralına uymuyor.
Öneri:get_system_setting_by_key, get_all_system_settings, upsert_system_setting olarak yeniden adlandır ve services/system_settings.py importlarını güncelle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.