عرض عملي: أداة حالة الطلب تحترم الملكية
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
build a read-only tool that cannot leak another customer's order. Prepares MID-069-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Define
get_order_status(orderId)with a typed schema. - Execute it by calling
orderswith the customer's bearer token. - Return a trimmed result or
NOT_ALLOWED/NOT_FOUND(same shape for both, to avoid probing). - Write the test: customer A asks for customer B's order and gets no data.
- Planned mistake: use a service account for the call; the test fails because B's order is visible. Fix by forwarding the user token.
- Show the trace of the call in logs without the token value.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.