How mosip/partner-management-services works
1. This repository is a multi-module Java 11 / Spring Boot workspace for MOSIP’s Partner Management Services (PMS). The top-level build produces several deployable artifacts, not a single application.
2. The two main runtime services are:
- partner-management-service: manages partner onboarding and lifecycle, device/provider registration, certificates, API keys, OIDC/client data, MISP licensing, roles, and user-related workflows.
- policy-management-service: manages policy groups, auth/data-share policies, policy status transitions, policy search/filtering, and policy/partner mapping workflows.
3. Both services are layered in the same way: REST controllers at the edge, service classes for business logic, repositories for persistence access, and DTO-heavy request/response models. This makes controller-to-service-to-database the primary internal data path.
4. partner/pms-common is the shared domain and infrastructure library. It contains:
- shared entities and repositories for partners, policies, clients, MISP, devices, and summary/history tables,
- common request/response wrappers,
- search/filter/pagination helpers,
- auditing, notification, REST, mapping, and template utilities,
- shared validation and exception types.
This module is the main boundary-crossing dependency used by both services.
5. partner/policy-validator is a separate validation component focused on policy schema checks. It validates policy JSON structures before they are accepted by the policy service, especially data-share and related policy definitions. It acts as a domain guardrail rather than a runtime service.
6. Persistence is database-centric. The db_scripts folder defines the PMS schema and seed data, while db_upgrade_scripts contains versioned migrations and rollback scripts. The schema includes partner, policy, device, auth policy, MISP, OIDC client, certificate, and history tables, so state and auditability are core architectural concerns.
7. The partner service has several distinct subdomains inside one service boundary:
- partner lifecycle and contacts,
- device/auth-device registration and status changes,
- secure biometric interface and FTM chip workflows,
- OAuth/OIDC client management,
- MISP license management,
- user and role management.
This suggests the service is a coordination layer over multiple partner-related aggregates rather than a single narrow API.
8. The policy service centers on policy authoring and governance:
- create/update/publish/deactivate flows,
- policy group management,
- search and filtering APIs,
- mapping policies to partners or API keys,
- audit and request/response wrapping.
It also includes wrappers/config for request handling and API documentation, indicating a formal public API surface.
9. External integration points materially shape the design. The code references Keycloak, OAuth clients, internal auth, certificate handling, audit emission, and notification/websub-style publishing. These integrations are part of the service logic, not separate sidecars or adapters.
10. The repository also includes a large api-test module used for functional and integration testing. It is template-driven, with YAML scenario definitions and Handlebars request/response templates for many end-to-end cases. This module exercises the published APIs rather than unit-level internals.
11. Deployment is Kubernetes-oriented. The helm directory contains separate charts for pms-partner and pms-policy, each with deployment, service, service monitor, and virtual service manifests. The deploy scripts support install, delete, restart, and config management around K8s rollout.
12. CI/CD and release hygiene are part of the repo structure: GitHub Actions workflows handle lint/publish, database tests, release tagging/changelog generation, and push-triggered builds. A generated SBOM is also checked in, showing supply-chain tracking is expected.
13. A useful architecture diagram would show two independent Spring Boot services backed by a shared library, both persisting to the PMS database schema, with policy validation and functional tests as supporting components, and Helm/Kubernetes as the runtime deployment target.
Main entry points: ddl.sql DB Schema · pms-common PMS Common · pms Partner API · pom.xml PMS Workspace
Components 18
Workspace
Multi-module Maven build for PMS services and shared libraries.
- PMS Workspace · Top-level Java 11/Spring Boot workspace that produces multiple deployable artifacts.
partner/pom.xml
Runtime services
Deployable Spring Boot services that expose the public APIs.
- Partner Service · Primary partner-management runtime for partner onboarding, lifecycle, device registration, certificates, API keys, OIDC clients, MISP licensing, roles, and user workflows.
partner/partner-management-service - Policy Service · Primary policy-management runtime for policy groups, policy authoring, status transitions, search, and partner/policy mapping.
partner/policy-management-service - Partner API · Controllers and request/response wrappers for partner lifecycle, devices, OIDC clients, MISP, roles, and users.
partner/partner-management-service/src/main/java/io/mosip/pms - Partner Domain · Service implementations coordinating partner aggregates and external integrations.
partner/partner-management-service/src/main/java/io/mosip/pms/partner - Device Domain · Device, SBI, and FTM chip registration and status management flow.
partner/partner-management-service/src/main/java/io/mosip/pms/device - OIDC Clients · OAuth/OIDC client lifecycle and related data handling.
partner/partner-management-service/src/main/java/io/mosip/pms/oauth/client - MISP Licensing · MISP/infrastructure provider license management and approval flows.
partner/partner-management-service/src/main/java/io/mosip/pms/partner/misp - Policy API · Policy controllers and API surface for policy and policy group governance.
partner/policy-management-service/src/main/java/io/mosip/pms/policy - Policy Domain · Policy authoring, publishing, deactivation, search, filtering, and partner mapping logic.
partner/policy-management-service/src/main/java/io/mosip/pms/policy/service
Shared modules
Cross-cutting library code reused by both services.
- PMS Common · Shared domain, repositories, DTOs, helpers, validation, and infrastructure utilities used across both services.
partner/pms-common - Policy Validator · Standalone policy schema validator used as a guardrail before policy acceptance.
partner/policy-validator
Supporting systems
Validation, database assets, tests, and deployment artifacts.
- DB Schema · PMS database schema, seed data, and versioned upgrade/rollback scripts for partner, policy, device, MISP, OIDC, certificate, and history tables.
db_scripts/mosip_pms/ddl.sql - Migrations · Versioned database upgrade and rollback scripts.
db_upgrade_scripts/mosip_pms/sql - API Tests · Template-driven end-to-end tests with YAML scenarios and Handlebars request/response templates.
api-test - Partner Helm · Kubernetes packaging for the partner-management service.
helm/pms-partner - Policy Helm · Kubernetes packaging for the policy-management service.
helm/pms-policy - Deploy Scripts · Install, delete, restart, and config-copy scripts for rollout operations.
deploy
Connections 29
- PMS Workspace → Partner Service: builds · Maven workspace produces the partner service artifact.
- PMS Workspace → Policy Service: builds · Maven workspace produces the policy service artifact.
- PMS Workspace → PMS Common: builds · Shared library is part of the workspace build.
- PMS Workspace → Policy Validator: builds · Validator module is built from the same workspace.
- Partner Service → Partner API: contains · Runtime service exposes its REST API layer.
- Partner API → Partner Domain: calls · Controllers delegate partner workflows to service implementations.
- Partner API → Device Domain: calls · Device-facing endpoints delegate registration and status workflows.
- Partner API → OIDC Clients: calls · Client-management endpoints delegate to OIDC client services.
- Partner API → MISP Licensing: calls · MISP license endpoints delegate to licensing services.
- Partner Domain → PMS Common: uses · Partner workflows reuse shared entities, repositories, DTOs, and utilities.
- Device Domain → PMS Common: uses · Device workflows reuse shared persistence and helper code.
- OIDC Clients → PMS Common: uses · Client workflows reuse shared domain and request/response models.
- MISP Licensing → PMS Common: uses · MISP workflows reuse shared license and partner persistence models.
- Policy Service → Policy API: contains · Runtime service exposes its policy REST API layer.
- Policy API → Policy Domain: calls · Controllers delegate policy governance logic to services.
- Policy Domain → PMS Common: uses · Policy service reuses shared search, persistence, and response wrappers.
- Policy Domain → Policy Validator: guards with · Policy acceptance is checked by the schema validator.
- Partner Domain → DB Schema: persists to · Partner aggregates are stored in the PMS schema.
- Device Domain → DB Schema: persists to · Device and SBI/FTM state is stored in the PMS schema.
- OIDC Clients → DB Schema: persists to · OIDC client state is stored in the PMS schema.
- MISP Licensing → DB Schema: persists to · MISP license state is stored in the PMS schema.
- Policy Domain → DB Schema: persists to · Policy and policy-group state is stored in the PMS schema.
- DB Schema → Migrations: evolves via · Schema changes are maintained through versioned migrations and rollbacks.
- API Tests → Partner Service: exercises · Functional scenarios target the partner service APIs.
- API Tests → Policy Service: exercises · Functional scenarios target the policy service APIs.
- Partner Helm → Partner Service: deploys · Helm chart packages the partner runtime.
- Policy Helm → Policy Service: deploys · Helm chart packages the policy runtime.
- Deploy Scripts → Partner Helm: operates · Deployment scripts manage the partner chart lifecycle.
- Deploy Scripts → Policy Helm: operates · Deployment scripts manage the policy chart lifecycle.