challenger

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

commit 93f42dd13e38027396690eec8973641d573b4e2e
parent d7ac734976dcc79a178b25ade0df337658f0b156
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon,  7 Apr 2025 22:11:46 +0200

-fix tests

Diffstat:
Msrc/challenger/challenger-httpd_info.c | 5+----
Msrc/challenger/test-challenger-pkce.conf | 3+++
Msrc/challenger/test-challenger-pkce.sh | 4+++-
Msrc/challenger/test-challenger.conf | 3+++
Msrc/challenger/test-challenger.sh | 4+++-
5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/challenger/challenger-httpd_info.c b/src/challenger/challenger-httpd_info.c @@ -83,7 +83,6 @@ CH_handler_info (struct CH_HandlerContext *hc, json_t *address; enum GNUNET_DB_QueryStatus qs; struct GNUNET_TIME_Timestamp address_expiration; - MHD_RESULT mret; qs = CH_db->info_get_token (CH_db->cls, &grant, @@ -109,8 +108,7 @@ CH_handler_info (struct CH_HandlerContext *hc, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: break; } - - mret = TALER_MHD_REPLY_JSON_PACK ( + return TALER_MHD_REPLY_JSON_PACK ( hc->connection, MHD_HTTP_OK, GNUNET_JSON_pack_uint64 ("id", @@ -121,6 +119,5 @@ CH_handler_info (struct CH_HandlerContext *hc, CH_address_type), GNUNET_JSON_pack_timestamp ("expires", address_expiration)); - return mret; } } diff --git a/src/challenger/test-challenger-pkce.conf b/src/challenger/test-challenger-pkce.conf @@ -6,6 +6,9 @@ AUTH_COMMAND = cat.sh # What address type are we validating? (SMS, e-mail, etc.) ADDRESS_TYPE = file-access +# Base URL +BASE_URL = http://localhost/ + [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-pkce.sh b/src/challenger/test-challenger-pkce.sh @@ -32,6 +32,8 @@ FILENAME="test-challenger-pkce.txt" # Install cleanup handler (except for kill -9) trap cleanup EXIT +export PATH="$PATH:." + echo -n "Testing for jq" jq -h > /dev/null || exit_skip "jq required" echo " FOUND" @@ -134,7 +136,7 @@ then fi echo "OK" -PIN=$(cat ${FILENAME} | awk '{print $2}') +PIN=$(cat ${FILENAME} | awk '{print $5}') echo -n "Initiating PIN ${PIN} submission..." RESULT=$(curl "${BURL}/solve/${NONCE}" \ diff --git a/src/challenger/test-challenger.conf b/src/challenger/test-challenger.conf @@ -6,6 +6,9 @@ AUTH_COMMAND = cat.sh # What address type are we validating? (SMS, e-mail, etc.) ADDRESS_TYPE = file-access +# Base URL +BASE_URL = http://localhost/ + [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 @@ -32,6 +32,8 @@ FILENAME="test-challenger.txt" # Install cleanup handler (except for kill -9) trap cleanup EXIT +export PATH="$PATH:." + echo -n "Testing for jq" jq -h > /dev/null || exit_skip "jq required" echo " FOUND" @@ -128,7 +130,7 @@ then fi echo "OK" -PIN=$(cat ${FILENAME} | awk '{print $2}') +PIN=$(cat ${FILENAME} | awk '{print $5}') echo -n "Initiating PIN ${PIN} submission..." RESULT=$(curl "${BURL}/solve/${NONCE}" \