ehn-dcc-development / hcert-kotlin

Kotlin multiplatform implementation of the HCERT/DCC specification
Apache License 2.0
25 stars 25 forks source link

Return verification error details #46

Closed jsiwrk closed 3 years ago

jsiwrk commented 3 years ago

For certain verification errors (initially, CWT_EXPIRED), return additional information in the form of key-value pairs.

The purpose of this is allowing the client code of the library to obtain additional data about certain errors, so that it can record richer logs or process that data in some way (e.g. presenting it to a human for diagnostics).

See issue #43 for a discussion of other alternatives to provide this feature.

JesusMcCloud commented 3 years ago

If it turns out that we won't have any more complex reasons for error (which I don't think we do), I'd consider this a good and lean fit. If only one single error case would result in a rather bloated map of error details lacking structure, I think we may still go for this instead of a potentially over-engineered solution with little actual impact.

A final verdict requires a some code review, though…