Skip to content

ID-Repository is the Github repository from Release 1.2 for hosting modules related to Identity and credential.

License

Notifications You must be signed in to change notification settings

mosip/id-repository

Repository files navigation

ID Repository

Maven Package upon a push Quality Gate Status

Overview

The ID Repository is the backbone of the MOSIP identity platform, responsible for the secure storage and lifecycle management of foundational identity data. It serves as the authoritative source for identity records, handling operations such as identity creation, updates, and retrieval.

This repository contains source code and design documents for MOSIP ID Repository, which is the server-side module to manage ID lifecycle. The module provides a comprehensive set of REST APIs to interact with identity services, ensuring secure and standardized access to identity information.

Features

  • Identity Data: Storage and retrieval of demographic and biometric data.
  • Credentials: Management and issuance of verifiable credentials.
  • Virtual IDs (VID): Generation and management of revocable virtual tokens for privacy protection.
  • Salt & Keys: Security foundations for identity data encryption and hashing.

Services

The ID Repository contains the following services. For detailed code setup instructions for each service, please refer to their individual README files:

  1. Credential Service - Service for handling credentials.
  2. Identity Service - Service for identity management.
  3. VID Service - Service for Virtual ID management.
  4. Key Generator - Utility for generating salt/keys.
  5. Credential Request Generator - Generator for credential requests.
  6. Core - Core library and shared components.

Codebase Relocation

The credential feeder has been moved to the mosip-utilities repository.

Database

See DB guide for database setup and migration details.

Installation

Prerequisites

The project requires:

  • JDK: 21.0.3
  • Maven: 3.9.6
  • kernel-auth-adapter.jar needs to be added to the build path to run the services
  • Biometric SDK: To run the Identity Service, a Biometric SDK implementation jar or Mock SDK needs to be added to the build path

For Kubernetes Deployment

  • Set KUBECONFIG variable to point to existing K8 cluster kubeconfig file:
    export KUBECONFIG=~/.kube/<k8s-cluster.config>
    

Local Setup (for Development or Contribution)

  1. Make sure the config server is running. For detailed instructions on setting up and running the config server, refer to the MOSIP Config Server Setup Guide.

    Note: Refer to the MOSIP Config Server Setup Guide for setup, and ensure the properties mentioned in the configuration section are taken care of. Replace the properties with your own configurations (e.g., DB credentials, IAM credentials, URL).

  2. Clone the repository:

    git clone https://github.com/mosip/id-repository.git
    cd id-repository
    
  3. Build the project:

    mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
    
  4. Start the application:

    • Click the Run button in your IDE, or
    • Run via command:
    java -Dspring.profiles.active=<profile> \
         -Dspring.cloud.config.uri=<config-url> \
         -Dspring.cloud.config.label=<config-label> \
         -jar <jar-name>.jar
    

    Example:

    • profile: env (extension used on configuration property files)
    • config-label: master (git branch of config repo)
    • config-url: http://localhost:51000 (URL of the config server)
  5. Verify Swagger is accessible at: http://localhost:<port>/v1/<service>/swagger-ui/index.html

Local Setup with Docker (Easy Setup for Demos)

Option 1: Pull from Docker Hub

Recommended for users who want a quick, ready-to-use setup — testers, students, and external users.

Pull the latest pre-built images from Docker Hub using the following commands:

docker pull mosipid/id-repository-identity-service:<version>
docker pull mosipid/id-repository-vid-service:<version>
docker pull mosipid/credential-service:<version>
docker pull mosipid/credential-request-generator:<version>
docker pull mosipid/id-repository-salt-generator:<version>

Option 2: Build Docker Images Locally

Recommended for contributors or developers who want to modify or build the services from source.

  1. Clone and build the project:

    git clone https://github.com/mosip/id-repository.git
    cd id-repository
    mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true
    
  2. Navigate to each service directory and build the Docker image:

    cd id-repository/<service-directory>
    docker build -t <service-name> .
    

Running the Services

Start each service using Docker:

docker run -d -p <port>:<port> --name <service-name> <service-name>

Verify Installation

Check that all containers are running:

docker ps

Access the services at http://localhost:<port> using the port mappings for each service.

Deployment

Kubernetes

To deploy ID Repository services on a Kubernetes cluster, refer to the Sandbox Deployment Guide.

Pre-requisites

  • Set KUBECONFIG variable to point to existing K8 cluster kubeconfig file:
    export KUBECONFIG=~/.kube/<k8s-cluster.config>
    

Install

cd deploy
./install.sh

Delete

cd deploy
./delete.sh

Restart

cd deploy
./restart.sh

Configuration

Refer to the configuration guide.

APIs

API documentation is available here.

Testing

Automated functional tests are available in the Functional Tests repo.

Contribution & Community

• To learn how you can contribute code to this application, click here.

• If you have questions or encounter issues, visit the MOSIP Community for support.

• For any GitHub issues: Report here

License

This project is licensed under the Mozilla Public License 2.0.

About

ID-Repository is the Github repository from Release 1.2 for hosting modules related to Identity and credential.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 58