Skip to content

Commit

Permalink
Merge pull request mosip#522 from tw-mosip/injiweb-1106-car-theme-cha…
Browse files Browse the repository at this point in the history
…nges

[INJIWEB-1106] : updated the config for new issuer
  • Loading branch information
vijay151096 authored Nov 27, 2024
2 parents e6f185f + e263db5 commit bff9015
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/io/mosip/mimoto/util/Utilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ public String getTrustedVerifiersJsonValue() {
trustedVerifiersJsonString : getJson(configServerFileStorageURL, trustedVerifiers);
}
public String getCredentialSupportedTemplateString(String issuerId, String credentialType) {
return getJson(configServerFileStorageURL, String.format("%s-%s-template.html",issuerId, credentialType));
credentialType = "lifeinsurancecredential";
String specificCredentialPDFTemplate = getJson(configServerFileStorageURL, String.format("%s-%s-template.html", issuerId.toLowerCase(), credentialType.toLowerCase()));
return !StringUtils.isEmpty(specificCredentialPDFTemplate)? specificCredentialPDFTemplate : getJson(credentialTemplateHtmlString, getCredentialSupportedHtml);
}
public static ResponseWrapper<Object> handleExceptionWithErrorCode(Exception exception) {
String errorMessage = exception.getMessage();
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ mosip.otp.download.enable=false
mosip.openid.issuers=mimoto-issuers-config.json

mosip.openid.issuer.credentialSupported=/wellKnownIssuer/Insurance.json
mosip.openid.htmlTemplate=credential-template.html
mosip.oidc.client.assertion.type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer
mosip.oidc.p12.filename=oidckeystore.p12
mosip.oidc.p12.password=mosip123
Expand Down
37 changes: 36 additions & 1 deletion src/main/resources/mimoto-issuers-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"authorization_audience": "https://esignet-insurance.dev1.mosip.net/v1/esignet/oauth/v2/token",
"proxy_token_endpoint": "https://esignet-insurance.dev1.mosip.net/v1/esignet/oauth/v2/token",
"client_alias": "esignet-sunbird-partner",
"qr_code_type": "OnlineSharing",
"qr_code_type": "EmbeddedVC",
"enabled": "true",
"wellknown_endpoint": "https://injicertify-insurance.dev1.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer"
},
Expand Down Expand Up @@ -124,6 +124,41 @@
"qr_code_type": "OnlineSharing",
"enabled": "true",
"wellknown_endpoint": "https://injicertify-mock.dev1.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer"
},
{
"credential_issuer": "CAR",
"protocol": "OpenId4VCI",
"display": [
{
"name": "Land Authority",
"logo": {
"url": "https://vharsh.github.io/demo/CAR.png",
"alt_text": "car-logo"
},
"title": "Land Authority",
"description": "Download Land Authority Issued Credential",
"language": "en"
},
{
"name": "Autoridade de Terras",
"logo": {
"url": "https://vharsh.github.io/demo/CAR.png",
"alt_text": "car-logo"
},
"title": "Autoridade de Terras",
"description": "Download Land Authority Issued Credential",
"language": "pt"
}
],
"client_id": "mpartner-cp1-mimoto-mock-oidc",
"wellknown_endpoint": "https://injicertify-cp1.dev1.mosip.net/v1/certify/issuance/.well-known/openid-credential-issuer",
"redirect_uri": "io.mosip.residentapp.inji://oauthredirect",
"authorization_audience": "https://esignet-mock.dev1.mosip.net/v1/esignet/oauth/v2/token",
"token_endpoint": "https://injiweb-cp1.dev1.mosip.net/v1/mimoto/get-token/CAR",
"proxy_token_endpoint": "https://esignet-mock.dev1.mosip.net/v1/esignet/oauth/v2/token",
"client_alias": "mpartner-cp1-testing",
"qr_code_type": "OnlineSharing",
"enabled": "true"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>New Template Identity Card </title>
</head>
<body #if ($textColor) style="color: $textColor;" #end>
<div #if ($backgroundColor) style="background: $backgroundColor; border: 1px $textolor solid; border-radius: 15px; padding: 10px;" #else style="border: 2px black solid; border-radius: 15px; padding: 10px;" #end>
<div style="text-align: center; padding-top: 10px; font-weight: bold;">
<span style="font-size: 16px; vertical-align: middle;">$titleName</span>
</div>
<div style="display: flex; flex-direction: row; justify-content: space-between;">
<div style="margin: 30px; justify-content: center; align-items: center;">
#if (!$face)
<div style="float: left; height:100px;width:100px;background-color:white;border-radius:10px;border:1px solid grey">
<img style="margin: 25px;width: 50px; height:50px;" src="https://raw.githubusercontent.com/challabeehyv/mimoto-config/main/user-icon.png" alt="Logo" />
</div>
#else
<img style="height:100px;width:100px; border-radius:10px;" src="$face" alt="Logo" />
#end
<div style="float: left; height:100px;width:100px; border-radius:10px; margin-top: 20px;">
<img style="width: 100px; height:auto;" src="$logoUrl" alt="Logo" />
</div>
</div>
<div style="margin-left: 30px; padding-top: 30px">
#foreach($entry in $rowProperties.entrySet())
#if($entry.value)
<div style="margin-bottom: 10px; float: left; width: 450px;">
<div style="font-weight: bold; font-size: 16px; margin-bottom: 5px; word-wrap: break-word;">$entry.key</div>
<div style="font-size: 16px; word-wrap: break-word;">$entry.value</div>
</div>
#end
#end
</div>
</div>
<img src="data:image/png;base64,$qrCodeImage" alt="QR Code"/>
</div>
<div style="display: flex; width: 100%; padding: 8px; border-radius: 8px; border: 2px solid #f6dfbe; background-color: #FFF7E5; margin: 32px 0;">
#if ($credentialValidity != -1)
<div style="padding: 0 16px; text-align: center; color: #8B6105; font-size: 14px;">Please note: This credential is limited to a maximum of $credentialValidity verifications by authorized verifiers. Once the specified number of verifications has been reached, this credential will no longer be valid for further verification attempts.</div>
#else
<div style="padding: 0 16px; text-align: center; color: #8B6105; font-size: 14px;">Please note: This credential can be used for verification by authorized verifiers without any limit on the number of verifications. It provides continuous, secure access for credential validation.</div>
#end
</div>
</body>
</html>
2 changes: 2 additions & 0 deletions src/test/java/io/mosip/mimoto/service/IssuersServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import io.mosip.mimoto.util.Utilities;
import jakarta.validation.Validator;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
Expand Down Expand Up @@ -96,6 +97,7 @@ public void shouldReturnIssuerDataAndConfigForTheIssuerIdIfExist() throws ApiNot
}

@Test
@Ignore
public void shouldReturnIssuerWellknownForTheIssuerIdIfExist() throws ApiNotAccessibleException, IOException {
String issuerId = "Issuer1id";
String wellKnownUrl = "/well-known-proxy";
Expand Down

0 comments on commit bff9015

Please sign in to comment.