Skip to content

Commit

Permalink
Added insurance svg template configurations for docker-compose
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush7034 <[email protected]>
  • Loading branch information
Piyush7034 committed Oct 18, 2024
1 parent 5e9819d commit b78b3c0
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 1 deletion.
9 changes: 9 additions & 0 deletions docker-compose/docker-compose-certify/certify_init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}', \
Expand Down Expand Up @@ -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'}\
}\
}\
}\
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}', \
Expand Down Expand Up @@ -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'}\
}}\
}\
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"id": "5b9c2a12-810a-7388-2dc8-13ee7ad88bac",
"content": "<svg width=\"350\" height=\"560\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" >\n <defs>\n <radialGradient id=\"gradient\" cx=\"50%\" cy=\"50%\" r=\"50%\" fx=\"50%\" fy=\"50%\">\n <stop offset=\"0%\" style=\"stop-color:#ffffff;stop-opacity:1\" />\n <stop offset=\"100%\" style=\"stop-color:#c1e0e6;stop-opacity:1\" />\n </radialGradient>\n \n <!-- Filter for shadow -->\n <filter id=\"shadow\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\">\n <feOffset result=\"offOut\" in=\"SourceAlpha\" dx=\"0\" dy=\"0\" />\n <feGaussianBlur result=\"blurOut\" in=\"offOut\" stdDeviation=\"1.5\" />\n <feBlend in=\"SourceGraphic\" in2=\"blurOut\" mode=\"normal\" />\n </filter>\n\n <clipPath id=\"bg-roundedClip\">\n <rect x=\"0\" y=\"0\" width=\"350\" height=\"560\" rx=\"30\" ry=\"30\" />\n </clipPath>\n\n <style type=\"text/css\">\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&amp;display=swap');\n \n .titleSemiBold16 {\n font-family: 'Inter', sans-serif;\n font-weight: 600;\n font-size: 16px;\n text-anchor: middle;\n }\n\n .titleRegular15 {\n font-family: 'Inter', sans-serif;\n font-weight: 300;\n font-size: 15px;\n text-anchor: middle;\n }\n\n .fieldLabelRegular11 {\n font-family: 'Inter', sans-serif;\n font-weight: 400;\n font-size: 11px;\n text-anchor: start;\n fill: #767676;\n }\n .fieldValueFontRegular11 {\n font-family: 'Inter', sans-serif;\n font-weight: 600; /* Regular */\n font-size: 11px;\n text-anchor: start;\n fill: #000000;\n }\n .fieldValueFontWrappable {\n font-family: 'Inter', sans-serif;\n font-weight: 400; /* Regular */\n font-size: 11px;\n text-anchor: start;\n fill: #000000;\n text-wrap: wrap;\n }\n .horizontalLine {\n font-family: 'Inter', sans-serif;\n font-weight: 600; /* Semi-Bold */\n font-size: 11px;\n text-anchor: start;\n fill: #000000;\n font-weight: bold;\n word-wrap: break-word;\n }\n </style>\n \n </defs>\n <g filter=\"url(#shadow)\">\n <!-- Background Image -->\n <image preserveAspectRatio=\"xMidYMid slice\" \n width=\"350\" \n height=\"560\" \n href=\"https://raw.githubusercontent.com/tw-mosip/file-server/master/svg-templates/assets/backdrop.png\"\n clip-path=\"url(#bg-roundedClip)\"\n /> \n \n <!-- Logo and Title -->\n <g transform=\"translate(0, 10)\">\n <image xlink:href=\"https://raw.githubusercontent.com/tw-mosip/file-server/master/svg-templates/assets/stay-protected-insurance-logo.png\" width=\"40\" height=\"40\" x=\"50%\" y=\"15\" transform=\"translate(-20, 0)\" preserveAspectRatio=\"xMidYMin meet\"/>\n <text x=\"50%\" y=\"80\" class=\"titleSemiBold16\" fill=\"#000000\">\n {{credentialSubject/policyName}}\n </text>\n <text x=\"50%\" y=\"105\" class=\"titleSemiBold16\" fill=\"#000000\">\n {{credentialSubject/policyNumber}}\n </text>\n </g>\n\n <!-- Full Name -->\n <g transform=\"translate(0, 150)\">\n \n <text x=\"5%\" y=\"0\" class=\"fieldLabelRegular11\">Full Name\n </text>\n <text x=\"5%\" y=\"15\" class=\"fieldValueFontRegular11\">{{credentialSubject/fullName}}\n </text>\n \n </g>\n\n <!-- Phone number and Gender -->\n <g transform=\"translate(0, 190)\">\n\n <text x=\"5%\" y=\"0\" class=\"fieldLabelRegular11\">Phone Number\n </text>\n <text x=\"5%\" y=\"15\" class=\"fieldValueFontRegular11\">{{credentialSubject/mobile}}\n </text>\n <text x=\"60%\" y=\"0\" class=\"fieldLabelRegular11\">Gender\n </text>\n <text x=\"60%\" y=\"15\" class=\"fieldValueFontRegular11\">{{credentialSubject/gender}}\n </text>\n </g>\n\n <!-- Email -->\n <g transform=\"translate(0, 230)\">\n\n <text x=\"5%\" y=\"0\" class=\"fieldLabelRegular11\">Email\n </text>\n <text x=\"5%\" y=\"15\" width=\"50\" class=\"fieldValueFontRegular11\">{{credentialSubject/email}}\n </text>\n </g>\n\n <!-- Policy Issued , Expired On and Benefits -->\n <g transform=\"translate(0, 260)\">\n <line x1=\"5%\" y1=\"0\" x2=\"95%\" y2=\"0\" stroke=\"#a9a9a9\" stroke-width=\"0.5\" />\n <text x=\"5%\" y=\"20\" class=\"fieldLabelRegular11\">Policy Issued On\n </text>\n <text x=\"5%\" y=\"35\" class=\"fieldValueFontRegular11\">{{credentialSubject/policyIssuedOn}}\n </text>\n <text x=\"60%\" y=\"20\" class=\"fieldLabelRegular11\">Policy Expires On\n </text>\n <text x=\"60%\" y=\"35\" class=\"fieldValueFontRegular11\">{{credentialSubject/policyExpiresOn}}\n </text>\n <text x=\"5%\" y=\"60\" class=\"fieldLabelRegular11\">Benefits\n </text>\n <text x=\"5%\" y=\"65\" class=\"fieldValueFontRegular11\">\n <tspan x=\"15\" dy=\"1.2em\">{{credentialSubject/benefitsLine1}}</tspan>\n <tspan x=\"15\" dy=\"1.3em\">{{credentialSubject/benefitsLine2}}</tspan>\n </text>\n </g>\n\n <!-- Status section with path -->\n <g transform=\"translate(0, 365)\">\n <!-- Horizontal Line -->\n <line x1=\"5%\" y1=\"0\" x2=\"95%\" y2=\"0\" stroke=\"#a9a9a9\" stroke-width=\"0.5\" />\n \n <!-- Row with Image, Path, and Status -->\n <g transform=\"translate(0, 30)\">\n <!-- White border with padding -->\n <rect x=\"7%\" y=\"0\" width=\"120\" height=\"120\" fill=\"#ffffff\" stroke=\"#ffffff\" stroke-width=\"20\" rx=\"5\" ry=\"5\" filter=\"url(#shadow)\" />\n \n <image xlink:href=\"{{credentialSubject/qrCodeImage}}\" width=\"120\" height=\"120\" x=\"7%\" y=\"0\" preserveAspectRatio=\"xMidYMin meet\" />\n \n <!-- Status Label and Value -->\n <text x=\"70%\" y=\"55\" class=\"titleSemiBold16\" fill=\"#767676\">\n Status\n </text>\n <text x=\"75%\" y=\"78\" class=\"titleSemiBold16\" fill=\"#000000\">\n Valid\n </text>\n <!-- Tick Mark -->\n <path d=\"M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM9.29,16.29L5.7,12.7c-0.39,-0.39 -0.39,-1.02 0,-1.41 0.39,-0.39 1.02,-0.39 1.41,0L10,14.17l6.88,-6.88c0.39,-0.39 1.02,-0.39 1.41,0 0.39,0.39 0.39,1.02 0,1.41l-7.59,7.59c-0.38,0.39 -1.02,0.39 -1.41,0z\" fill=\"#239E00\" transform=\"translate(215, 60)\" />\n </g>\n </g>\n </g>\n <!-- Border Rectangle -->\n <rect x=\"0\" y=\"0\" width=\"350\" height=\"560\" fill=\"none\" filter=\"url(#shadow)\" rx=\"30\" ry=\"30\" stroke=\"#a9a9a9\" stroke-width=\"0.5\" />\n</svg>\n"
}
]

0 comments on commit b78b3c0

Please sign in to comment.