Client infrastructure for connecting to external DCI-compliant registries. Handles OAuth2 authentication, token caching, request signing, and HTTP communication with CRVS, IBR, Social Registry, and other DCI endpoints. Provides a reusable data source configuration model and Python service class for search, subscribe, and status operations.
- Configure external DCI registry endpoints with OAuth2 or Bearer token authentication
- Cache OAuth2 tokens with automatic refresh to minimize token requests
- Sign outgoing DCI requests using JWK keys from
spp_dci - Execute synchronous and asynchronous search operations (by ID, predicate, expression, date range)
- Subscribe to and unsubscribe from registry event notifications
- Check transaction status for asynchronous operations
- Test connection with one-click validation and error diagnostics
- Format HTTP and connection errors into user-friendly messages
| Model | Description |
|---|---|
spp.dci.data.source |
Connection configuration for external DCI registries |
- ``DCIClient(data_source, env)``: Main API client for executing DCI protocol operations (search, subscribe, txn_status). Instantiate with a data source record and environment.
After installing:
- Navigate to Settings > Technical > DCI > Configuration > Data Sources
- Create a new data source with name, code, base URL, and registry type
- Configure authentication (OAuth2 token URL, client ID, client secret, scope)
- Set sender ID and callback URI for DCI protocol headers
- Optionally configure a signing key for request signatures
- Click Test Connection to verify configuration
- Menu: Settings > Technical > DCI > Configuration > Data Sources
- Form: Includes connection test button in header, configuration groups, and two notebook tabs ("Connection Status" and "Notes")
| Group | Access |
|---|---|
base.group_system |
Full CRUD, view secrets |
base.group_user |
Read-only (secrets hidden) |
- Inherit
spp.dci.data.sourceto add registry-specific configuration fields - Instantiate
DCIClient(data_source, env)from custom code to execute DCI operations - Override
_get_registry_type()or_get_receiver_id()for custom registry routing - Use
format_http_error()andformat_connection_error()for consistent error handling
# Get data source and create client
data_source = env['spp.dci.data.source'].get_by_code('crvs_main')
client = DCIClient(data_source, env)
# Execute synchronous search by identifier
response = client.search_by_id('UIN', '123456789', record_type='PERSON')
# Execute asynchronous search with callback
response = client.search_by_id('BRN', '987654321', async_mode=True)
# Search by date range
response = client.search_by_date_range('2024-01-01', '2024-12-31', event_type='BIRTH')
# Subscribe to registry events
response = client.subscribe(event_type='REGISTER', notify_record_type='Person')base, spp_dci (Python: httpx)
Important
This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production.
Table of contents
- Initial migration to OpenSPP2
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed feedback.
Do not contact contributors directly about support or help with technical issues.
- OpenSPP.org
Current maintainers:
This module is part of the OpenSPP/OpenSPP2 project on GitHub.
You are welcome to contribute.




