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

Critical code review PR - Last sprint handover checklist of 0.10.0 release #84

Draft
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

vishwa-vyom
Copy link
Member

This PR is created just to add the review comments as part of the critical code review task of last sprint handover checklist for release of 0.10.0 version.

** THIS PR SHOULD NOT BE MERGED **

challabeehyv and others added 30 commits June 18, 2024 14:33
)

* [INJICERT-189] add mosip id plugin implementation module
Signed-off-by: Challarao <challarao@beehyv.com>

* Updated push-trigger.yml

Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>

* Update push-trigger.yml

Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>

* Update push-trigger.yml

Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>

* Update push-trigger.yml

Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>

* [INJICERT-189] add esignet dependency for redis cache share
Signed-off-by: Challarao <challarao@beehyv.com>

* [INJICERT-189] change package name and exclude esignet core transitive dependency
Signed-off-by: Challarao <challarao@beehyv.com>

* [INJICERT-189] add test dependencies and fix workflow issue
Signed-off-by: Challarao <challarao@beehyv.com>

---------

Signed-off-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>
Co-authored-by: Vishwa <visu.vs1@gmail.com>
Co-authored-by: Praful Rakhade <99539100+Prafulrakhade@users.noreply.github.com>
Co-authored-by: Chandra Keshav Mishra <chandrakeshavmishra@gmail.com>
Signed-off-by: Challarao <challarao@beehyv.com>
[INJICERT-189] make service classes as conditional beans
Signed-off-by: Challarao <challarao@beehyv.com>
[INJICERT-189] add esignet integration api dependency
Signed-off-by: Challa Rao <challarao@beehyv.com>
[MOSIP-33939] change esignet dependency versions for mosip ida plugin
* [INJICERT-186] add mock identity plugin
Signed-off-by: Challarao <challarao@beehyv.com>

* [INJICERT-186] mock identity system call for getting details
Signed-off-by: Challarao <challarao@beehyv.com>

* [INJICERT-186] add license
Signed-off-by: Challarao <challarao@beehyv.com>

* [INJICERT-186] add test cases
Signed-off-by: Challarao <challarao@beehyv.com>
Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com>
[DSD-5591] Updated push-trigger.yml
Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com>
Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com>
Signed-off-by: abhishek8shankar <127825992+abhishek8shankar@users.noreply.github.com>
[DSD-5591] Updated push-trigger.yml
* [DSD-5591] add plugin
Signed-off-by: Challarao <challarao@beehyv.com>

* [DSD-5591] change the artifact id and folder name
Signed-off-by: Challarao <challarao@beehyv.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
[INJICERT-444] merge release 0.2.x changes to develop
* [INJIMOB-1588] add mock mdoc

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] Get issuer certificate + keypair from local p12 file

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] Populate mock mDoc from DB

Build mdoc from mock DB using the cached transaction and in case of any issue give hardcoded set of data

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1788] generate mdoc

Library used - open-wallet-foundation-labs/identity-credetial

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] produce mso_mdoc VC from individualId provided

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] read crypto details for signing mso_mdoc vc

Other changes: removing unused classes/ debug logs

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] remove debug logs , optimize imports

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] remove unused declared dependencies

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] add respository for identity-credential dependency

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] remove debug logs

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] refactor unused fields, renaming

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] git ignore .DS_Store

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] perform base64 url safe encoding

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] refactor variable name

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] Get issuer and ca cryto details from config property

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] revert IDE format changes

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] fix merge conflict issue

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] remove unused repo declaration

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* [INJIMOB-1588] revert remove unused plugin

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-1588] extract data generation for mdoc to a separate function

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
* [INJICERT-434] Added mock data provider plugin for data model 2.0

Signed-off-by: piyush-shukla03_infosys <piyush.shukla03@infosys.com>

* Added test cases for mock data provider plugin

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Changed name of plugin to mock-ida-dataprovider-plugin

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Removed issuer from mock data response json

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

---------

Signed-off-by: piyush-shukla03_infosys <piyush.shukla03@infosys.com>
Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Co-authored-by: piyush-shukla03_infosys <piyush.shukla03@infosys.com>
…#74)

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
* [INJIMOB-1862] replace hardcoded dates with realtime date in mdoc generation

other changes:
modify issuing country for vc verification check

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-1862] fix to have same doctype in document & MSO

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-1862] modify issue and expiry date to have full date format

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-2160] add UUID as id to mdoc data

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-2160] add test for mdoc generator

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJICERT-533] use random uuid for mock VCs

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-1862] remove printing UUID

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJIMOB-1862] extract constant for fullDate formatter

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
* [INJICERT-587] add CSV plugin implementation

* add unit tests for csv data plugin
* add invalid id unit test

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* [INJICERT-587] remove unsued dependencies

Signed-off-by: Harsh Vardhan <piyushshukla2100@gmail.com>

* [INJICERT-587] load CSV to memory at start

Other minor changes:
* add support for loading CSV from classpath, filepath & a URL(spring
  config-server)
* add CI

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

* [INJICERT-587] set the id field for the credential via config

Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Harsh Vardhan <piyushshukla2100@gmail.com>
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
Co-authored-by: Piyush7034 <piyushshukla2100@gmail.com>
* [INJICERT-587] Fixed file access through classpath
Upgraded version for mockito-core from 3.6.3 to 5.7.0

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Upgraded mockito-core version from 5.7.0 to 5.11.0 due to security vulnerability

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Update mock-csv-dataprovider-plugin/src/main/java/io/mosip/certify/mockcsvdataprovider/integration/service/DataProviderService.java

Co-authored-by: Harsh Vardhan <harsh59v@gmail.com>
Signed-off-by: Hitesh Jain <jainhitesh9998@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Hitesh Jain <jainhitesh9998@gmail.com>
Co-authored-by: Hitesh Jain <jainhitesh9998@gmail.com>
Co-authored-by: Harsh Vardhan <harsh59v@gmail.com>
* [INJICERT-587] Fixed file access through classpath
Upgraded version for mockito-core from 3.6.3 to 5.7.0

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Upgraded mockito-core version from 5.7.0 to 5.11.0 due to security vulnerability

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* [INJICERT-587] Merged mock-csv-dataprovider into mock-certify-plugin

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Removed build flows for deleted mock csv plugin project

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
* Added postgres data provider plugin

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Simplified plugin implementation with property config

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Added postgres plugin in github workflows

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Removed id field and @value split for table fields

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Added scope query mapping for generating different vcs with different scopes

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Changed mock-postgres-plugin name to postgres-plugin

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Removed unused repo from dependencies

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Replaced object[] with map for query resullt

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
.github/workflows/push-trigger.yml Show resolved Hide resolved
mock-ida-dataprovider-plugin/pom.xml Outdated Show resolved Hide resolved
data.put("document_number", documentNumber);
data.put("driving_privileges",new HashMap<>(){{
put("vehicle_category_code","A");
}});
Copy link
Member Author

@vishwa-vyom vishwa-vyom Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a consistency issue, the LD VC generator from this class will create a VC with data from mock identity system, but this has hardcoded data. I accept this is a mock, but if we create a new vciplugin class with mdoc impl, we might be little better.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @vishwa-vyom
Are we suggesting like MdocVCIPlugin class which will encapsulate both the data and generation logic?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets create a new Plugin as MDocMockVCIPlugin.java and move all the code to this class

Copy link

@KiruthikaJeyashankar KiruthikaJeyashankar Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is MDocMockVCIPlugin also expected to implement VCIssuancePlugin and when mdoc is required config will be updated to point to the MdocVCIPlugin?
If this change is coming we will not be able to issue both ldp_vc as well as mdoc from same plugin, is this expected here? Asking since previously we were having mock-certify-plugin issuing both mdocs and ldp_vc format VCs

import java.util.*


class MdocGenerator {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this in kotlin code, not possible to keep this also in java ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KiruthikaJeyashankar please check this suggestion

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now tried modifying to Java code and unit tests are passing. This can be modified to Java to maintain consistency

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, so then we can remove current file changes and do all the restructuring as part of Inji mobile release or we are good to include in the current Inji certify release ?

…se and last sprint handover review comments (#85)

* [INJICERT-657] Removed mock-ida-dataprovider-plugin project as it is not a part of 0.10.0 certify release

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Added code review changes for release

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
if (csvRegistryURI.startsWith("http")) {
// download the file to a path: usecase(docker, spring cloud config)
filePath = restTemplate.execute(csvRegistryURI, HttpMethod.GET, null, resp -> {
File ret = File.createTempFile("download", "tmp");

Check warning

Code scanning / CodeQL

Local information disclosure in a temporary directory Medium

Local information disclosure vulnerability due to use of file readable by other local users.
Piyush7034 and others added 6 commits December 17, 2024 12:15
Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
[INJICERT-657] Removed mdoc and mdl related code
Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
* [INJICERT-695] add Mock mdoc VCI plugin

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJICERT-695] extract constant for VCFormat

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJICERT-695] modify property name of mdoc issuer key certificate
mosip.certify.mock.vciplugin.issuer.key-cert changed to mosip.certify.mock.vciplugin.mdoc.issuer-key-cert

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

* [INJICERT-695] refactor - rename class

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>

---------

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
In case of IndividualId not stored, documentNumber value becomes null and mdoc generated will have the documentNumber field as empty

Signed-off-by: KiruthikaJeyashankar <kiruthikavjshankar@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
* [INJICERT-499] Added postgres plugin config docs

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Review comment changes

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

* Changed reference links for db_scripts and context schema

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>

---------

Signed-off-by: Piyush7034 <piyushshukla2100@gmail.com>
Signed-off-by: Vishwa <visu.vs1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants