السياسات كشيفرة (Policy as code)
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
express access rules as versioned, tested code.
الموضوعات المخطط لها
- Policy engines evaluate rules (who may do what) separately from application code.
- Policies live in version control, are reviewed like code, and are tested with allow and deny cases.
- Central policies give consistency; local enforcement gives speed; decide which decisions are centralized.
- Make decisions auditable: log the input, decision, and policy version.
- Verify engine and syntax before recording.
تفاصيل المخطط المبدئي
عرض عملي
A policy in words and a test table: allow if caller role = fulfillment and action = read and resource type = order-event; deny otherwise. Test rows with expected decisions.
اختبر فهمك
Why test policies with deny cases?
أظهر الإجابة
To prove they block what they should, not only allow what they should.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.