From 3d6f63ab9eb16106777c51783eb0621386130de9 Mon Sep 17 00:00:00 2001 From: Harsh Date: Tue, 17 Dec 2024 22:02:18 +0530 Subject: [PATCH] merge conflicts resolved [INJICERT-657] use local CSV file for docker compose demo Signed-off-by: Harsh --- .../docker-compose-injistack/certify_init.sql | 81 ++++++++----------- .../config/certify-csvdp-farmer.properties | 5 +- .../docker-compose.yaml | 9 ++- 3 files changed, 41 insertions(+), 54 deletions(-) diff --git a/docker-compose/docker-compose-injistack/certify_init.sql b/docker-compose/docker-compose-injistack/certify_init.sql index 036ba542..59230463 100644 --- a/docker-compose/docker-compose-injistack/certify_init.sql +++ b/docker-compose/docker-compose-injistack/certify_init.sql @@ -81,57 +81,13 @@ CREATE TABLE certify.credential_template( CONSTRAINT pk_template PRIMARY KEY (context, credential_type) ); -INSERT INTO certify.credential_template (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://vharsh.github.io/DID/mock-context.json,https://www.w3.org/2018/credentials/v1', 'MockVerifiableCredential,VerifiableCredential', '{ - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://vharsh.github.io/DID/mock-context.json"], - "issuer": "${issuer}", - "type": ["VerifiableCredential", "MockVerifiableCredential"], - "issuanceDate": "${validFrom}", - "expirationDate": "${validUntil}", - "credentialSubject": { - "gender": ${gender}, - "postalCode": ${postalCode}, - "fullName": ${fullName}, - "dateOfBirth": "${dateOfBirth}", - "province": ${province}, - "phone": "${phone}", - "addressLine1": ${addressLine1}, - "region": ${region}, - "vcVer": "${vcVer}", - "UIN": ${UIN}, - "email": "${email}", - "face": "${face}" - } -}', '2024-10-22 17:08:17.826851', NULL); -INSERT INTO certify.credential_template (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://vharsh.github.io/DID/mock-context.json,https://www.w3.org/ns/credentials/v2', 'MockVerifiableCredential,VerifiableCredential', '{ - "@context": [ - "https://www.w3.org/ns/credentials/v2", "https://vharsh.github.io/DID/mock-context.json"], - "issuer": "${issuer}", - "type": ["VerifiableCredential", "MockVerifiableCredential"], - "validFrom": "${validFrom}", - "validUntil": "${validUntil}", - "credentialSubject": { - "gender": ${gender}, - "postalCode": ${postalCode}, - "fullName": ${fullName}, - "dateOfBirth": "${dateOfBirth}", - "province": ${province}, - "phone": "${phone}", - "addressLine1": ${addressLine1}, - "region": ${region}, - "vcVer": "${vcVer}", - "UIN": ${UIN}, - "email": "${email}", - "face": "${face}" - } -}', '2024-10-22 17:08:17.826851', NULL); INSERT INTO certify.credential_template (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://www.w3.org/2018/credentials/v1', 'FarmerCredential,VerifiableCredential', '{ "@context": [ "https://www.w3.org/2018/credentials/v1", - "https://piyush7034.github.io/my-files/farmer.json" + "https://piyush7034.github.io/my-files/farmer.json", + "https://w3id.org/security/suites/ed25519-2020/v1" ], - "issuer": "${issuer}", + "issuer": "${_issuer}", "type": [ "VerifiableCredential", "FarmerCredential" @@ -157,6 +113,37 @@ INSERT INTO certify.credential_template (context, credential_type, template, cr_ } ', '2024-10-24 12:32:38.065994', NULL); +INSERT INTO certify.template_data (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://www.w3.org/ns/credentials/v2', 'FarmerCredential,VerifiableCredential', '{ + "@context": [ + "https://www.w3.org/ns/credentials/v2", + "https://vharsh.github.io/DID/farmer.json", + "https://w3id.org/security/suites/ed25519-2020/v1" + ], + "issuer": "${_issuer}", + "type": [ + "VerifiableCredential", + "FarmerCredential" + ], + "validFrom": "${validFrom}", + "validUntil": "${validUntil}", + "credentialSubject": { + "name": "${name}", + "dateOfBirth": "${dateOfBirth}", + "highestEducation": "${highestEducation}", + "maritalStatus": "${maritalStatus}", + "typeOfHouse": "${typeOfHouse}", + "numberOfDependents": "${numberOfDependents}", + "phoneNumber": "${phoneNumber}", + "works": "${works}", + "landArea": "${landArea}", + "landOwnershipType": "${landOwnershipType}", + "primaryCropType": "${primaryCropType}", + "secondaryCropType": "${secondaryCropType}", + "face": "${face}", + "farmerID": "${farmerID}" + } +} +', '2024-10-24 12:32:38.065994', NULL); INSERT INTO certify.key_policy_def(APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) VALUES('ROOT', 2920, 1125, 'NA', true, 'mosipadmin', now()); INSERT INTO certify.key_policy_def(APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) VALUES('CERTIFY_SERVICE', 1095, 60, 'NA', true, 'mosipadmin', now()); diff --git a/docker-compose/docker-compose-injistack/config/certify-csvdp-farmer.properties b/docker-compose/docker-compose-injistack/config/certify-csvdp-farmer.properties index b7097d53..bf524272 100644 --- a/docker-compose/docker-compose-injistack/config/certify-csvdp-farmer.properties +++ b/docker-compose/docker-compose-injistack/config/certify-csvdp-farmer.properties @@ -9,7 +9,6 @@ mosip.certify.mock.authenticator.get-identity-url=http://mock-identity-system:80 mosip.certify.cache.security.algorithm-name=AES/ECB/PKCS5Padding mosip.certify.cache.secure.individual-id=false mosip.certify.cache.store.individual-id=true -mosip.certify.rendering-templates=insurance-svg-template.json mosip.certify.identifier=http://localhost:8090 mosip.certify.data-provider-plugin.issuer-uri=did:web:vharsh.github.io:DID:harsh @@ -22,7 +21,7 @@ mosip.certify.data-provider-plugin.issuer.vc-sign-algo=Ed25519Signature2020 ## CSV specific config mosip.certify.mock.data-provider.csv.identifier-column=id mosip.certify.mock.data-provider.csv.data-columns=id,fullName,mobileNumber,dateOfBirth,gender,state,district,villageOrTown,postalCode,landArea,landOwnershipType,primaryCropType,secondaryCropType,face,farmerID -mosip.certify.mock.data-provider.csv-registry-uri=https://raw.githubusercontent.com/mosip/inji-config/refs/heads/develop/farmer_registry.csv +mosip.certify.mock.data-provider.csv-registry-uri=/home/mosip/config/farmer_identity_data.csv mosip.certify.data-provider-plugin.rendering-template-id= mosip.certify.key-values={\ 'vd12' : {\ @@ -97,4 +96,4 @@ mosip.certify.key-values={\ 'background_image': { 'uri': 'https://sunbird.org/images/sunbird-logo-new.png' }, \ 'text_color': '#7C4616'}},\ 'order' : {'farmerID','fullName','mobileNumber','dateOfBirth','gender','state','district','villageOrTown','postalCode','landArea','landOwnershipType','primaryCropType','secondaryCropType'}\ - }}}} \ No newline at end of file + }}}} diff --git a/docker-compose/docker-compose-injistack/docker-compose.yaml b/docker-compose/docker-compose-injistack/docker-compose.yaml index 92575af0..d8ff46d0 100644 --- a/docker-compose/docker-compose-injistack/docker-compose.yaml +++ b/docker-compose/docker-compose-injistack/docker-compose.yaml @@ -14,7 +14,7 @@ services: - "5433:5432" certify: - image: mosipdev/inji-certify:develop + image: mosipqa/inji-certify:release-0.10.x user: root ports: - 8090:8090 @@ -30,6 +30,8 @@ services: - ./config/certify-csvdp-farmer.properties:/home/mosip/config/certify-csvdp-farmer.properties - ./data/CERTIFY_PKCS12:/home/mosip/CERTIFY_PKCS12 - ./loader_path/certify/:/home/mosip/additional_jars/ + # modify the below file to change the identity fields in the VC + - ./config/farmer_identity_data.csv:/home/mosip/config/farmer_identity_data.csv networks: - network depends_on: @@ -39,7 +41,7 @@ services: container_name: nginx image: nginx:alpine ports: - - '8080:80' + - '80:80' volumes: - ./config/mimoto-issuers-config.json:/config/server/mimoto-issuers-config.json - ./config/mimoto-trusted-verifiers.json:/config/server/mimoto-trusted-verifiers.json @@ -49,10 +51,9 @@ services: - mimoto-service networks: - network - mimoto-service: container_name: 'Mimoto-Service' - image: 'mosipid/mimoto:0.14.0' + image: mosipid/mimoto:0.14.0 user: root ports: - '8099:8099'