Skip to content

Commit

Permalink
[INJICERT-657] move VCFormatter & VCSigner to certify-service
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Vardhan <[email protected]>
  • Loading branch information
vharsh committed Dec 17, 2024
1 parent cfe3ab4 commit 0972eaa
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class TemplatesLoader implements CommandLineRunner {
@Autowired
RenderingTemplateRepository svgRenderTemplateRepository;

@Value("${mosip.certify.svg-templates:}")
@Value("${mosip.certify.rendering-templates:}")
private String svgTemplateJson;

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import io.mosip.certify.core.spi.VCIssuanceService;
import io.mosip.certify.core.util.AuditHelper;
import io.mosip.certify.core.util.SecurityHelperService;
import io.mosip.certify.services.spi.DataProviderPlugin;
import io.mosip.certify.services.spi.VCFormatter;
import io.mosip.certify.services.spi.VCSigner;
import io.mosip.certify.services.validators.CredentialRequestValidator;
import io.mosip.certify.exception.InvalidNonceException;
import io.mosip.certify.proof.ProofValidator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import info.weboftrust.ldsignatures.LdProof;
import info.weboftrust.ldsignatures.canonicalizer.Canonicalizer;
import io.mosip.certify.api.dto.VCResult;
import io.mosip.certify.api.spi.VCSigner;
import io.mosip.certify.services.spi.VCSigner;
import io.mosip.certify.core.constants.*;
import io.mosip.certify.core.exception.CertifyException;
import io.mosip.certify.services.proofgenerators.ProofGenerator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.certify.api.spi;
package io.mosip.certify.services.spi;

import io.mosip.certify.api.exception.DataProviderExchangeException;
import org.json.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.certify.api.spi;
package io.mosip.certify.services.spi;


import org.json.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.mosip.certify.api.spi;
package io.mosip.certify.services.spi;

import io.mosip.certify.api.dto.VCResult;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.time.format.DateTimeFormatter;
import java.util.*;

import io.mosip.certify.api.spi.VCFormatter;
import io.mosip.certify.services.spi.VCFormatter;
import io.mosip.certify.core.constants.Constants;
import io.mosip.certify.core.constants.VCDM2Constants;
import io.mosip.certify.core.constants.VCDMConstants;
Expand Down Expand Up @@ -91,9 +91,6 @@ public String format(JSONObject valueMap, Map<String, Object> templateSettings)
String key = keys.next();
Object value = valueMap.get(key);
if (value instanceof List) {
// TODO(problem area): handle field values with unescaped JSON
// reserved literals such as " or ,
// (Q) Should Object always be a JSONObject?
finalTemplate.put(key, new JSONArray((List<Object>) value));
} else if (value.getClass().isArray()) {
finalTemplate.put(key, new JSONArray(List.of(value)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.util.ReflectionTestUtils;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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.svg-templates=insurance-svg-template.json
mosip.certify.rendering-templates=insurance-svg-template.json
mosip.certify.key-values={\
'vd12' : {\
'credential_issuer': '${mosip.certify.identifier}', \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +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.rendering-templates=insurance-svg-template.json
mosip.certify.key-values={\
'latest' : {\
'credential_issuer': '${mosipbox.public.url}', \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mosip.certify.cache.store.individual-id=true
# TODO: Onboard secrets for local build
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.rendering-templates=insurance-svg-template.json
mosip.certify.identifier=http://localhost:8090

mosip.certify.data-provider-plugin.issuer-uri=did:web:vharsh.github.io:DID:harsh
Expand Down

0 comments on commit 0972eaa

Please sign in to comment.