I fetched rules from the Verification API to verify a covid certificate. I used certlogic-js for verification but I had problems with the date-related rules.
As discussed in an issue in the certlogic-js project the rules do not seem to follow the specification.
For example, the rules TR-CH-0005 and TR-CH-0006 are using the wrong operators for date comparison.
{
"inputParameter":"[\"t.0\",\"t.0.sc\"]",
"description":"The date of sample collection must be before the validation date",
"id":"TR-CH-0005",
"logic":{
"if":[
{
"var":"payload.t.0"
},
{
"<":[
{
"plusTime":[
{
"var":"payload.t.0.sc"
},
0,
"day"
]
},
{
"plusTime":[
{
"var":"external.validationClock"
},
0,
"day"
]
}
]
},
true
]
}
},
{
"inputParameter":"[\"t.0.tt\",\"t.0.sc\"]",
"description":"If the test type is \"RAT\" then the validation date must be before the date of sample collection plus 48 hours",
"id":"TR-CH-0006",
"logic":{
"if":[
{
"===":[
{
"var":"payload.t.0.tt"
},
"LP217198-3"
]
},
{
"<":[
{
"plusTime":[
{
"var":"external.validationClock"
},
0,
"day"
]
},
{
"plusTime":[
{
"var":"payload.t.0.sc"
},
48,
"hour"
]
}
]
},
true
]
}
},
Hi,
I fetched rules from the Verification API to verify a covid certificate. I used
certlogic-js
for verification but I had problems with the date-related rules.As discussed in an issue in the
certlogic-js
project the rules do not seem to follow the specification.For example, the rules
TR-CH-0005
andTR-CH-0006
are using the wrong operators for date comparison.This rule does not return a boolean:
I'm not sure if this is a valid issue here, but I'd be happy for help, since I'm trying to create a verification implementation in node-js.
Thanks :)