From 230d4bdc16bcd41586a58e189a8ad0b6edea98d2 Mon Sep 17 00:00:00 2001 From: Neal Date: Thu, 25 Jan 2024 10:51:11 -0600 Subject: [PATCH] add pres submission test vectors --- .../validate_submission.json | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 test-vectors/presentation_exchange/validate_submission.json diff --git a/test-vectors/presentation_exchange/validate_submission.json b/test-vectors/presentation_exchange/validate_submission.json new file mode 100644 index 0000000..9ba19ec --- /dev/null +++ b/test-vectors/presentation_exchange/validate_submission.json @@ -0,0 +1,199 @@ +{ + "description":"Validate submission", + "vectors":[ + { + "description":"valid simple presentation submission", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + ] + } + }, + "errors":false + }, + { + "description":"valid presentation submission with path nested", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + } + } + ] + } + }, + "errors":false + }, + { + "description":"empty pres submission id", + "input":{ + "presentationSubmission":{ + "id":"", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + ] + } + }, + "errors":true + }, + { + "description":"definition id is empty", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + ] + } + }, + "errors":true + }, + { + "description":"empty descriptor map", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[] + } + }, + "errors":true + }, + { + "description":"descriptor map has empty id", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + ] + } + }, + "errors":true + }, + { + "description":"descriptor map has empty format", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"", + "path": "$.verifiableCredential[0]" + } + ] + } + }, + "errors":true + }, + { + "description":"descriptor map has empty path", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "" + } + ] + } + }, + "errors":true + }, + { + "description":"path nested has different id", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"different-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]" + } + } + } + ] + } + }, + "errors":true + }, + { + "description":"path nested has invliad path", + "input":{ + "presentationSubmission":{ + "id":"test-submission-id", + "definition_id":"test-definition-id", + "descriptor_map":[ + { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.verifiableCredential[0]", + "path_nested" : { + "id":"descriptor-map-id", + "format":"jwt_vc", + "path": "$.store.book[(@.price == 10]" + } + } + } + ] + } + }, + "errors":true + } + ] +} \ No newline at end of file