@extends('layouts.app') @section('title','API Clients - NGBVD') @section('content') @include('integrations.partials.settings_style') @php $clients = $clients ?? collect(); $districts = $districts ?? collect(); $partners = $partners ?? collect(); @endphp
Zero Trust Credential Management

API Clients

Create and manage dedicated credentials, data scopes, rate limits, signing controls and outbound partner URLs for approved systems.

@if($errors->any())
Please correct the highlighted API client settings.
@endif @if(session('new_api_client_secret') || session('message'))
{{ session('message') ?: 'API client created. Copy the secret now; it will not be shown again.' }} @if(session('new_api_client_key'))
Client Key: {{ session('new_api_client_key') }}@endif @if(session('new_api_client_secret'))
Client Secret: {{ session('new_api_client_secret') }}@endif
@endif

Registered API Clients

Use separate clients for production, test and partner environments.

@forelse($clients as $client) @php $scopes = is_array($client->allowed_scopes) ? $client->allowed_scopes : preg_split('/[,\s]+/', (string)$client->allowed_scopes, -1, PREG_SPLIT_NO_EMPTY); $selectedDistricts = preg_split('/[,\s]+/', (string) $client->allowed_district_ids, -1, PREG_SPLIT_NO_EMPTY); $selectedDistrictNames = $districts->filter(function($district) use ($selectedDistricts) { return in_array((string) $district->id, array_map('strval', $selectedDistricts), true); })->pluck('name')->values()->all(); $outboundUrl = $client->outbound_base_url ? rtrim($client->outbound_base_url, '/').'/'.ltrim($client->outbound_push_endpoint ?: '', '/') : null; @endphp @empty @endforelse
Client Client Key Scopes Zero Trust Outbound URL Status
{{ $client->name }}
{{ $client->system_name ?: 'External system' }}
{{ $client->integration_code ?: 'PARTNER_SYSTEM' }}
{{ $client->client_key }}
Secret hashed and hidden.
@forelse($scopes as $scope){{ $scope }}@emptyNo scopes@endforelse @if(!empty($client->allowed_district_ids))
Districts: {{ !empty($selectedDistrictNames) ? implode(', ', $selectedDistrictNames) : $client->allowed_district_ids }} @endif @if(!empty($client->partner_id)) @php $clientPartner = $partners->firstWhere('id', $client->partner_id); @endphp
Partner: {{ $clientPartner->name ?? ('ID '.$client->partner_id) }} @endif
HTTPS {{ $client->require_https ? 'On' : 'Off' }} Signed {{ $client->require_signed_requests ? 'On' : 'Off' }} Encryption {{ $client->require_payload_encryption ? 'On' : 'Off' }}
Rate: {{ $client->rate_limit_per_minute ?: 60 }}/min | Window: {{ $client->signature_window_seconds ?: 300 }}s
@if($client->outbound_enabled && $outboundUrl) Enabled
{{ $outboundUrl }} @else Not configured @endif
{{ $client->is_active ? 'Active' : 'Inactive' }}
{{ $client->last_used_at ? \Carbon\Carbon::parse($client->last_used_at)->format('d M Y H:i') : 'Never used' }}
Edit client configuration Scopes, IPs, data scope, rate limits and outbound URL only.
@csrf @method('PUT')
Example: reference_data.read,incident_statistics.read,ubos.push,data_scope.district
Example: 41.210.143.163, 10.0.0.0/24
@php $oldDistricts = old('allowed_district_ids', $selectedDistricts); @endphp Hold Ctrl to select multiple districts. Required when using data_scope.district.
Required when using data_scope.partner. Only one partner is allowed.

Outbound Sharing Destination

No API clients registeredCreate the first authorised client using the panel on the right.

Create API Client

The generated secret is displayed once only.

@csrf
Use the smallest required scopes. Example district scope: data_scope.district.
Hold Ctrl to select multiple districts. Required when using data_scope.district.
Required when using data_scope.partner. Only one partner is allowed.

Outbound Sharing Destination
@endsection