Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Mohd Kaif Siddique <[email protected]>
  • Loading branch information
kaifk468 committed Jan 8, 2024
1 parent 8046063 commit cd6f370
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import org.apache.velocity.runtime.resource.loader.URLResourceLoader;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -182,7 +181,7 @@ private Map<String,Object> createCredentialIssueRequest(String requestedCredenti
requestMap.put("credentialSchemaVersion",configMap.get(CRED_SCHEMA_VESRION));
requestMap.put("tags",new ArrayList<>());
}catch (JsonProcessingException e){
log.error("Error while parsing the templete ",e);
log.error("Error while parsing the template ",e);
throw new VCIExchangeException(ErrorConstants.VCI_EXCHANGE_FAILED);
}
//TODO This need to be removed since it can contain PII
Expand Down Expand Up @@ -245,8 +244,8 @@ private void validateContextUrl(Template template,List<String> vcRequestContextL
try{
StringWriter writer = new StringWriter();
template.merge(new VelocityContext(),writer);
Map<String,Object> tempMap= mapper.readValue(writer.toString(),Map.class);
List<String> contextList=(List<String>)tempMap.get("@context");
Map<String,Object> templateMap = mapper.readValue(writer.toString(),Map.class);
List<String> contextList=(List<String>) templateMap.get("@context");
for(String contextUrl:vcRequestContextList){
if(!contextList.contains(contextUrl)){
log.error("ContextUrl is not supported");
Expand Down

0 comments on commit cd6f370

Please sign in to comment.