From 5867f7e4a1df6a502ee590620bbe0ebc14034a01 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Nov 2021 15:10:46 +0100 Subject: add uuid-display to reducer and document it --- doc/sphinx/reducer.rst | 7 +++++-- src/reducer/anastasis_api_recovery_redux.c | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/sphinx/reducer.rst b/doc/sphinx/reducer.rst index 1c69971..b091c1d 100644 --- a/doc/sphinx/reducer.rst +++ b/doc/sphinx/reducer.rst @@ -1307,12 +1307,14 @@ a state where the user can choose which challenges to satisfy: "challenges": [ { "uuid": "MW2R3RCBZPHNC78AW8AKWRCHF9KV3Y82EN62T831ZP54S3K5599G", + "uuid-display": "MW2R3RC", "cost": "TESTKUDOS:0", "type": "question", "instructions": "q1" }, { "uuid": "TXYKGE1SJZHJ4M2FKSV1P2RZVNTHZFB9E3A79QE956D3SCAWXPK0", + "uuid-display": "TXYKGE", "cost": "TESTKUDOS:0", "type": "email", "instructions": "e-mail address m?il@f*.bar" @@ -1347,8 +1349,9 @@ obtained and its ``version`` are also provided. Each challenge comes with four mandatory fields: - **uuid**: A unique identifier of the challenge; this is what the - UUIDs in the policies array refer to, but also this UUID may be - included in messages sent to the user. They allow the user to + UUIDs in the policies array refer to. + - **uuid-display**: Shortened idenfier which is included in messages + send to the user. Allows the user to distinguish different PIN/TANs should say the same phone number be used for SMS-authentication with different providers. - **cost**: This is the amount the Anastasis provider will charge diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c index eba5229..2cffacf 100644 --- a/src/reducer/anastasis_api_recovery_redux.c +++ b/src/reducer/anastasis_api_recovery_redux.c @@ -2593,6 +2593,8 @@ policy_lookup_cb (void *cls, : &cost), GNUNET_JSON_pack_string ("type", cd->type), + GNUNET_JSON_pack_string ("uuid-display", + ANASTASIS_CRYPTO_uuid2s (&cd->uuid)), GNUNET_JSON_pack_string ("instructions", cd->instructions)); GNUNET_assert (0 == -- cgit v1.2.3