Admin Services Developers Guide
Overview
The admin application is a web-based application used by a privileged group of administrative personnel to manage various master data. The various resources that can be managed by an administrator are:
Center (Registration centers)
Device
Machine
User (Admin, Registration staff)
Along with resource and data management, the admin can generate master keys, check registration status, retrieve lost RIDs, and resume processing of paused packets.
Masterdata Service exposes API to perform CRUD operations on masterdata through Admin service.
Hotlist Service provides functionality to block/unblock any IDs with option of expiry. This hotlisted information will also be published to MOSIP_HOTLIST WebSub topic.
Sync Data Service can be accessed only by the privileged group of admin personnel and enables default configurations and seed data to be setup when the MOSIP platform gets initialized.
The admin module has four services:
Admin service
Kernel Masterdata service
Kernel Syncdata service
Hotlist service
The documentation here will guide you through the pre-requisites required for the developer' setup.
Software setup
JDK 11
Any IDE (like Eclipse, IntelliJ IDEA)
Apache Maven (zip folder)
pgAdmin
Postman
Git/GitHub Desktop
Notepad++ (optional)
lombok.jar (file)
settings.xml
Follow the steps below to set up Admin Services on your local system:
Download lombok.jar and settings.xml.
Unzip Apache Maven and move the unzipped folder in
C:\Program Files
andsettings.xml
toconf
folderC:\Program Files\apache-maven-3.8.4\conf
.Install Eclipse, open the
lombok.jar
file and wait for some time until it completes the scan for Eclipse IDE and then clickInstall/ Update
.
Check the Eclipse installation folder
C:\Users\userName\eclipse\jee-2021-12\eclipse
to see if thelombok.jar
is added. By doing this, you don't have to add the dependency oflombok
in yourpom.xml
file separately as it is auto-configured by Eclipse.Configure the JDK (Standard VM) with your Eclipse by traversing through
Preferences → Java → Installed JREs
.
Code setup
For the code setup, clone admin-services repository and follow the guidelines mentioned in the Code Contributions.
Importing and building of a project
Open the project folder where
pom.xml
is present.Open command prompt from the same folder.
Run the command
mvn clean install -Dgpg.skip=true -DskipTests=true
to build the project and wait for the build to complete successfully.After building of a project, open Eclipse and select
Import Projects → Maven → Existing Maven Projects → Next → Browse to project directory → Finish
.After successful importing of project, update the project by right-click on
Project → Maven → Update Project
.
Environment setup
For the environment setup, you need an external JAR that is available here with different versions. (E.g.: You can download
kernel-auth-adapter.jar
and add to projectLibraries → Classpath → Add External JARs → Select Downloaded JAR → Add → Apply and Close
).
Clone admin-services repository.
Any changes in the properties for Masterdata and Admin services should be done in
application-local1.properties
file.By default the Admin-services is connected to dev environment.
To run the specific service from IDE,
Open IDE -> Specific service -> src/main/java/io.mosip.specific service -> Right click on the file and select run as Java Application
.
For example, to run the Admin service, open IDE -> admin-service -> src/main/java/io.mosip.admin -> Right click on AdminBootApplication.java and select run as Java Application
.
To run the specific service from Command Prompt, Open Project folder -> open command prompt from same folder -> Execute
java -jar target/specific-service-1.2.0.jar
.
For example, to run the admin service, Open Project folder -> open command prompt from same folder -> Execute java -jar target/admin-service-1.2.0-SNAPSHOT.jar
.
The service should now be up and running.
Admin services API
For API documentation, refer here.
The APIs can be tested with the help of Swagger-UI and Postman.
Swagger is an interface description language for describing restful APIs expressed using JSON. You can access Swagger-UI of admin-services for dev-environment from:
Admin service– http://dev.mosip.net/v1/admin/swagger-ui/index.html?configUrl=/v1/admin/v3/api-docs/swagger-config#/
and localhost from http://localhost:8098/v1/admin/swagger-ui/index.html?configUrl=/v1/admin/v3/api-docs/swagger-config#/
.
Masterdata- http://dev.mosip.net/v1/masterdata/swagger-ui/index.html?configUrl=/v1/masterdata/v3/api-docs/swagger-config#/
and localhost from http://localhost:8086/v1/masterdata/swagger-ui/index.html?configUrl=/v1/masterdata/v3/api-docs/swagger-config#/
.
Syncdata- http://dev.mosip.net/v1/syncdata/swagger-ui/index.html?configUrl=/v1/syncdata/v3/api-docs/swagger-config#/
and localhost from http://localhost:8089/v1/syncdata/swagger-ui/index.html?configUrl=/v1/syncdata/v3/api-docs/swagger-config#/
.
Hotlist- http://dev.mosip.net/v1/hotlist/swagger-ui/index.html?configUrl=/v1/hotlist/v3/api-docs/swagger-config#/
and localhost from http://localhost:8095/v1/hotlist/swagger-ui/index.html?configUrl=/v1/hotlist/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.
Create an environment as shown in the image below.
This environment is created for dev. Give the variable name as url
and set both the values as https://dev.mosip.net
.
In the similar way, create another environment for localhost as shown below.
This environment is created for localhost. Give the variable name as url
and set both the values as http://localhost:8099
.
Last updated