The constraints on the JSON (payload) of the upload of a validation rule (after checking the signer’s certificate) are the following:
reason code | constraints | message |
---|---|---|
|
signer certificate must be known under authenticated country code |
Could not find upload certificate with hash <signer certificate’s thumbprint> and country <authenticated country code> |
|
parsable as JSON |
JSON could not be parsed |
validates against JSON Schema for Rule |
JSON does not align to Validation Rule Schema: <comma-separated list of validation violations' messages> |
|
|
head fragment of |
ID must start with <type abbrev.> for <certificate type> Rules |
|
Acceptance Rule Rule-ID requires prefix other than IR. |
|
|
Invalidation Rule Rule-ID requires IR prefix. |
|
|
|
Country does not match your authentication. |
country code in |
Country Code in Identifier does not match country. |
|
|
new |
Version of new rule (<new version>) needs to be greater then old version (<old version>) |
|
|
ValidFrom (<(val)>) needs to be before ValidTo (<(val)>). |
|
ValidFrom (<(val)>) cannot be more than 2 weeks in future. |
|
|
ValidFrom (<(val)>) needs to be at least 48h in future for Acceptance Validation Rules |
|
|
ValidFrom (<(val)>) needs to be in future for Invalidation Rules |
|
duration of validity must be at least 72 hours |
Rule Validity must be at least 72h but is %dh |
|
new |
ValidFrom (<(current val)> needs to be after or equal to ValidFrom (<(previous val)> of previous version of the rule. |
These constraints are checked in this order. Only the first violation is reported.
Note
|
The whole rule is also validated against this JSON Schema: https://github.com/eu-digital-green-certificates/dgc-gateway/blob/main/src/main/resources/validation-rule.schema.json. This schema demands in particular that:
These two facts together mean that a “grant all”-rule should have its {
"if": [
true,
true,
{
"var": "payload.v"
}
]
} ( |
Reason codes and Java methods are currently 1-to-1:
Java method |
reason code |
|
|
|
|
|
|
|
|
|
|
|
|
The authenticated country code and signer certificate’s thumbprint are request parameters of the HTTP POST endpoint.
This information has been “reverse engineered” from [the Gateway implementation - specifically the ValidationRuleService
.
The SHA of the commit used is: 1146c404205605aa1174a6bd159e91b0217f334d
.