الهوية الوطنية
Nafath (نفاذ) — ELM · المرحلة 1
الحالة الحالية:
Mock (development)
تسجيل دخول بهوية رقمية معتمدة — يلغي حاجة KYC منفصل + يبني الثقة فوراً.
المواصفات
| Contract | App\Integrations\Contracts\IdentityProvider |
|---|---|
| Mock adapter | App\Integrations\Mock\MockNafath |
| Production adapter (مخطط) | App\Integrations\Production\NafathAdapter |
| Driver key | config('sakeenah.integrations.identity.driver') |
| الوثائق الرسمية | https://nafath.sa/api |
الميزات المعتمدة عليه
user_signup2fa_alternativekyc
الاستخدام في الـ Code
use App\Integrations\Contracts\IdentityProvider;
class MyController {
public function __construct(
private readonly IdentityProvider $service,
) {}
public function action() {
// $this->service يتحقن تلقائياً (mock أو production)
// حسب config('sakeenah.integrations.identity.driver')
}
}
لرفع التكامل إلى Production
-
اطلب credentials من الموزود الرسمي
تواصل مع: Nafath (نفاذ) — ELM -
ابنِ Production Adapter
// app/Integrations/Production/NafathAdapter.php namespace App\Integrations\Production; use App\Integrations\Contracts\IdentityProvider; use Illuminate\Support\Facades\Http; class NafathAdapter implements IdentityProvider { public function __construct( private string $apiKey = config('sakeenah.integrations.identity.api_key'), ) {} // Implement all interface methods using real HTTP calls // Use Laravel's Http::withToken($this->apiKey)->post(...) } -
ضع credentials في .env
IDENTITY_DRIVER=production IDENTITY_API_KEY=your_real_key_here - اختبر — كتب feature test يستخدم mock أولاً، ثم integration test على staging
-
أعد تشغيل —
php artisan config:clear
موافقات + Compliance
- تحقق من شروط الموزود الرسمي (في الـ docs URL أعلاه)
- وثّق DPA (Data Processing Agreement) موقّع
- أضف الموزود إلى قائمة الـ subprocessors المنشورة للمستخدمين
- إذا الموزود يخزّن PHI، تأكد أنه ضمن السعودية (data residency)