عرض عملي: التسجيل مع تجزئة كلمات المرور والتقييد
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
build registration and a safe login. Prepares JNR-037-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Add the encoder bean and a
POST /api/auth/registerendpoint with validation (length, email format). - Hash the password in the service; store only the hash.
- Return the same response whether or not the email already exists (or a generic message).
- Add a simple in-memory throttle: 5 failures per account and IP, then 429 for a period.
- Planned mistake: logging the whole request body, which prints the password. Fix: log only the email and mask or skip bodies.
- Search logs and database for any plaintext password.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.