النطاقات (Scopes) والمطالبات (Claims) وتصميم التفويض
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
design fine-grained authorization.
الموضوعات المخطط لها
- Scopes describe what a client may do (
orders:read,inventory:write); claims describe who the user is (subject, roles, tenant). - Authorization has layers: scope (may this client call this API?), role (may this user do this kind of action?), and ownership or attribute checks (is this their order?).
- Keep tokens small; put stable facts in claims, look up changing permissions in the service.
- Least privilege: admin operations need their own scope.
- Test authorization as code (negative tests).
تفاصيل المخطط المبدئي
عرض عملي
matrix: endpoint | scope | role | ownership check.
اختبر فهمك
Which check stops customer A reading customer B's order?
أظهر الإجابة
The ownership check.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.