Skip to content

Commit

Permalink
[INJICERT-567]
Browse files Browse the repository at this point in the history
added local mock-csv setup for certify

Signed-off-by: Hitesh C <[email protected]>
  • Loading branch information
jainhitesh9998 committed Nov 15, 2024
1 parent 50aa0c3 commit feaec21
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 40 deletions.
64 changes: 32 additions & 32 deletions docker-compose/docker-compose-newplugin/certify_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -240,41 +240,41 @@ INSERT INTO certify.template_data (context, credential_type, template, cr_dtimes
"face": "${face}"
}
}', '2024-10-22 17:08:17.826851', NULL);
INSERT INTO certify.template_data (context, credential_type, template, cr_dtimes, upd_dtimes) VALUES ('https://vharsh.github.io/DID/farmer.json,https://www.w3.org/2018/credentials/v1', 'FarmerProfileCredential,VerifiableCredential', '{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://vharsh.github.io/DID/farmer.json"
],
"issuer": "${issuer}",
"type": [
"VerifiableCredential",
"FarmerProfileCredential"
],
"issuanceDate": "${validFrom}",
"expirationDate": "${validUntil}",
"credentialSubject": {
"id": "${id}",
"name": "${name}",
"dateOfBirth": "${dateOfBirth}",
"highestEducation": "${highestEducation}",
"maritalStatus": "${maritalStatus}",
"typeOfHouse": "${typeOfHouse}",
"numberOfDependents": ${numberOfDependents},
"phoneNumber": "${phoneNumber}",
"knowsLanguage": ${knowsLanguage},
"works": "${works}",
"farmingTypes": ${farmingTypes},
"landArea": ${landArea},
"landOwnershipType": "${landOwnershipType}",
"primaryCropType": "${primaryCropType}",
"secondaryCropType": "${secondaryCropType}"
}
INSERT INTO certify.template_data (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://vharsh.github.io/DID/farmer.json",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"issuer": "${issuer}",
"type": [
"VerifiableCredential",
"FarmerCredential"
],
"issuanceDate": "${validFrom}",
"expirationDate": "${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}"
}
}
', '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, 50, '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_PARTNER', 1095, 50, '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_MOCK_RSA', 1095, 50, '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());
INSERT INTO certify.key_policy_def(APP_ID,KEY_VALIDITY_DURATION,PRE_EXPIRE_DAYS,ACCESS_ALLOWED,IS_ACTIVE,CR_BY,CR_DTIMES) VALUES('CERTIFY_PARTNER', 1095, 60, '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_MOCK_RSA', 1095, 60, '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_MOCK_ED25519', 1095, 60, '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('BASE', 1095, 60, 'NA', true, 'mosipadmin', now());

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ mosip.certify.authn.allowed-audiences={ '${mosipbox.public.url}${server.servlet.
#Crypto asymmetric algorithm name
mosip.kernel.crypto.asymmetric-algorithm-name=RSA/ECB/OAEPWITHSHA-256ANDMGF1PADDING
#Crypto symmetric algorithm name
mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/PKCS5Padding
mosip.kernel.crypto.symmetric-algorithm-name=AES/GCM/NoPadding
#Keygenerator asymmetric algorithm name
mosip.kernel.keygenerator.asymmetric-algorithm-name=RSA
#Keygenerator symmetric algorithm name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,23 @@ mosip.certify.cache.security.algorithm-name=AES/ECB/PKCS5Padding
mosip.certify.cache.secure.individual-id=false
mosip.certify.cache.store.individual-id=true
# TODO: Onboard secrets for local build
mosip.certify.mock.vciplugin.issuer.key-cert=dummy
mosip.certify.mock.vciplugin.issuer.key-cert="dummy-issuer-cert"
mosip.certify.mock.vciplugin.ca.key-cert=dummy
mosip.certify.svg-templates=insurance-svg-template.json
mosip.certify.identifier=http://localhost:8090
mosip.certify.dataprovider.types={'MockVerifiableCredential','StudentCredential','FarmerProfileCredential'}
mosip.certify.integration.data-provider-plugin=MockIdaDataProviderPlugin
mosip.certify.issuer.pub.key=https://vharsh.github.io/DID/mock-rsa-piyush.json
mosip.certify.issuer.uri=https://vharsh.github.io/DID/mock-rsac-piyush.json

mosip.certify.issuer.uri=did:web:vharsh.github.io:DID:harsh
mosip.certify.issuer.pub.key=did:web:vharsh.github.io:DID:harsh#key-0

mosip.certify.issuer=CertifyIssuer
mosip.certify.integration.data-provider-plugin=MockCSVDataProviderPlugin
mosip.certify.issuer.vc-sign-algo=Ed25519Signature2020
## CSV specific config
mosip.certify.data-provider.identifier.column=id
mosip.certify.data-provider.fields.include=id,name,phoneNumber,dateOfBirth,highestEducation,typeOfHouse,numberOfDependents,works,landArea,landOwnershipType,primaryCropType,secondaryCropType,maritalStatus
mosip.certify.plugin.csv.file.uri=https://raw.githubusercontent.com/jainhitesh9998/digital-credential-plugins/refs/heads/develop/mock-certify-plugin/src/test/resources/farmer_identity_data.csv
mosip.certify.issuer.svg.template.id=
mosip.certify.key-values={\
'vd12' : {\
'credential_issuer': '${mosip.certify.identifier}',\
Expand Down Expand Up @@ -69,7 +78,7 @@ mosip.certify.key-values={\
'credential_signing_alg_values_supported': {'RsaSignature2018'},\
'proof_types_supported': {'jwt': {'proof_signing_alg_values_supported': {'RS256', 'PS256'}}},\
'credential_definition': {\
'type': {'VerifiableCredential','FarmerProfileCredential'},\
'type': {'VerifiableCredential','FarmerCredential'},\
'credentialSubject': {\
'name': {'display': {{'name': 'Name','locale': 'en'}}}, \
'highestEducation': {'display': {{'name': 'Highest Education','locale': 'en'}}},\
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
id,name,phoneNumber,dateOfBirth,highestEducation,typeOfHouse,numberOfDependents,works,landArea,landOwnershipType,primaryCropType,secondaryCropType,maritalStatus
4567538768,John Doe,9876543210,1980-05-15,Bachelors Degree,Farmhouse,3,Full-time,50.5,Self-owned,Wheat,Vegetables,Married
4567538769,Mary Smith,8765432109,1975-08-22,High School,Ranch,4,Full-time,25.75,Leased,Rice,Pulses,Married
4567538770,Raj Patel,7654321098,1990-03-10,Primary Education,Cottage,2,Part-time,15.25,Family Owned,Cotton,Maize,Married
4567538771,Sarah Johnson,6543210987,1985-11-30,Diploma,Ranch,1,Full-time,35.5,Self-owned,Sugarcane,Rice,Single
4567538772,Kumar Swamy,5432109876,1970-04-18,No Formal Education,Cottage,5,Full-time,45.0,Self-owned,Maize,Wheat,Married
4567538773,Li Wei,4321098765,1988-09-25,Masters Degree,Farmhouse,2,Part-time,20.5,Leased,Vegetables,Fruits,Married
4567538774,Arun Kumar,9876543211,1987-06-20,Diploma,Cottage,2,Part-time,22.75,Family Owned,Rice,Cotton,Married
4 changes: 2 additions & 2 deletions docker-compose/docker-compose-newplugin/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- "5433:5432"

certify:
image: inji-certify:local
image: mosipdev/inji-certify:develop
user: root
ports:
- 8090:8090
Expand All @@ -24,7 +24,7 @@ services:
- SPRING_CONFIG_NAME=certify
- SPRING_CONFIG_LOCATION=/home/mosip/config/
- enable_certify_artifactory=false
# - download_hsm_client=true
- download_hsm_client=false
volumes:
- ./config/certify-default.properties:/home/mosip/config/certify-default.properties
- ./config/certify-mock-identity.properties:/home/mosip/config/certify-mock-identity.properties
Expand Down

0 comments on commit feaec21

Please sign in to comment.