Commons module provides a bedrock to build and run services by providing several significant necessary technical operations. It contains common functionalities which are used by more than one module.
Below is a list of tools required in Commons:
JDK 11
Any IDE (like Eclipse, IntelliJ IDEA)
Apache Maven (zip folder)
PostgreSQL
Any DB client (like DBeaver, pgAdmin)
Postman (any HTTP Client)
Git
Any Editor (like Vscode, Notepad++ etc optional)
lombok.jar (jar file)
settings.xml (document)
Download lombok.jar and settings.xml.
Unzip Apache Maven and move settings.xml
to "conf" folder <apache maven unzip path>\conf
.
Install Eclipse, open the lombok.jar
file and then click Install/Update
.
Check the Eclipse installation folder to see if the lombok.jar
is added.
Configure the JDK (Standard VM) with your Eclipse by traversing through Preferences → Java → Installed JREs
.
For the code setup, clone the repository and follow the guidelines mentioned in the Code Contributions.
Open the project folder where pom.xml
is present.
Open the command prompt from the same folder.
Run the command mvn clean install -Dgpg.skip=true -DskipTests=true
to build the project.
After building, 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
.
Download Auth adapter and add to project Libraries → Classpath → Add External JARs → Select Downloaded JAR → Add → Apply and Close
.
Clone mosip-config repository.
Refer Commons-DB-deploy to deploy local DB.
For integration with any of our environments, do reach out to our team.
Commons
uses two property files, kernel-default
and application-default
, configure them accordingly. For instance
Update spring.mail.host
property to update SMTP host.
Secrets can be encrypted using config server.
Update Url's in property files.(It can be either pointed to any remotely or locally deployed services).
Download kernel-config-server.jar. For windows download config-server-start.bat, linux users can run java -jar -Dspring.profiles.active=native -Dspring.cloud.config.server.native.search-locations=file:{mosip-config-mt_folder_path}/config -Dspring.cloud.config.server.accept-empty=true -Dspring.cloud.config.server.git.force-pull=false -Dspring.cloud.config.server.git.cloneOnStart=false -Dspring.cloud.config.server.git.refreshRate=0 {jarName}
.
Run the server by opening the config-server-start.bat
file.
To verify the config-server, hit the below URL http://localhost:51000/config/{spring.profiles.active}/{spring.cloud.config.name}/{spring.cloud.config.label}
for instance http://localhost:51000/config/kernel/env/master
.
Commons
repo consists of two types of project- REST services and libraries.
Every REST service consist of bootstrap.properties
file in src/main/resources
.
Below properties needed to be modified in order to connect to the config server:
Services can be run using Run As -> Spring Boot App/Java Application
.
Libraries are not meant to be run alone they are projects used by commons as well as other modules of mosip to perform commons operations.
For API documentation, refer here.
The API's can be tried with the help of Swagger-UI and Postman.
Swagger-UI of services can be accessed from (https/http)://(<domain>/<host>:<port>)/<context-path>/swagger-ui/index.html?configUrl=<contect-path>/v3/api-docs/swagger-config
for instance https://dev.mosip.net/v1/authmanager/swagger-ui/index.html?configUrl=/v1/authmanager/v3/api-docs/swagger-config
.
Context-path of services is present in bootstrap.properties
file in src/main/resources
of every service.
The API's can be tried using Postman. URLs and Body structures can be found in Swagger or curl command can be copied and imported in Postman.
As the name suggests, Commons refers to all the common services (also called "kernel") that are used by other modules of MOSIP. The Kernel services are listed below:
Refer API Documentation.
To know more about the developer setups, read:
Audit Manager module provides audit-related functionalities.
Below is a list of tools required for auditing:
JDK 11
Any IDE (like Eclipse, IntelliJ IDEA)
Apache Maven (zip folder)
PostgreSQL
Any DB client (like DBeaver, pgAdmin)
Postman (any HTTP Client)
Git
Any Editor (like Vscode, Notepad++ etc optional)
lombok.jar (jar file)
settings.xml (document)
1. Download lombok.jar and settings.xml.
2. Unzip Apache Maven and move settings.xml
to the "conf" folder <apache maven unzip path>\conf
.
4. Check the Eclipse installation folder to see if the lombok.jar
is added.
5. Configure the JDK (Standard VM) with your Eclipse by traversing through Preferences → Java → Installed JREs
.
For the code setup, clone the repository and follow the guidelines mentioned in the Code Contributions.
Open the project folder where pom.xml
is present.
Open the command prompt from the same folder.
Run the command mvn clean install -Dgpg.skip=true -DskipTests=true
to build the project.
After building, open Eclipse and select Import Projects → Maven → Existing Maven Projects → Next → Browse to project directory → Finish
.
After successfully importing of project, update the project by right-clicking on Project → Maven → Update Project
.
1. Download Auth adapter and add to project Libraries → Classpath → Add External JARs → Select Downloaded JAR → Add → Apply and Close
.
2. Clone mosip-config repository.
3. Refer Audit-DB-deploy to deploy local DB.
4. The audit uses two property files, kernel-default
and application-default
. Please configure them as needed. For instance,
Update the mosip.kernel.auditmanager-service-logs-location
property to update the location of log files.
Secrets can be encrypted using config server.
Update URL's in property files.(It can be either pointed to any remotely or locally deployed services)
5. Download kernel-config-server.jar. For Windows, download config-server-start.bat, linux users can run
java -jar -Dspring.profiles.active=native -Dspring.cloud.config.server.native.search-locations=file:{mosip-config-mt_folder_path}/config -Dspring.cloud.config.server.accept-empty=true -Dspring.cloud.config.server.git.force-pull=false -Dspring.cloud.config.server.git.cloneOnStart=false -Dspring.cloud.config.server.git.refreshRate=0 {jarName}
.
6. Run the server by opening the config-server-start.bat
file.
7. To verify the config-server, hit the below URL:
http://localhost:51000/config/{spring.profiles.active}/{spring.cloud.config.name}/{spring.cloud.config.label}
for instance http://localhost:51000/config/kernel/env/master
.
Audit REST service consist of bootstrap.properties
file in src/main/resources
.
Below properties needed to be modified in order to connect to the config server:
Services can be run using Run As -> Spring Boot App/Java Application
.
For API documentation, refer here.
The API's can be tried with the help of Swagger-UI and Postman.
Swagger-UI of service can be accessed from (https/http)://(<domain>/<host>:<port>)/<context-path>/swagger-ui/index.html?configUrl=<contect-path>/v3/api-docs/swagger-config
for instance https://dev2.mosip.net/v1/auditmanager/swagger-ui/index.html?configUrl=/v1/auditmanager/v3/api-docs/swagger-config
.
The API's can be tried using postman by copying CURL command below, updating host and importing in Postman.
OpenID-Bridge module provides AutnN and AuthZ related funtionalities.
Below is a list of tools required in OpenID Bridge:
JDK 11
Any IDE (like Eclipse, IntelliJ IDEA)
Apache Maven (zip folder)
PostgreSQL
Any DB client (like DBeaver, pgAdmin)
Postman (any HTTP Client)
Git
Any Editor (like Vscode, Notepad++ etc optional)
lombok.jar (jar file)
settings.xml (document)
Download lombok.jar and settings.xml.
Unzip Apache Maven and move settings.xml
to "conf" folder <apache maven unzip path>\conf
.
Install Eclipse, open the lombok.jar
file and then click Install/Update
.
Check the Eclipse installation folder to see if the lombok.jar
is added.
Configure the JDK (Standard VM) with your Eclipse by traversing through Preferences → Java → Installed JREs
.
For the code setup, clone the repository and follow the guidelines mentioned in the Code Contributions.
Open the project folder where pom.xml
is present.
Open the command prompt from the same folder.
Run the command mvn clean install -Dgpg.skip=true -DskipTests=true
to build the project .
After building, 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
.
1. Clone mosip-config repository.
2. OpenID Bridge uses two property files, kernel-default
and application-default
, configure them accordingly. For instance,
OpenID bridge connects to an IAM which supports Openid and Oauth. For integration with our keycloak, Please reach out to our team.
Update mosip.iam.open-id-url
property to update iam url.
Secrets can be encrypted using config server
Update Url's in property files.(It can be either pointed to any remotely or locally deployed services)
3. Download kernel-config-server.jar. For Windows, download config-server-start.bat, Linux users can run
java -jar -Dspring.profiles.active=native -Dspring.cloud.config.server.native.search-locations=file:{mosip-config-mt_folder_path}/config -Dspring.cloud.config.server.accept-empty=true -Dspring.cloud.config.server.git.force-pull=false -Dspring.cloud.config.server.git.cloneOnStart=false -Dspring.cloud.config.server.git.refreshRate=0 {jarName}
.
5. To verify the config-server, hit the below URL: http://localhost:51000/config/{spring.profiles.active}/{spring.cloud.config.name}/{spring.cloud.config.label}
for instance http://localhost:51000/config/kernel/env/master
Audit REST service consists of bootstrap.properties
file in src/main/resources
.
Below properties needed to be modified in order to connect to the config server:
Services can be run using Run As -> Spring Boot App/Java Application
.
For API documentation, refer here.
The API's can be tried with the help of Swagger-UI and Postman.
Swagger-UI service can be accessed from (https/http)://(<domain>/<host>:<port>)/<context-path>/swagger-ui/index.html?configUrl=<contect-path>/v3/api-docs/swagger-config
for instance https://dev2.mosip.net/v1/auditmanager/swagger-ui/index.html?configUrl=/v1/auditmanager/v3/api-docs/swagger-config
.
The API's can be tried using postman. URLs and Body structures can be found in Swagger or curl command can be copied and imported in Postman.
3. Install Eclipse, open the lombok.jar
file, and click Install/Update
.
4. Run the server by opening the config-server-start.bat
file.