How inji/inji-certify works
1. Repository shape
- This is a multi-module Java/Maven system centered on Inji Certify, a Spring Boot service for OpenID4VCI issuance.
- The main runtime service is certify-service; shared contracts and domain types live in certify-core; plugin-facing SPI contracts live in certify-integration-api.
- The repo also contains a large API test rig (api-test) and the operational assets needed for databases, Docker, and Kubernetes.
2. Primary runtime boundary: certify-service
- certify-service is the production application entrypoint (CertifyServiceApplication).
- Incoming requests go through Spring MVC controllers such as OAuthController, VCIssuanceController, CredentialConfigController, PreAuthorizedCodeController, WellKnownController, and RenderingTemplateController.
- Security is enforced by filters and config in SecurityConfig, AccessTokenValidationFilter, LocalAccessTokenValidationFilter, and related auth helpers.
3. Core issuance and protocol flows
- The service implements the issuer side of OpenID4VCI draft 13.
- Main flows include:
- issuer metadata and OAuth/OIDC discovery
- credential configuration management
- pre-authorized code issuance
- interactive authorization request handling
- token exchange
- credential issuance
- credential status / revocation
- The codebase explicitly supports multiple VC formats: W3C JSON-LD VC, SD-JWT VC, and a mock mDoc/mDL path.
4. Service-layer decomposition
- Business logic is in certify-service/src/main/java/io/mosip/certify/services.
- Key service boundaries include:
- CredentialConfigurationServiceImpl for config lifecycle
- VCIssuanceServiceImpl and CertifyIssuanceServiceImpl for credential generation/issue
- IarServiceImpl, IarSessionService, and IarVpRequestService for interactive authorization request state
- PreAuthorizedCodeService for pre-auth code flow
- CredentialStatusServiceImpl and StatusListCredentialService for revocation/status list handling
- RenderingTemplateServiceImpl for template-driven credential rendering
- JwksServiceImpl and OAuthAuthorizationServerMetadataService for discovery and key publication
5. Data model and persistence
- Persistence is JPA-based, with repositories under certify-service/repository.
- Important persisted entities include CredentialConfig, IarSession, Ledger, RenderingTemplate, CredentialStatusTransaction, and status-list tables.
- The DB schema is versioned and managed separately in db_scripts and db_upgrade_script, which is important because service behavior depends on specific schema tables and upgrade scripts.
6. Credential construction pipeline
- The service separates “what credential to issue” from “how to format/sign it”.
- Format-specific code lives in:
- credential/ for Credential, SDJWT, W3CJsonLD, MDocCredential
- validators/ for request and configuration validation by format
- proof/ and proofgenerators/ for proof validation and signing
- vcformatters/ for templating and serialization
- This makes format support a plug-in-like internal boundary even before external plugins are invoked.
7. Plugin integration boundary
- certify-integration-api defines SPI contracts for extension points:
- DataProviderPlugin
- VCIssuancePlugin
- AuditPlugin
- The service can either generate credentials directly or delegate data retrieval/issuance behavior through these plugin interfaces.
- The README highlights two major plugin styles: Data Provider plugins (e.g., Postgres, CSV) and VC Issuance plugins.
8. Core shared module
- certify-core holds the protocol-neutral contract layer shared across service implementations and plugins.
- It contains:
- DTOs for auth requests/responses, credential configs, ledger search, status lists, metadata, and verifiable presentation verification
- constants and error models
- validators and SPI interfaces
- common utilities and exception types
- This module is the main boundary that keeps API shapes and domain objects stable across the service and plugin layers.
9. Test and simulation environment
- api-test is a separate Spring/Java test rig built with TestNG and Maven.
- It contains many request templates, sample biometric assets, and scenario folders for different credential ecosystems and use cases.
- The files under src/main/resources/injicertify and the testNgXmlFiles indicate it is used to run end-to-end scripted API scenarios against the service and related dependencies, not just unit tests.
10. Configuration and templating system
- The service relies heavily on externalized configuration in src/main/resources, including credential configuration JSON, VP request config, bootstrap/application property files, and template resources.
- Rendering uses Velocity/templating support and stored credential templates; this is central to how credential payloads are assembled from configured claims and issuer-specific layouts.
- The RenderingTemplateController and template repository show that templates are first-class runtime data, not just static assets.
11. Operational dependencies
- The service assumes external identity and trust infrastructure:
- an OAuth/OIDC authorization server such as Keycloak/eSignet
- a database for config, sessions, templates, ledger, and status data
- optional Redis cache support via RedisCacheConfig
- key management / signing infrastructure, especially for data-integrity and proof generation
- There are also crypto- and trust-related assets in .github/keys and deployment scripts for production environments.
12. Deployment topology
- Local execution is supported both via Docker Compose and direct service startup.
- Production deployment is Kubernetes-based, with Helm charts in helm/inji-certify and deployment scripts in deploy/.
- The repo also contains Dockerfiles for the service and testing rig, plus workflow automation for build, linting, and publishing charts.
13. How to diagram the system
- A useful diagram should show:
- clients/wallets calling the Spring Boot issuer API
- security/auth server interaction for token and metadata flows
- controllers delegating to service-layer orchestration
- service-layer access to DB/repositories, template storage, status lists, and ledger records
- optional plugin calls for data-provider or issuance customization
- proof/signing and format-specific rendering as a separate internal lane
- deployment wrappers around the service: Docker/Kubernetes/Helm, plus the separate test harness and DB scripts
Main entry points: services Flow Services · controller HTTP API · credential Credential Pipeline · InjiTestRunner.java API Test Rig
Components 20
Runtime
Production issuer service and its internal layers.
- Certify App · Main production service for OpenID4VCI issuance.
certify-service/src/main/java/io/mosip/certify/CertifyServiceApplication.java - HTTP API · Issuer endpoints for OAuth, credential issuance, config, revocation, templates, and discovery.
certify-service/src/main/java/io/mosip/certify/controller - Security · Request authentication and access-token enforcement around the service API.
certify-service/src/main/java/io/mosip/certify/config/SecurityConfig.java - Flow Services · Core issuance, pre-auth, interactive authorization, discovery, JWKS, status, and template orchestration.
certify-service/src/main/java/io/mosip/certify/services - Credential Pipeline · Format-specific credential modeling, validation, proof generation, and serialization.
certify-service/src/main/java/io/mosip/certify/credential - Persistence · Repositories and entities for configs, sessions, ledgers, templates, and status lists.
certify-service/src/main/java/io/mosip/certify/repository - VC Formatters · Velocity-based rendering and serialization of credential payloads.
certify-service/src/main/java/io/mosip/certify/vcformatters - Proof & Signing · Proof validation and proof generation for JWT, DID, and data-integrity flows.
certify-service/src/main/java/io/mosip/certify/proof - Plugin Bridge · Runtime adapter that invokes audit and issuance/data-provider plugins.
certify-service/src/main/java/io/mosip/certify/plugin - App Config · Service wiring for MVC, Velocity, MDoc, verification, batch jobs, and auth conversion.
certify-service/src/main/java/io/mosip/certify/config - Status Lists · Status-list issuance, index management, and scheduled updates for credential revocation state.
certify-service/src/main/java/io/mosip/certify/services/StatusListCredentialService.java - Discovery · Well-known, OAuth authorization server metadata, and JWKS publication.
certify-service/src/main/java/io/mosip/certify/controller/WellKnownController.java - Pre-Auth Flow · Pre-authorized code issuance and token exchange path for issuance without interactive user auth.
certify-service/src/main/java/io/mosip/certify/services/PreAuthorizedCodeService.java - Interactive Flow · Interactive authorization request session handling and VP presentation during issuance.
certify-service/src/main/java/io/mosip/certify/services/IarServiceImpl.java - Ledger API · Credential ledger lookup and issuance history access.
certify-service/src/main/java/io/mosip/certify/services/CredentialLedgerServiceImpl.java
Shared
Protocol-neutral contracts and plugin-facing SPI.
- Core Contracts · Protocol-neutral DTOs, SPI interfaces, validators, constants, and errors shared by service and plugins.
certify-core/src/main/java/io/mosip/certify/core - Plugin SPI · Extension contracts for data providers, VC issuance plugins, and audit plugins.
certify-integration-api/src/main/java/io/mosip/certify/api/spi
Ops
Database, deployment, and runtime packaging assets.
- DB Scripts · Initial schema, seed data, and upgrade/rollback scripts for the certify database.
db_scripts/inji_certify/ddl.sql - Deployments · Docker Compose, Dockerfiles, Helm chart, and deployment scripts for local and production runtime.
helm/inji-certify/Chart.yaml
Test Rig
End-to-end API scenario harness and fixtures.
- API Test Rig · Separate TestNG-based scenario runner with request templates, sample assets, and environment configs.
api-test/src/main/java/io/inji/testrig/apirig/injicertify/testrunner/InjiTestRunner.java
Connections 30
- Certify App → HTTP API: hosts · Application exposes issuer endpoints through controllers.
- Certify App → Security: protects · Security filters guard incoming requests.
- HTTP API → Flow Services: delegates · Controllers forward protocol operations to service-layer orchestration.
- HTTP API → Discovery: exposes · Discovery endpoints are served through HTTP controllers.
- HTTP API → Pre-Auth Flow: exposes · Pre-authorized code endpoints are handled by the API layer.
- HTTP API → Interactive Flow: exposes · Interactive authorization request endpoints are handled by the API layer.
- HTTP API → Ledger API: exposes · Ledger-related endpoints are served through the API layer.
- Flow Services → Credential Pipeline: builds · Issuance services assemble credentials through the credential pipeline.
- Flow Services → Persistence: persists · Business flows read and write configs, sessions, templates, and status data.
- Flow Services → VC Formatters: renders · Template service formats credential payloads and display content.
- Flow Services → Proof & Signing: signs · Proof and signing components validate proofs and generate signatures.
- Flow Services → Plugin Bridge: invokes · Services can delegate data retrieval or issuance customization to plugins.
- Flow Services → Status Lists: updates · Credential status flows maintain revocation and status lists.
- Flow Services → Discovery: publishes · Discovery services generate metadata and JWKS documents.
- Flow Services → Pre-Auth Flow: orchestrates · Pre-auth service manages code issuance and token exchange.
- Flow Services → Interactive Flow: orchestrates · IAR services manage session state and VP request handling.
- Flow Services → Ledger API: queries · Ledger services provide search and issuance history access.
- Credential Pipeline → VC Formatters: formats with · Credential objects are serialized through formatter/template support.
- Credential Pipeline → Proof & Signing: validated by · Proof validators and generators secure credential construction.
- Credential Pipeline → Core Contracts: shares types · Format code relies on common contracts and DTOs.
- Plugin Bridge → Plugin SPI: implements · Runtime plugin bridge uses the SPI contracts.
- Plugin SPI → Core Contracts: depends on · Integration contracts align with shared DTOs and errors.
- App Config → Flow Services: wires · Spring configuration composes the service-layer beans.
- App Config → Credential Pipeline: configures · Configuration enables format-specific behavior.
- Status Lists → Persistence: stores · Status list state is persisted via repositories.
- DB Scripts → Persistence: backs · Database scripts define the schema used by repositories.
- Deployments → Certify App: packages · Docker and Helm assets package and deploy the service.
- Deployments → API Test Rig: supports · Deployment assets also run the API test rig and local stack.
- API Test Rig → HTTP API: drives · Test scenarios exercise the service through HTTP flows.
- API Test Rig → DB Scripts: initializes · The test rig uses DB fixtures and cleanup scripts.