challenger

OAuth 2.0-based authentication service that validates user can receive messages at a certain address
Log | Files | Refs | Submodules | README | LICENSE

commit 10d8e79e54ecbba07f9f9f9cb0f119ab6817ee74
parent 1020675832109df580a24ce0403cd8a49f026c73
Author: Florian Dold <dold@taler.net>
Date:   Mon, 24 Aug 2026 22:51:33 +0200

challenger: report validation process expiration

Diffstat:
Msrc/challenger/challenger-httpd_config.c | 3++-
Msrc/challenger/challenger-httpd_setup.c | 5++++-
Msrc/challenger/test-challenger.conf | 3+++
Msrc/challenger/test-challenger.sh | 8++++++++
4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/src/challenger/challenger-httpd_config.c b/src/challenger/challenger-httpd_config.c @@ -46,6 +46,7 @@ * is; an unusable Content-Type gives 415 rather than 400; and /token * and /info always carry the RFC 6749 "error" member plus a full * RFC 6750 "WWW-Authenticate" challenge. + * 9: /setup returns the expiration time of the validation process. */ @@ -74,7 +75,7 @@ CH_handler_config (struct CH_HandlerContext *hc, GNUNET_JSON_pack_object_incref ("restrictions", CH_restrictions), GNUNET_JSON_pack_string ("version", - "8:0:6")); + "9:0:7")); } return MHD_queue_response (hc->connection, MHD_HTTP_OK, diff --git a/src/challenger/challenger-httpd_setup.c b/src/challenger/challenger-httpd_setup.c @@ -273,6 +273,9 @@ CH_handler_setup (struct CH_HandlerContext *hc, hc->connection, MHD_HTTP_OK, GNUNET_JSON_pack_data_auto ("nonce", - &nonce)); + &nonce), + GNUNET_JSON_pack_timestamp ( + "expires", + GNUNET_TIME_absolute_to_timestamp (expiration_time))); } } diff --git a/src/challenger/test-challenger.conf b/src/challenger/test-challenger.conf @@ -9,6 +9,9 @@ ADDRESS_TYPE = file-access # Base URL BASE_URL = http://localhost/ +# Make the expected /setup expiration deterministic for the test. +VALIDATION_DURATION = 1 h + [challengerdb-postgres] #The connection string the plugin has to use for connecting to the database CONFIG = postgres:///talercheck diff --git a/src/challenger/test-challenger.sh b/src/challenger/test-challenger.sh @@ -85,6 +85,7 @@ fi echo -n "Setup new validation process..." +SETUP_TIME=$(date +%s) STATUS=$(curl "${BURL}/setup/${CLIENT_ID}" \ -H "Authorization: Bearer ${CLIENT_SECRET}" \ -d '' \ @@ -95,6 +96,13 @@ then exit_fail "Expected 200 OK. Got: $STATUS" $(cat $LAST_RESPONSE) fi NONCE=$(jq -r .nonce < "$LAST_RESPONSE") +EXPIRES=$(jq -er '.expires.t_s | numbers' < "$LAST_RESPONSE") || \ + exit_fail "Expected a finite expires timestamp in the /setup response" +if [ "$EXPIRES" -lt "$((SETUP_TIME + 3590))" ] || \ + [ "$EXPIRES" -gt "$((SETUP_TIME + 3610))" ] +then + exit_fail "Expected /setup expiration about one hour in the future, got $EXPIRES" +fi echo " OK" CLIENT_STATE="the-client-state"