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

[INJICERT-657] update SQL template scripts & fix VC key bug #162

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public LdProof generateProof(LdProof vcLdProof, String vcEncodedHash, Map<String
payload.setDataToSign(vcEncodedHash);
payload.setApplicationId(keyID.get(Constants.APPLICATION_ID));
payload.setReferenceId(keyID.get(Constants.REFERENCE_ID));
payload.setApplicationId(Constants.CERTIFY_VC_SIGN_ED25519);
payload.setReferenceId(Constants.ED25519_REF_ID); // alg, empty = RSA
payload.setIncludePayload(false);
payload.setIncludeCertificate(false);
payload.setIncludeCertHash(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public LdProof generateProof(LdProof vcLdProof, String vcEncodedHash, Map<String
SignRequestDtoV2 srd = new SignRequestDtoV2();
srd.setApplicationId(keyID.get(Constants.APPLICATION_ID));
srd.setReferenceId(keyID.get(Constants.REFERENCE_ID));
srd.setApplicationId(Constants.CERTIFY_VC_SIGN_ED25519);
srd.setReferenceId(Constants.ED25519_REF_ID);
srd.setDataToSign(vcEncodedHash);
srd.setResponseEncodingFormat("base58btc");
srd.setSignAlgorithm(JWSAlgorithm.EdDSA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class VelocityTemplatingEngineImpl implements VCFormatter {
@Value("${mosip.certify.data-provider-plugin.vc-expiry-duration:P730d}")
String defaultExpiryDuration;

@Value("${mosip.certify.issuer.id.field.prefix.url:}")
@Value("${mosip.certify.data-provider-plugin.id-field-prefix-uri:}")
String idPrefix;

@PostConstruct
Expand Down
61 changes: 30 additions & 31 deletions docker-compose/docker-compose-injistack/certify_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,37 +113,36 @@ 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.credential_template (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://piyush7034.github.io/my-files/farmer.json",
"https://w3id.org/security/suites/ed25519-2020/v1"
],
"issuer": "${_issuer}",
"type": [
"VerifiableCredential",
"FarmerCredential"
],
"validFrom": "${validFrom}",
"validUntil": "${validUntil}",
"credentialSubject": {
"fullName": "${fullName}",
"mobileNumber": "${mobileNumber}",
"dateOfBirth": "${dateOfBirth}",
"gender": "${gender}",
"state": "${state}",
"district": "${district}",
"villageOrTown": "${villageOrTown}",
"postalCode": "${postalCode}",
"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());
Expand Down
Loading