Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated License and linked to docs #74

Open
wants to merge 41 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
14d1bd4
Created 1.2.0-rc2 (#23)
MonobikashDas Aug 31, 2021
466dc34
MOSIP-15420: Upgraded swagger2.0 to openapi3.0 for packet manager ser…
kameshsr Oct 29, 2021
f59d453
Added logger and fixed test cases (#32)
MonobikashDas Nov 3, 2021
1e5a04d
MOSIP-15420: Generated openapi.json for packet manager service (#34)
kameshsr Nov 12, 2021
d89828b
MOSIP-18453 : improved usage of caching (#36)
MonobikashDas Dec 6, 2021
dff1aa2
Added sonar_analysis
Rakshitha650 Dec 10, 2021
38b4b93
Merge pull request #38 from Rakshitha650/patch-1
mandeepdhiman123 Dec 13, 2021
4b1da36
MOSIP-18450 : added exception for objects not available in minio (#37)
MonobikashDas Dec 30, 2021
ce361ff
Mosip:15286 Changed openapi.json name.
kameshsr Jan 5, 2022
7bd0f33
updated the Sonar_analysis code and removed the Dskiptests
Rakshitha650 Jan 7, 2022
1a380a0
updated the Sonar_analysis code and removed the Dskiptests
Rakshitha650 Jan 7, 2022
29ee19e
added gpg keys
Rakshitha650 Jan 10, 2022
61a1380
Merge pull request #44 from Rakshitha650/1.2.0-rc2
mandeepdhiman123 Jan 10, 2022
f35b07e
Merge pull request #43 from kameshsr/1.2.0-rc2
mandeepdhiman123 Jan 11, 2022
69c6882
changes for real bio
Jan 13, 2022
e84194b
Merged with 1.2.0-rc2
Jan 13, 2022
26baa99
Merge branch 'develop' into 1.2.0-rc2-real-bio
Jan 16, 2022
dabf23b
changes for real bio
Jan 16, 2022
7d1a7cc
Merge pull request #51 from MonobikashDas/1.2.0-rc2-real-bio
gsasikumar Jan 17, 2022
f131608
Auth role issue fixed (#46)
MonobikashDas Jan 19, 2022
0334a73
MOR-147 : multithreading issue for create packet api (#52)
MonobikashDas Jan 19, 2022
17002dc
Merge pull request #54 from MonobikashDas/1.2.0-rc2
gsasikumar Jan 21, 2022
2cc5c9f
Added documentation
Jan 27, 2022
ac9ee61
Merge pull request #59 from MonobikashDas/documentation
pjoshi751 Jan 28, 2022
b4d3264
Update README.md
pjoshi751 Jan 28, 2022
452b828
Update README.md
pjoshi751 Jan 28, 2022
9131407
[MOSIP-19587] Cleanup.
Jan 28, 2022
558b09f
Update configuration.md
MonobikashDas Jan 28, 2022
831d951
Update configuration.md
pjoshi751 Jan 28, 2022
7cf9cbc
Update configuration.md
MonobikashDas Jan 28, 2022
4cfb61e
Updated readme and sonar fix
Feb 1, 2022
a0e9ae8
Update README.md
MonobikashDas Feb 1, 2022
e007591
Merge pull request #60 from MonobikashDas/1.2.0-rc2-final
pjoshi751 Feb 1, 2022
37e4e12
[MOSIP-19883] updated worflows
ckm007 Feb 3, 2022
db3139a
[MOSIP-19883] updated worflows
ckm007 Feb 3, 2022
612cb23
Update push_trigger.yml
ckm007 Feb 3, 2022
a83bd34
Updated Pom versions for release changes
ckm007 Feb 3, 2022
b4cd57f
Merge pull request #65 from mosip/release-branch
ckm007 Feb 3, 2022
058e77c
[MOSIP-19910] updated badges
ckm007 Feb 3, 2022
f5c7017
minor doc update
ckm007 Mar 14, 2022
f5b049d
updated License and linked to docs
SwatiPeriwal Mar 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/push_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
- master
- 1.*
- develop
- '!release-branch'
- release-1*

jobs:
build:
Expand Down Expand Up @@ -75,6 +77,7 @@ jobs:
if: failure() # Pick up events even if the job fails or is canceled.

publish_to_nexus:
if: "!contains(github.ref, 'master')"
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -125,7 +128,7 @@ jobs:
- name: Publish the maven package
run: |
cd commons-packet
mvn -B deploy -DaltDeploymentRepository=ossrh::default::${{ secrets.OSSRH_SNAPSHOT_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml
mvn -B deploy -DaltDeploymentRepository=ossrh::default::${{ secrets.RELEASE_URL }} -s $GITHUB_WORKSPACE/settings.xml -f pom.xml
env:
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}}
GPG_TTY: $(tty)
Expand Down Expand Up @@ -185,7 +188,11 @@ jobs:
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
echo "push version ${{steps.getPomVersion.outputs.info}}"
VERSION=$BRANCH_NAME
if [[ $BRANCH_NAME == master ]]; then
VERSION=latest
else
VERSION=$BRANCH_NAME
fi
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $SERVICE_NAME $IMAGE_ID:$VERSION
Expand All @@ -197,7 +204,7 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} # required
if: failure() # Pick up events even if the job fails or is canceled.

sonar_analysis:
runs-on: ubuntu-latest
steps:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release_changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release/pre-release Preparation.

on:
workflow_dispatch:
inputs:
message:
description: 'Triggered for release or pe-release'
required: false
default: 'Release Preparation'
releaseTags:
description: 'tag to update'
required: true
snapshotTags:
description: 'tag to be replaced'
required: true
base:
description: 'base branch for PR'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup branch and env
run: |
# Strip git ref prefix from version
echo "BRANCH_NAME=$(echo ${{ github.ref }} | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_ENV
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV

- name: Mannualy changing the pom versions
run: find . -type f -name "*pom.xml" -print0 | xargs -0 sed -i "s/${{ github.event.inputs.snapshotTags }}/${{ github.event.inputs.releaseTags }}/g"

- name: Updating the Release URL in POM
run: |
cd .github/workflows
sed -i 's/OSSRH_SNAPSHOT_URL/RELEASE_URL/g' push_trigger.yml

- name: Updating libs-snapshot-local to libs-release local for artifactory URL's.
run: find . -type f -name "*Dockerfile" -print0 | xargs -0 sed -i "s/libs-snapshot-local/libs-release-local/g"

- name: removing -DskipTests
run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-DskipTests"//g"

# - name: removing --Dgpg.skip
# run: find . -type f -name "*push_trigger.yml" -print0 | xargs -0 sed -i "s/"-Dgpg.skip"//g"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.ACTION_PAT }}
commit-message: Updated Pom versions for release changes
title: Release changes
body: Automated PR for ${{ github.event.inputs.releaseTags }} release.
branch: release-branch
delete-branch: true
base: ${{ github.event.inputs.base }}
67 changes: 8 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,13 @@
[![Build Status](https://travis-ci.com/mosip/commons.svg?branch=master)](https://travis-ci.com/mosip/commons)
[![Maven Package upon a push](https://github.com/mosip/packet-manager/actions/workflows/push_trigger.yml/badge.svg?branch=master)](https://github.com/mosip/packet-manager/actions/workflows/push_trigger.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=master&project=mosip_packet-manager&id=mosip_packet-manager2&metric=alert_status)](https://sonarcloud.io/dashboard?branch=master&id=mosip_packet-manager)

[![Join the chat at https://gitter.im/mosip-community/Commons-Kernel](https://badges.gitter.im/mosip-community/Commons-Kernel.svg)](https://gitter.im/mosip-community/Commons-Kernel?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# mosip-platform
This repository contains the source code of the Modular Open Source Identity Platform. To know more about MOSIP, its architecture, external integrations, releases, etc., please check the [Platform Documentation](https://github.com/mosip/mosip-docs/wiki)
# Packet Manager

### Introduction
MOSIP consists of the following modules -
1. `Kernel` - The Kernel module provides a bedrock to build and run services by providing several significant necessary technical functions. It contains common functionalities which are used by more than one module.
2. `Pre-Registration` - Pre-Registration module enables individuals to book appointments in a registration centre, by providing basic demographic details.
3. `Registration` - Registration module provides a desktop application for Registration Officers/Supervisors to register an individual in MOSIP, by capturing their demographic and biometric details.
4. `Registration Processor` - Registration Processor validates and processes an individual's data received from the registration module, and eventually generates a UIN (Unique Identification Number) for the individual.
5. `ID Repository` - The ID Repository module acts as a repository of individual's data along with UIN mapped.
6. `ID Authentication` - ID Authentication module enables a Partner to authenticate an individual.
## Overview
* It is used by `Registration Client` and `Resident Service` to create packets.
* It is used by `Registration Processor` to read packets.

### Build
The following commands should be run in the parent project to build all the modules -
`mvn clean install`
The above command can be used to build individual modules when run in their respective folders

### Deploy
The following command should be executed to run any service locally in specific profile and local configurations -
`java -Dspring.profiles.active=<profile> -jar <jar-name>.jar`

The following command should be executed to run any service locally in specific profile and `remote` configurations -
`java -Dspring.profiles.active=<profile> -Dspring.cloud.config.uri=<config-url> -Dspring.cloud.config.label=<config-label> -jar <jar-name>.jar`

The following command should be executed to run a docker image -
`docker run -it -p <host-port>:<container-port> -e active_profile_env={profile} -e spring_config_label_env= {branch} -e spring_config_url_env={config_server_url} <docker-registry-IP:docker-registry-port/<dcker-image>`

#### Run as Developer
For running services in a native environment developer has to run some core components
[Instruction to follow for running core components](./StartKernelCoreComponents_instructions.md)
### Configurations
All the configurations used by the codebase in `mosip-platform` is present in [mosip-config](https://github.com/mosip/mosip-config) repository.

### Functional Test-cases
Functional tests run against the codebase in `mosip-platform` is present in [mosip-functional-tests](https://github.com/mosip/mosip-functional-tests) repository.

### Documentation
Relevant documents to get started with MOSIP can be found in [mosip-docs](https://github.com/mosip/mosip-docs) repository.
In order to get started, please refer to the [Getting-Started](https://github.com/mosip/mosip-docs/wiki/Getting-Started) guide.

### Infra
Automated scripts to build and deploy MOSIP modules are present in [mosip-infra](https://github.com/mosip/mosip-infra) repository.


---

### Contribute
You can contribute to MOSIP!

We want to engage constructively with the community. If you find a **vulnerability** or issue, please file a bug with the respective repository. We welcome pull requests with fixes too. Please see the [Contributor Guide](https://github.com/mosip/mosip-docs/wiki/Contributor-Guide) on how to file bugs, contribute code, and more.

### License
This project is licensed under the terms of [Mozilla Public License 2.0](https://github.com/mosip/mosip-platform/blob/master/LICENSE)

### Communication
Join the [developer mailing list](https://groups.io/g/mosip-dev)

## Comprehensive review
During comprehensive review, inline documentation of kernel will be changed. Look for Jira issue MOS-31009
To know more, see [Packet Manager](https://docs.mosip.io/1.2.0/modules/packet-manager).

## License
This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE).
5 changes: 5 additions & 0 deletions commons-packet/commons-packet-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Commons Packet Manager

# About
* This is used as a jar dependency by regclient and resident service to create packet.
* This is also used by [commons-packet-service](../commons-packet-service) to read and write packet into object store.
24 changes: 12 additions & 12 deletions commons-packet/commons-packet-manager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>commons-packet-manager</name>
<description>Mosip commons project </description>
<url>https://github.com/mosip/commons</url>
<version>1.2.0-SNAPSHOT</version>
<version>1.2.0</version>
<properties>
<!-- maven -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -30,23 +30,23 @@
<spring-cloud-config.version>2.0.0.RELEASE</spring-cloud-config.version>
<h2.version>1.4.197</h2.version>
<jackson.datatype.version>2.9.8</jackson.datatype.version>
<kernel.keygenerator.bouncycastle.version>1.2.0-SNAPSHOT</kernel.keygenerator.bouncycastle.version>
<kernel.keygenerator.bouncycastle.version>1.2.0</kernel.keygenerator.bouncycastle.version>
<swagger.version>2.9.2</swagger.version>
<powermock.beta.version>2.0.7</powermock.beta.version>
<junit.version>4.13.1</junit.version>
<hazelcast.kubernetes.version>1.3.1</hazelcast.kubernetes.version>

<kernel-keymanager-service.version>1.2.0-SNAPSHOT</kernel-keymanager-service.version>
<kernel-idobjectvalidator.version>1.2.0-SNAPSHOT</kernel-idobjectvalidator.version>
<kernel.core.version>1.2.0-SNAPSHOT</kernel.core.version>
<kernel.biometrics.api.version>1.2.0-SNAPSHOT</kernel.biometrics.api.version>
<kernel.cbeffutil.api.version>1.2.0-SNAPSHOT</kernel.cbeffutil.api.version>
<kernel.crypto-jce.version>1.2.0-SNAPSHOT</kernel.crypto-jce.version>
<kernel.auth.adaptor.version>1.2.0-SNAPSHOT</kernel.auth.adaptor.version>
<kernel-dataaccess-hibernate.version>1.2.0-SNAPSHOT</kernel-dataaccess-hibernate.version>
<kernel.logger.logback.version>1.2.0-SNAPSHOT</kernel.logger.logback.version>
<kernel-keymanager-service.version>1.2.0</kernel-keymanager-service.version>
<kernel-idobjectvalidator.version>1.2.0</kernel-idobjectvalidator.version>
<kernel.core.version>1.2.0</kernel.core.version>
<kernel.biometrics.api.version>1.2.0</kernel.biometrics.api.version>
<kernel.cbeffutil.api.version>1.2.0</kernel.cbeffutil.api.version>
<kernel.crypto-jce.version>1.2.0</kernel.crypto-jce.version>
<kernel.auth.adaptor.version>1.2.0</kernel.auth.adaptor.version>
<kernel-dataaccess-hibernate.version>1.2.0</kernel-dataaccess-hibernate.version>
<kernel.logger.logback.version>1.2.0</kernel.logger.logback.version>
<spring.boot.co>2.0.2.RELEASE</spring.boot.co>
<khazana.version>1.2.0-SNAPSHOT</khazana.version>
<khazana.version>1.2.0</khazana.version>
<sonar.coverage.exclusions>**/constants/**,**/config/**,**/audit/**,**/util/**,**/dto/**,**/entity/**,**/model/**,**/exception/**,**/repository/**,**/security/**,**/*Config.java,**/*BootApplication.java,**/*VertxApplication.java,**/cbeffutil/**,**/*Utils.java,**/*Validator.java,**/*Helper.java,**/verticle/**,**/VidWriter.java/**,**/masterdata/utils/**,**/spi/**,**/core/http/**,"**/LocationServiceImpl.java","**/RegistrationCenterMachineServiceImpl.java","**/RegistrationCenterServiceImpl.java","**/pridgenerator/**","**/idgenerator/prid","**/proxy/**","**/cryptosignature/**"</sonar.coverage.exclusions>
<sonar.cpd.exclusions>**/dto/**,**/entity/**,**/config/**</sonar.cpd.exclusions>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class AuditLogEntry {

@Autowired
@Lazy
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;

@Autowired
Expand Down Expand Up @@ -91,7 +92,7 @@ public String addAudit(String description, String eventId,
id,
"AuditLogRequestBuilder:: AuditLogEntry::exit");

return responseWrapper.getBody();
return responseWrapper != null ? responseWrapper.getBody() : null;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public enum PacketUtilityErrorCodes {
TAG_NOT_FOUND("KER-PUT-024", "Requested tag not present"),
SOURCE_NOT_PRESENT("KER-PUT-025", "Invalid source or process."),
DELETE_TAGGING_FAILED("KER-PUT-026", "Failed to delete tags."),
OBJECT_DOESNOT_EXISTS("KER-PUT-027", "Object doesnot exists."),;
OBJECT_DOESNOT_EXISTS("KER-PUT-027", "Object doesnot exists."),
UNKNOWN_EXCEPTION("KER-PUT-028", "Unknown Exception.");



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.commons.packet.dto.Document;
import io.mosip.commons.packet.util.PacketManagerLogger;
import io.mosip.kernel.biometrics.entities.BiometricRecord;
import io.mosip.kernel.core.exception.ExceptionUtils;
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.DateUtils;
import lombok.Data;
import org.json.JSONArray;
Expand All @@ -18,6 +21,8 @@

@Data
public class RegistrationPacket {

private static final Logger LOGGER = PacketManagerLogger.getLogger(RegistrationPacket.class);

private String registrationId;
private double idSchemaVersion;
Expand Down Expand Up @@ -97,7 +102,7 @@ else if (json instanceof JSONArray) {
} else
finalMap.putIfAbsent(fieldName, value);
} catch (Exception e) {
e.printStackTrace();
LOGGER.error("Exception while setting field " + ExceptionUtils.getStackTrace(e));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ public List<PacketInfo> createPacket(PacketDto packetDto) {
LOGGER.info(PacketManagerLogger.SESSIONID, PacketManagerLogger.REGISTRATIONID, packetDto.getId(),
ExceptionUtils.getStackTrace(e));
LOGGER.error(PacketManagerLogger.SESSIONID, PacketManagerLogger.REGISTRATIONID, packetDto.getId(), ExceptionUtils.getStackTrace(e));
} finally {
// remove object from registration packet hashmap
provider.removePacket(packetDto.getId());
}
return packetInfos;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class OnlinePacketCryptoServiceImpl implements IPacketCryptoService {
private boolean isPrependThumbprintEnabled;

@Autowired
@Qualifier("selfTokenRestTemplate")
private RestTemplate restTemplate;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ public BiometricRecord getBiometric(String id, String biometricFieldName, List<S
BIR bir = CbeffValidator.getBIRFromXML(IOUtils.toByteArray(biometrics));
biometricRecord = new BiometricRecord();
if(bir.getOthers() != null) {
Map<String, String> others = new HashMap<>();
bir.getOthers().forEach(e -> {
HashMap<String, String> others = new HashMap<>();
bir.getOthers().entrySet().forEach(e -> {
others.put(e.getKey(), e.getValue());
});
biometricRecord.setOthers(others);
Expand Down
Loading