View Issue Details

IDProjectCategoryView StatusLast Update
0009715Talerexchange KYC SPApublic2025-04-09 19:35
ReporterChristian Grothoff Assigned Tosebasjm  
PrioritynormalSeverityblockReproducibilityhave not tried
Status resolvedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version1.0 
Summary0009715: ID document upload broken
DescriptionThe JSON contains:

   "PERSONAL_IDENTIFICATION_DOCUMENT_COPY": {
     "text": "[object Object]"
   }

So instead of the actual file (with meta data) literally the string "[object Object]". That's what's uploaded to the exchange, this is not some rendering I'm doing AFAIK.
Steps To ReproduceUploaded a PDF to VQF 902.1 for the identification document of a natural person, hit submit.
TagsNo tags attached.

Activities

sebasjm

2025-04-09 00:10

developer   ~0024455

The problem comes in the conversion from the FORM validated object in the SPA to the type of data expected by the exchange currenty 'application/x-www-form-urlencoded'
I changed the SPA to send `application/json` as all other endpoints but the server doesn't accept that.


This is how the SPA is sending the form data
$ curl 'http://exchange.taler.test:1180/kyc-upload/HJWD970B6PA1P8VAF091MNCY04K185SNZ0Z6AXVT93KD99899C20-0-3' -H 'Accept: application/json' -H 'Content-Type: application/x-www-form-urlencoded' --data-raw 'DOWNLOADED_TERMS_OF_SERVICE=true&ACCEPTED_TERMS_OF_SERVICE=true'


Which I think it is later converted to the `$FIELD_NAME: { text: $FIELD_VALUE }` and also breaking other things like the document upload mentioned in the issue.

This is how it should be posted. But server returns 500
$ curl 'http://exchange.taler.test:1180/kyc-upload/HJWD970B6PA1P8VAF091MNCY04K185SNZ0Z6AXVT93KD99899C20-0-3' -H 'Content-Type: application/json' --data-raw '{"DOWNLOADED_TERMS_OF_SERVICE":true,"ACCEPTED_TERMS_OF_SERVICE":true}'
{
  "code": 71,
  "hint": "The HTTP server failed to allocate memory. Restarting services periodically can help, especially if Postgres is using excessive amounts of memory. Check with the system administrator to investigate.",
  "detail": "MHD_create_post_processor"
}

sebasjm

2025-04-09 00:27

developer   ~0024456

INFO Handling request (POST) for URL '/kyc-upload/HJWD970B6PA1P8VAF091MNCY04K185SNZ0Z6AXVT93KD99899C20-0-3'
ERROR Assertion failed at taler-exchange-httpd_kyc-upload.c:403.

Christian Grothoff

2025-04-09 11:39

manager   ~0024470

I'll change the exchange to accept JSON uploads (and remove support for URL-encoding/form data).

Christian Grothoff

2025-04-09 11:43

manager   ~0024472

sebasjm: see spec change in taler-docs.git :: 0b30faf8..d555c7f6 => new requirement: "form_id".

Christian Grothoff

2025-04-09 13:19

manager   ~0024473

de59cf30a..7467b99c3 changes the /kyc-upload endpoint to support JSON. Needs to be tested with the new SPA.

sebasjm

2025-04-09 17:05

developer   ~0024483

a235ca87b..d369ae0d8 works the latest api

sebasjm

2025-04-09 17:11

developer   ~0024486

I suggest change form_id to FORM_ID as defined in GANA https://git.taler.net/gana.git/tree/gnu-taler-form-attributes/registry.rec#n1336

I couldn't find any reference in taler-exchange-httpd_kyc-upload.c

the SPA is now sending both fields

Christian Grothoff

2025-04-09 19:35

manager   ~0024489

Sure, FORM_ID is also fine with me. And no, we don't check it yet, I just figured we should make it mandatory.

Did you create the prebuilt and update the exchange submodule?

sebasjm

2025-04-09 19:35

developer   ~0024490

yep

Issue History

Date Modified Username Field Change
2025-04-08 20:24 Christian Grothoff New Issue
2025-04-08 20:24 Christian Grothoff Status new => assigned
2025-04-08 20:24 Christian Grothoff Assigned To => sebasjm
2025-04-09 00:10 sebasjm Note Added: 0024455
2025-04-09 00:27 sebasjm Note Added: 0024456
2025-04-09 00:54 sebasjm Assigned To sebasjm => Christian Grothoff
2025-04-09 11:39 Christian Grothoff Note Added: 0024470
2025-04-09 11:43 Christian Grothoff Note Added: 0024472
2025-04-09 13:19 Christian Grothoff Note Added: 0024473
2025-04-09 13:21 Christian Grothoff Assigned To Christian Grothoff => sebasjm
2025-04-09 17:05 sebasjm Note Added: 0024483
2025-04-09 17:11 sebasjm Note Added: 0024486
2025-04-09 17:11 sebasjm Assigned To sebasjm => Christian Grothoff
2025-04-09 17:11 sebasjm Status assigned => feedback
2025-04-09 19:35 Christian Grothoff Note Added: 0024489
2025-04-09 19:35 Christian Grothoff Assigned To Christian Grothoff => sebasjm
2025-04-09 19:35 Christian Grothoff Status feedback => assigned
2025-04-09 19:35 sebasjm Status assigned => resolved
2025-04-09 19:35 sebasjm Resolution open => fixed
2025-04-09 19:35 sebasjm Note Added: 0024490