Backend Developers Guide

Overview

PMS Portal is used by the Partners to onboard with MOSIP and manage Devices, FTM, Create API Keys and Create OIDC clients etc.

Partner Management module has two services:

  • Partner Management service

  • Policy Management service

The documentation here will guide you through the prerequisites required for the developer's setup.

Software setup

Below is a list of tools required in Partner Management Services:

  1. JDK 11

  2. Any IDE (like Eclipse, IntelliJ IDEA)

  3. Apache Maven (zip folder)

  4. pgAdmin

  5. Postman

  6. Git

  7. Notepad++ (optional)

  8. lombok.jar (file)

  9. settings.xml (document)

Follow the steps below to set up Partner Management Services on your local system:

  1. Download lombok.jarand settings.xml from here.

  2. Install Apache Maven.

  3. Copy the settings.xml to ".m2" folder C:\Users\<username>\.m2.

  4. Install Eclipse.

  5. Open the lombok.jar file and wait for some time until it completes the scan for Eclipse IDE and then click Install/Update. Specify the eclipse installation location if required by clicking the ‘Specify location…’ button. Then, click Install/Update the button to proceed.

  1. Check the Eclipse installation folder C:\Users\userName\eclipse\jee-2021-12\eclipse to see if lombok.jar is added. By doing this, you will not have to add the dependency of lombok in your pom.xml file separately as it is auto-configured by Eclipse.

  2. Configure the JDK (Standard VM) with your Eclipse by traversing through Preferences → Java → Installed JREs.

Code setup

For the code setup, clone the repository and follow the guidelines mentioned in the Code Contributions.

Importing and building a project

  1. Open the project folder partner-management-services\partner where pom.xml is present.

  2. Open the command prompt from the same folder.

  3. Run the command mvn clean install -Dgpg.skip=true to build the project and wait for the build to complete successfully.

  4. After building a project, open Eclipse and select Import Projects → Maven → Existing Maven Projects → Next → Browse to project directory → Finish

  5. This will import 5 projects into Eclipse: partner, partner-management-service, pms-common, policy-management-service and policy-validator

  1. After successful importing of all the projects, update each project by right-clicking on Project → Maven → Update Project.

Environment setup

  • For the environment setup, you need an external JAR that is available here with different versions. Download the below-mentioned JARs with appropriate latest/appropriate versions. You will need to input the appropriate artifact ID and version and other inputs. kernel-auth-adapter.jar

  • E.g.: You can download kernel-auth-adapter.jar and add to the project Libraries → Classpath → Add External JARs → Select Downloaded JAR → Add → Apply and Close).

  • Properties Files - Update application-dev.properties and bootstrap.properties files in below folder partner-management-services\partner\partner-management-service\src\main\resources to run the Partner Management Service locally

  • Click the "run" option, the service will start locally on port 9109.

Policy management service also can run by following the above steps.

Partner Management Services API

  • For API documentation, refer here.

  • The APIs can be tested with the help of Postman or Swagger-UI.

  • Swagger is an interface description language for describing restful APIs expressed using JSON. Can access Swagger-UI of partner-management-services for dev-environment from https://dev.mosip.net/v1/partnermanager/swagger-ui/index.html?configUrl=/v1/partnermanager/v3/api-docs/swagger-config and localhost from http://localhost:9109/v1/partnermanager/swagger-ui/index.html?configUrl=/v1/partnermanager/v3/api-docs/swagger-config.

  • Can access Swagger-UI of policy-management-services for dev-environment from https://dev.mosip.net/v1/policymanager/swagger-ui/index.html?configUrl=/v1/policymanager/v3/api-docs/swagger-config and localhost from http://localhost:9107/v1/policymanager/swagger-ui/index.html?configUrl=/v1/policymanager/v3/api-docs/swagger-config.

  • Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster. It is widely used tool for API testing.

  • Download the JSON collection and then import it in your postman.

Last updated

Copyright © 2021 MOSIP. This work is licensed under a Creative Commons Attribution (CC-BY-4.0) International License unless otherwise noted.