From b78b3c037c5a05c5b56625a748417dd2daf2376e Mon Sep 17 00:00:00 2001 From: Piyush7034 Date: Fri, 18 Oct 2024 17:05:59 +0530 Subject: [PATCH] Added insurance svg template configurations for docker-compose Signed-off-by: Piyush7034 --- .../docker-compose-certify/certify_init.sql | 9 +++ .../config/certify-default.properties | 1 - .../config/certify-mock-identity.properties | 55 ++++++++++++++++ .../certify-sunbird-insurance.properties | 66 +++++++++++++++++++ .../config/insurance-svg-template.json | 6 ++ 5 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 docker-compose/docker-compose-certify/config/insurance-svg-template.json diff --git a/docker-compose/docker-compose-certify/certify_init.sql b/docker-compose/docker-compose-certify/certify_init.sql index d57e1bc9..69af4f66 100644 --- a/docker-compose/docker-compose-certify/certify_init.sql +++ b/docker-compose/docker-compose-certify/certify_init.sql @@ -72,6 +72,15 @@ CREATE TABLE certify.svg_template ( CONSTRAINT pk_svgtmp_id PRIMARY KEY (id) ); +CREATE TABLE certify.template_data( + context character varying(1024) NOT NULL, + credential_type character varying(512) NOT NULL, + template VARCHAR NOT NULL, + cr_dtimes timestamp NOT NULL default now(), + upd_dtimes timestamp, + CONSTRAINT pk_template PRIMARY KEY (context, credential_type) +); + 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()); diff --git a/docker-compose/docker-compose-certify/config/certify-default.properties b/docker-compose/docker-compose-certify/config/certify-default.properties index dd6d54be..685bc75f 100644 --- a/docker-compose/docker-compose-certify/config/certify-default.properties +++ b/docker-compose/docker-compose-certify/config/certify-default.properties @@ -45,7 +45,6 @@ mosip.certify.security.ignore-auth-urls=**/actuator/**,**/error,**/swagger-ui/** ## ------------------------------------------ Discovery openid-configuration ------------------------------------------- mosip.certify.discovery.issuer-id=${mosipbox.public.url}${server.servlet.path} mosip.certify.authorization.url=http://localhost:8088 -mosip.certify.svg-templates=svg-template.json ##--------------change this later--------------------------------- mosip.certify.supported.jwt-proof-alg={'RS256','PS256'} diff --git a/docker-compose/docker-compose-certify/config/certify-mock-identity.properties b/docker-compose/docker-compose-certify/config/certify-mock-identity.properties index a85029fa..744e7a01 100644 --- a/docker-compose/docker-compose-certify/config/certify-mock-identity.properties +++ b/docker-compose/docker-compose-certify/config/certify-mock-identity.properties @@ -12,6 +12,7 @@ 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.ca.key-cert=dummy +mosip.certify.svg-templates=insurance-svg-template.json mosip.certify.key-values={\ 'vd11' : { \ 'credential_issuer': '${mosip.certify.identifier}', \ @@ -134,5 +135,59 @@ mosip.certify.key-values={\ 'order' : {'org.iso.18013.5.1~family_name','org.iso.18013.5.1~given_name','org.iso.18013.5.1~document_number','org.iso.18013.5.1~issuing_country','org.iso.18013.5.1~issue_date','org.iso.18013.5.1~expiry_date','org.iso.18013.5.1~birth_date'}\ }\ }\ + },\ + 'vd13.1' : {\ + 'credential_issuer': '${mosip.certify.identifier}', \ + 'authorization_servers': {'${mosip.certify.authorization.url}'}, \ + 'credential_endpoint': '${mosip.certify.identifier}${server.servlet.path}/issuance/credential', \ + 'svg_template_endpoint': '${mosip.certify.domain.url}${server.servlet.path}/public/svg-template/5b9c2a12-810a-7388-2dc8-13ee7ad88bac', \ + 'display': {{'name': 'Mock Verifiable Credential', 'locale': 'en'}},\ + 'credential_configurations_supported' : { \ + 'MockVerifiableCredential_ldp' : {\ + 'format': 'ldp_vc',\ + 'scope' : 'mock_identity_vc_ldp',\ + 'cryptographic_binding_methods_supported': {'did:jwk'},\ + 'credential_signing_alg_values_supported': {'RsaSignature2018'},\ + 'proof_types_supported': {'jwt': {'proof_signing_alg_values_supported': {'RS256', 'PS256', 'ES256'}}},\ + 'credential_definition': {\ + 'type': {'VerifiableCredential','MockVerifiableCredential'},\ + 'credentialSubject': {\ + 'fullName': { 'display': {{'name': 'Full Name', 'locale': 'en' }}},\ + 'phone': { 'display': {{'name': 'Phone Number', 'locale': 'en' }}},\ + 'dateOfBirth': { 'display': {{'name': 'DOB', 'locale': 'en' }}},\ + 'gender': { 'display': {{'name': 'Gender', 'locale': 'en' }}},\ + 'email': { 'display': {{'name': 'Email Id', 'locale': 'en' }}},\ + 'region': { 'display': {{'name': 'Region', 'locale': 'en' }}},\ + 'province': { 'display': {{'name': 'Province', 'locale': 'en' }}},\ + 'UIN': { 'display': {{'name': 'UIN', 'locale': 'en' }}},\ + 'VID': { 'display': {{'name': 'VID', 'locale': 'en' }}},\ + 'postalCode': { 'display': {{'name': 'Postal Code', 'locale': 'en' }}}\ + }},\ + 'display': {{'name': 'Mock Verifiable Credential', \ + 'locale': 'en', \ + 'logo': {'url': '${mosipbox.public.url}/logo.png','alt_text': 'a square logo of a MOSIP'},\ + 'background_color': '#12107c',\ + 'background_image': { 'uri': 'https://${mosipbox.public.url}/inji/mosip-logo.png' }, \ + 'text_color': '#FFFFFF'}},\ + 'order' : {'fullName','phone','dateOfBirth','gender','email','region','province','UIN', 'VID', 'postalCode'}\ + },\ + "DrivingLicenseCredential":{\ + 'format': 'mso_mdoc',\ + 'doctype': 'org.iso.18013.5.1.mDL',\ + 'scope' : 'sample_vc_mdoc',\ + 'cryptographic_binding_methods_supported': {'cose_key'},\ + 'credential_signing_alg_values_supported': {'ES256'},\ + 'proof_types_supported': {'jwt': {'proof_signing_alg_values_supported': {'ES256'}}},\ + 'claims': {\ + 'org.iso.18013.5.1': {'given_name': {'display': {{'name': 'Given Name','locale': 'en'}}},'family_name': {'display': {{'name': 'Family Name','locale': 'en'}}},'issue_date': {'display': {{'name': 'Issue Date','locale': 'en'}}},'expiry_date': {'display': {{'name': 'Expiry Date','locale': 'en'}}},'birth_date': {'display': {{'name': 'Birth Date','locale': 'en'}}},'issuing_country': {'display': {{'name': 'Issuing Country','locale': 'en'}}},'document_number': {'display': {{'name': 'Document Number','locale': 'en'}}}}},\ + 'display': {{'name': 'Mobile Driving License Verifiable Credential', \ + 'locale': 'en', \ + 'background_image': { 'uri': 'https://sunbird.org/images/sunbird-logo-new.png' }, \ + 'logo': {'url': 'https://sunbird.org/images/sunbird-logo-new.png','alt_text': 'a square logo of a Sunbird Mobile Driving License'},\ + 'background_color': '#FDFAF9',\ + 'text_color': '#7C4616'}},\ + 'order' : {'org.iso.18013.5.1~family_name','org.iso.18013.5.1~given_name','org.iso.18013.5.1~document_number','org.iso.18013.5.1~issuing_country','org.iso.18013.5.1~issue_date','org.iso.18013.5.1~expiry_date','org.iso.18013.5.1~birth_date'}\ + }\ + }\ }\ } \ No newline at end of file diff --git a/docker-compose/docker-compose-certify/config/certify-sunbird-insurance.properties b/docker-compose/docker-compose-certify/config/certify-sunbird-insurance.properties index 3a7738c0..57c9962a 100644 --- a/docker-compose/docker-compose-certify/config/certify-sunbird-insurance.properties +++ b/docker-compose/docker-compose-certify/config/certify-sunbird-insurance.properties @@ -30,6 +30,7 @@ mosip.certify.vciplugin.sunbird-rc.credential-type.InsuranceCredential.cred-sche mosip.certify.vciplugin.sunbird-rc.credential-type.InsuranceCredential.registry-search-url=http://sunbird-registry:80/registry/api/v1/Insurance/search +mosip.certify.svg-templates=insurance-svg-template.json mosip.certify.key-values={\ 'vd11' : {\ 'credential_issuer': '${mosipbox.public.url}', \ @@ -216,5 +217,70 @@ mosip.certify.key-values={\ 'text_color': '#7C4616'}},\ 'order' : {'fullName','policyName','policyExpiresOn','policyIssuedOn','policyNumber','mobile','dob','gender','benefits','email'}\ }}\ + },\ + 'vd13.1' : {\ + 'credential_issuer': '${mosipbox.public.url}', \ + 'authorization_servers': {'${mosip.certify.authorization.url}'}, \ + 'credential_endpoint': '${mosipbox.public.url}${server.servlet.path}/issuance/credential', \ + 'svg_template_endpoint': '${mosip.certify.domain.url}${server.servlet.path}/public/svg-template/5b9c2a12-810a-7388-2dc8-13ee7ad88bac', \ + 'display': {{'name': 'Insurance', 'locale': 'en'}},\ + 'credential_configurations_supported' : { \ + "InsuranceCredential" : {\ + 'format': 'ldp_vc',\ + 'scope' : 'sunbird_rc_insurance_vc_ldp',\ + 'cryptographic_binding_methods_supported': {'did:jwk'},\ + 'credential_signing_alg_values_supported': {'Ed25519Signature2020'},\ + 'proof_types_supported': {'jwt': {'proof_signing_alg_values_supported': {'RS256', 'PS256'}}},\ + 'credential_definition': {\ + 'type': {'VerifiableCredential','InsuranceCredential'},\ + 'credentialSubject': {\ + 'fullName': {'display': {{'name': 'Name','locale': 'en'}}}, \ + 'mobile': {'display': {{'name': 'Phone Number','locale': 'en'}}},\ + 'dob': {'display': {{'name': 'Date of Birth','locale': 'en'}}},\ + 'gender': {'display': {{'name': 'Gender','locale': 'en'}}},\ + 'benefits': {'display': {{'name': 'Benefits','locale': 'en'}}},\ + 'email': {'display': {{'name': 'Email Id','locale': 'en'}}},\ + 'policyIssuedOn': {'display': {{'name': 'Policy Issued On','locale': 'en'}}},\ + 'policyExpiresOn': {'display': {{'name': 'Policy Expires On','locale': 'en'}}},\ + 'policyName': {'display': {{'name': 'Policy Name','locale': 'en'}}},\ + 'policyNumber': {'display': {{'name': 'Policy Number','locale': 'en'}}}\ + }},\ + 'display': {{'name': 'Sunbird RC Insurance Verifiable Credential', \ + 'locale': 'en', \ + 'logo': {'url': 'https://sunbird.org/images/sunbird-logo-new.png','alt_text': 'a square logo of a Sunbird'},\ + 'background_color': '#FDFAF9',\ + 'background_image': { 'uri': 'https://sunbird.org/images/sunbird-logo-new.png' }, \ + 'text_color': '#7C4616'}},\ + 'order' : {'fullName','policyName','policyExpiresOn','policyIssuedOn','policyNumber','mobile','dob','gender','benefits','email'}\ + },\ + "LifeInsuranceCredential":{\ + 'format': 'ldp_vc',\ + 'scope' : 'life_insurance_vc_ldp',\ + 'cryptographic_binding_methods_supported': {'did:jwk'},\ + 'credential_signing_alg_values_supported': {'Ed25519Signature2020'},\ + 'proof_types_supported': {'jwt': {'proof_signing_alg_values_supported': {'RS256', 'ES256'}}},\ + 'credential_definition': {\ + 'type': {'VerifiableCredential'},\ + 'credentialSubject': {\ + 'fullName': {'display': {{'name': 'Name','locale': 'en'}}}, \ + 'mobile': {'display': {{'name': 'Phone Number','locale': 'en'}}},\ + 'dob': {'display': {{'name': 'Date of Birth','locale': 'en'}}},\ + 'gender': {'display': {{'name': 'Gender','locale': 'en'}}},\ + 'benefits': {'display': {{'name': 'Benefits','locale': 'en'}}},\ + 'email': {'display': {{'name': 'Email Id','locale': 'en'}}},\ + 'policyIssuedOn': {'display': {{'name': 'Policy Issued On','locale': 'en'}}},\ + 'policyExpiresOn': {'display': {{'name': 'Policy Expires On','locale': 'en'}}},\ + 'policyName': {'display': {{'name': 'Policy Name','locale': 'en'}}},\ + 'policyNumber': {'display': {{'name': 'Policy Number','locale': 'en'}}}\ + }},\ + 'display': {{'name': 'Life Insurance Verifiable Credential', \ + 'locale': 'en', \ + 'logo': {'url': 'https://sunbird.org/images/sunbird-logo-new.png','alt_text': 'a square logo of a Sunbird'},\ + 'background_image': { 'uri': 'https://sunbird.org/images/sunbird-logo-new.png' }, \ + 'background_color': '#FDFAF9',\ + 'background_image': { 'uri': 'https://sunbird.org/images/sunbird-logo-new.png' }, \ + 'text_color': '#7C4616'}},\ + 'order' : {'fullName','policyName','policyExpiresOn','policyIssuedOn','policyNumber','mobile','dob','gender','benefits','email'}\ + }}\ }\ } \ No newline at end of file diff --git a/docker-compose/docker-compose-certify/config/insurance-svg-template.json b/docker-compose/docker-compose-certify/config/insurance-svg-template.json new file mode 100644 index 00000000..effea24c --- /dev/null +++ b/docker-compose/docker-compose-certify/config/insurance-svg-template.json @@ -0,0 +1,6 @@ +[ + { + "id": "5b9c2a12-810a-7388-2dc8-13ee7ad88bac", + "content": "\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n {{credentialSubject/policyName}}\n \n \n {{credentialSubject/policyNumber}}\n \n \n\n \n \n \n Full Name\n \n {{credentialSubject/fullName}}\n \n \n \n\n \n \n\n Phone Number\n \n {{credentialSubject/mobile}}\n \n Gender\n \n {{credentialSubject/gender}}\n \n \n\n \n \n\n Email\n \n {{credentialSubject/email}}\n \n \n\n \n \n \n Policy Issued On\n \n {{credentialSubject/policyIssuedOn}}\n \n Policy Expires On\n \n {{credentialSubject/policyExpiresOn}}\n \n Benefits\n \n \n {{credentialSubject/benefitsLine1}}\n {{credentialSubject/benefitsLine2}}\n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Status\n \n \n Valid\n \n \n \n \n \n \n \n \n\n" + } +] \ No newline at end of file