الهوية الوطنية

Nafath (نفاذ) — ELM · المرحلة 1

الحالة الحالية: Mock (development) تسجيل دخول بهوية رقمية معتمدة — يلغي حاجة KYC منفصل + يبني الثقة فوراً.

المواصفات

ContractApp\Integrations\Contracts\IdentityProvider
Mock adapterApp\Integrations\Mock\MockNafath
Production adapter (مخطط)App\Integrations\Production\NafathAdapter
Driver keyconfig('sakeenah.integrations.identity.driver')
الوثائق الرسميةhttps://nafath.sa/api

الميزات المعتمدة عليه

الاستخدام في الـ 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

  1. اطلب credentials من الموزود الرسمي
    تواصل مع: Nafath (نفاذ) — ELM
  2. ابنِ 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(...)
    }
  3. ضع credentials في .env
    IDENTITY_DRIVER=production
    IDENTITY_API_KEY=your_real_key_here
  4. اختبر — كتب feature test يستخدم mock أولاً، ثم integration test على staging
  5. أعد تشغيلphp artisan config:clear

موافقات + Compliance

المتعلق