diff --git a/index.html b/index.html index f79a3c5..83bd8f4 100644 --- a/index.html +++ b/index.html @@ -1176,41 +1176,56 @@

Exchange Examples

Error Handling

- Error handling and messaging in the vc-api is designed in accordance with [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html). - Implementers SHOULD include a [status](https://www.rfc-editor.org/rfc/rfc9457.html#name-status) and a [title](https://www.rfc-editor.org/rfc/rfc9457.html#name-title) - in the error response in accordance with the specifics of the endpoints on which the error occurs. - Other fields such as [detail](https://www.rfc-editor.org/rfc/rfc9457.html#name-detail), [instance](https://www.rfc-editor.org/rfc/rfc9457.html#name-instance) and - [type](https://www.rfc-editor.org/rfc/rfc9457.html#name-type) are encouraged to be leveraged to provide more contextual feedback about the error, + Error handling and messaging in the VC-API follows [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html). + Implementers SHOULD include a [status](https://www.rfc-editor.org/rfc/rfc9457.html#name-status) + and a [title](https://www.rfc-editor.org/rfc/rfc9457.html#name-title) + in the error response body relating to the specifics of the endpoint on which the error occurs. +

+

+ Aligning on error handling and messaging will greatly improve test-suites accuracy + when identifying interoperability technical friction. +

+

+ Other fields such as [detail](https://www.rfc-editor.org/rfc/rfc9457.html#name-detail), + [instance](https://www.rfc-editor.org/rfc/rfc9457.html#name-instance) + and [type](https://www.rfc-editor.org/rfc/rfc9457.html#name-type) + are encouraged to be leveraged to provide more contextual feedback about the error, while being conscious of not disclosing sensitive information for security concerns.

- Implementers SHOULD catch all server errors in the best of their capabilities. - Endpoints should avoid returning improperly handled 500 errors in a production environment leading to potential [information disclosure](https://owasp.org/www-community/Improper_Error_Handling). + Implementers should try to handle all server errors in the best of their capabilities. + Endpoints should avoid returning improperly handled 500 errors in a production + environment leading to potential [information disclosure](https://owasp.org/www-community/Improper_Error_Handling).

-

Relationship between verification and error codes

+

Relationship between verification and error handling

- While performing verification of a credential and/or presentation, an implementer might be in a situation where they must raise an error. - This is an ambigous case between http protocol related errors and VC specification related errors. - Given a verifiableCredential: - For cases where the data model is wrong or the proof is invalid, a 400 invalid input should be returned. - For cases where the a verificaiton method cannot be resolved, a 404 missing ressource should be returned. - For cases where the validity is bad or the status is invalid, a 422 unprocessable entity should be returned, - meaning the verifier has no intention to process the credential further. - - The logic is to differentiate between a verifier's verification processes and validation processes. - - As thus, the following mapping of status and title should be applied: - - For data model errors, return 400: Data Model - - For malformed proof, return 400: Proof Malformed - - For invalid proof, return 422: Proof Invalid - - For invalid credential/presentation, return 422: Validity Period - - For failed status checks, return 422: Status Invalid + While performing [verification](https://w3c.github.io/vc-data-model/#verification), + an implementer should avoid raising errors and instead gather + [ProblemDetails](https://w3c.github.io/vc-data-model/#problem-details) + objects to include in the verification results.

-

References

- +

ProblemDetails Types

+
[PARSING_ERROR](https://www.w3.org/TR/vc-data-model#PARSING_ERROR)
+
[STATUS_NOT_UPDATED_ERROR](https://www.w3.org/TR/vc-data-model#STATUS_NOT_UPDATED_ERROR)
+
[CRYPTOGRAPHIC_SECURITY_ERROR](https://www.w3.org/TR/vc-data-model#CRYPTOGRAPHIC_SECURITY_ERROR)
+
[MALFORMED_VALUE_ERROR](https://www.w3.org/TR/vc-data-model#MALFORMED_VALUE_ERROR)
+
[RANGE_ERROR](https://www.w3.org/TR/vc-data-model#RANGE_ERROR)
+
[UNRESOLVABLE_DID_ERROR](https://www.w3.org/TR/vc-data-model#UNRESOLVABLE_DID_ERROR)
+
[STATUS_WARNING](https://www.w3.org/TR/vc-data-model#STATUS_WARNING)
+
[VALIDITY_PERIOD_WARNING](https://www.w3.org/TR/vc-data-model#VALIDITY_PERIOD_WARNING)
+
[CONTROLLER_MISMATCH_WARNING](https://www.w3.org/TR/vc-data-model#CONTROLLER_MISMATCH_WARNING)
#141 +

Verification Response

+ + { + "verified": false, + "document": {}, + "mediaType": "", + "controller": "", + "controllerDocument": {}, + "warnings": [ProblemDetails], + "errors": [ProblemDetails] + } +