Skip to content

Commit

Permalink
[INJICERT-657] add validFrom if missing from plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Vardhan <[email protected]>
  • Loading branch information
vharsh committed Dec 18, 2024
1 parent 3256f8e commit fb75beb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public String format(JSONObject valueMap, Map<String, Object> templateSettings)
String expiryTime = ZonedDateTime.now(ZoneOffset.UTC).plusSeconds(duration.getSeconds()).format(DateTimeFormatter.ofPattern(Constants.UTC_DATETIME_PATTERN));
finalTemplate.put(VCDM2Constants.VALID_UNITL, expiryTime);
}
if (!valueMap.has(VCDM2Constants.VALID_FROM)) {
finalTemplate.put(VCDM2Constants.VALID_FROM, ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ofPattern(Constants.UTC_DATETIME_PATTERN)));
}
VelocityContext context = new VelocityContext(finalTemplate);
engine.evaluate(context, writer, /*logTag */ templateName,template.toString());
if (StringUtils.isNotEmpty(idPrefix)) {
Expand Down

0 comments on commit fb75beb

Please sign in to comment.