challenger

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

commit 429588f8144d87d49a342fdd8b3e75bf3af9fae0
parent 3814f5fcbdeccde198dc4d04b645526207fe25e9
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Fri, 22 May 2026 13:42:01 +0200

meson fmt, attempt fix tests

Diffstat:
Mdoc/meson.build | 23+++++++++++------------
Mflake.nix | 1+
Mmeson.build | 18+++++++++---------
Msrc/challenger/cat.sh | 2+-
Msrc/challenger/meson.build | 92+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Msrc/challenger/test-challenger-pkce.sh | 2+-
Msrc/challenger/test-challenger-revisit.sh | 2+-
Msrc/challenger/test-challenger.sh | 2+-
Msrc/challengerdb/meson.build | 72++++++++++++++++++++++++++++++++++++++++--------------------------------
Msrc/include/meson.build | 6+++---
Msrc/util/meson.build | 4+---
11 files changed, 117 insertions(+), 107 deletions(-)

diff --git a/doc/meson.build b/doc/meson.build @@ -1,20 +1,19 @@ # This file is in the public domain -install_man([ - 'prebuilt'/'man'/'challenger-admin.1', - 'prebuilt'/'man'/'challenger-config.1', - 'prebuilt'/'man'/'challenger-dbconfig.1', - 'prebuilt'/'man'/'challenger-dbinit.1', - 'prebuilt'/'man'/'challenger-httpd.1', - 'prebuilt'/'man'/'challenger.conf.5', - ],) +install_man( + [ + 'prebuilt' / 'man' / 'challenger-admin.1', + 'prebuilt' / 'man' / 'challenger-config.1', + 'prebuilt' / 'man' / 'challenger-dbconfig.1', + 'prebuilt' / 'man' / 'challenger-dbinit.1', + 'prebuilt' / 'man' / 'challenger-httpd.1', + 'prebuilt' / 'man' / 'challenger.conf.5', + ], +) fs = import('fs') -fs.copyfile( - 'prebuilt' / 'texinfo' / 'challenger.texi', - 'challenger.texi', -) +fs.copyfile('prebuilt' / 'texinfo' / 'challenger.texi', 'challenger.texi') makeinfo = find_program('makeinfo', native: true, required: false) diff --git a/flake.nix b/flake.nix @@ -109,6 +109,7 @@ pkgs.libnfc exchangepkgs.exchange pkgs.python3 + pkgs.jq #donaupkgs.donau #merchantpkgs.merchant ]; diff --git a/meson.build b/meson.build @@ -1,5 +1,5 @@ - project( - 'challenger', +project( + 'challenger', 'c', license: 'AGPLv3', meson_version: '>=1.1.0', @@ -185,10 +185,7 @@ if not get_option('only-doc') 'taler/taler_pq_lib.h', 'TALER_PQ_query_param_array_blinded_denom_sig', required: true, - dependencies: [ - talerpq_dep, - pq_dep, - ], + dependencies: [talerpq_dep, pq_dep], ) private_config.set10('HAVE_TALERPQ', talerpq_dep.found()) @@ -222,7 +219,10 @@ if not get_option('only-doc') # Used to populate configuration file and script templates - libltversions = [['libchallengerutil', '0:1:0'], ['libchallengerdb', '0:1:0']] + libltversions = [ + ['libchallengerutil', '0:1:0'], + ['libchallengerdb', '0:1:0'], + ] solibversions = {} @@ -235,8 +235,8 @@ if not get_option('only-doc') ltversion_str = '@0@.@1@.@2@'.format(current - age, age, revision) solibversions = solibversions + { libversion[0]: { - 'soversion': soversion_str, - 'version': ltversion_str, + 'soversion': soversion_str, + 'version': ltversion_str, }, } endforeach diff --git a/src/challenger/cat.sh b/src/challenger/cat.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. cat - > "$(echo $1 | jq -r ".filename")" exit 0 diff --git a/src/challenger/meson.build b/src/challenger/meson.build @@ -3,48 +3,52 @@ tmpldatadir = get_option('datadir') / 'challenger' / 'templates' dist_tmpldata_DATA = \ -install_data( - 'default-challenge-message.txt', - install_dir: tmpldatadir, - ) + install_data('default-challenge-message.txt', install_dir: tmpldatadir) -install_data( - 'challenger.conf', - install_dir: pkgcfgdir -) +install_data('challenger.conf', install_dir: pkgcfgdir) bin_SCRIPTS = [ - 'challenger-send-email', - 'challenger-send-post', - 'challenger-send-sms', - 'challenger-send-sms-clicksend', - 'challenger-send-sms-telesign', - ] + 'challenger-send-email', + 'challenger-send-post', + 'challenger-send-sms', + 'challenger-send-sms-clicksend', + 'challenger-send-sms-telesign', +] foreach s : bin_SCRIPTS - configure_file( - input: s, - output: s, - install_dir: get_option('bindir'), - copy: true, + configure_file( + input: s, + output: s, + install_dir: get_option('bindir'), + copy: true, ) endforeach check_SCRIPTS = [ - 'test-challenger', - 'test-challenger-pkce', - 'test-challenger-revisit', - ] + 'test-challenger', + 'test-challenger-pkce', + 'test-challenger-revisit', +] + +test_helper_cat = configure_file(input: 'cat.sh', output: 'cat.sh', copy: true) + +test_conf = configure_file( + input: 'test-challenger.conf', + output: 'test-challenger.conf', + copy: true, +) foreach s : check_SCRIPTS - tscript = '@0@.sh'.format(s) - test_exe = configure_file( - input: tscript, - output: tscript, - copy: true, - ) - test(s, test_exe, workdir: meson.current_build_dir(), suite: ['challenger'], is_parallel: false) + tscript = '@0@.sh'.format(s) + test_exe = configure_file(input: tscript, output: tscript, copy: true) + test( + s, + test_exe, + workdir: meson.current_build_dir(), + suite: ['challenger'], + is_parallel: false, + ) endforeach executable( @@ -62,20 +66,20 @@ executable( challenger_httpd_SOURCES = [ - 'challenger_cm_enums.c', - 'challenger-httpd.c', - 'challenger-httpd_agpl.c', - 'challenger-httpd_spa.c', - 'challenger-httpd_authorize.c', - 'challenger-httpd_challenge.c', - 'challenger-httpd_common.c', - 'challenger-httpd_config.c', - 'challenger-httpd_info.c', - 'challenger-httpd_mhd.c', - 'challenger-httpd_setup.c', - 'challenger-httpd_solve.c', - 'challenger-httpd_token.c', - ] + 'challenger_cm_enums.c', + 'challenger-httpd.c', + 'challenger-httpd_agpl.c', + 'challenger-httpd_spa.c', + 'challenger-httpd_authorize.c', + 'challenger-httpd_challenge.c', + 'challenger-httpd_common.c', + 'challenger-httpd_config.c', + 'challenger-httpd_info.c', + 'challenger-httpd_mhd.c', + 'challenger-httpd_setup.c', + 'challenger-httpd_solve.c', + 'challenger-httpd_token.c', +] executable( 'challenger-httpd', diff --git a/src/challenger/test-challenger-pkce.sh b/src/challenger/test-challenger-pkce.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. set -eu diff --git a/src/challenger/test-challenger-revisit.sh b/src/challenger/test-challenger-revisit.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. # # Tests that re-submitting to /challenge for an already-solved diff --git a/src/challenger/test-challenger.sh b/src/challenger/test-challenger.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This file is in the public domain. # # Tests happy path of challenger mostly. diff --git a/src/challengerdb/meson.build b/src/challengerdb/meson.build @@ -1,9 +1,6 @@ # This file is in the public domain -install_data( - 'challenger_db_postgres.conf', - install_dir: pkgcfgdir - ) +install_data('challenger_db_postgres.conf', install_dir: pkgcfgdir) sqldir = get_option('datadir') / 'challenger' / 'sql' @@ -12,11 +9,11 @@ sqldir = get_option('datadir') / 'challenger' / 'sql' run_command('make', '-f', 'Makefile.sql', 'all', check: true) sql_DATA = [ - 'versioning.sql', - 'procedures.sql', - 'challenger-0001.sql', - 'challenger-0002.sql', - 'drop.sql', + 'versioning.sql', + 'procedures.sql', + 'challenger-0001.sql', + 'challenger-0002.sql', + 'drop.sql', ] install_data(sources: sql_DATA, install_dir: sqldir) @@ -29,24 +26,24 @@ endforeach libchallengerdb_SOURCES = [ - 'address_get.c', - 'client_add.c', - 'client_modify.c', - 'client_delete.c', - 'client_check.c', - 'create_tables.c', - 'drop_tables.c', - 'gc.c', - 'info_get_token.c', - 'token_add_token.c', - 'setup_nonce.c', - 'preflight.c', - 'pg.c', - 'authorize_start.c', - 'challenge_set_address_and_pin.c', - 'validate_solve_pin.c', - 'validation_get.c', - 'validation_get_pkce.c', + 'address_get.c', + 'client_add.c', + 'client_modify.c', + 'client_delete.c', + 'client_check.c', + 'create_tables.c', + 'drop_tables.c', + 'gc.c', + 'info_get_token.c', + 'token_add_token.c', + 'setup_nonce.c', + 'preflight.c', + 'pg.c', + 'authorize_start.c', + 'challenge_set_address_and_pin.c', + 'validate_solve_pin.c', + 'validation_get.c', + 'validation_get_pkce.c', ] libchallengerdb = library( 'challengerdb', @@ -76,21 +73,32 @@ pkg.generate( executable( 'challenger-dbinit', ['challenger-dbinit.c'], - dependencies: [libchallengerutil_dep, libchallengerdb_dep, gnunetutil_dep, talerutil_dep], + dependencies: [ + libchallengerutil_dep, + libchallengerdb_dep, + gnunetutil_dep, + talerutil_dep, + ], include_directories: [incdir, configuration_inc], install: true, ) configure_file( - input: 'test_challenger_db_postgres.conf', - output: 'test_challenger_db_postgres.conf', - copy: true, + input: 'test_challenger_db_postgres.conf', + output: 'test_challenger_db_postgres.conf', + copy: true, ) test_challenger_db_postgres = executable( 'test_challenger_db-postgres', ['test_challenger_db.c'], - dependencies: [gnunetutil_dep, libchallengerutil_dep, libchallengerdb_dep, gnunetpq_dep, talerutil_dep], + dependencies: [ + gnunetutil_dep, + libchallengerutil_dep, + libchallengerdb_dep, + gnunetpq_dep, + talerutil_dep, + ], include_directories: [incdir, configuration_inc], build_by_default: false, install: false, diff --git a/src/include/meson.build b/src/include/meson.build @@ -1,6 +1,6 @@ # This file is in the public domain install_data( - 'challenger_util.h', - install_dir: get_option('includedir') / 'challenger' - ) + 'challenger_util.h', + install_dir: get_option('includedir') / 'challenger', +) diff --git a/src/util/meson.build b/src/util/meson.build @@ -14,9 +14,7 @@ libchallengerutil = library( soversion: solibversions['libchallengerutil']['soversion'], version: solibversions['libchallengerutil']['soversion'], install_rpath: rpath_option, - dependencies: [ - gnunetutil_dep, - ], + dependencies: [gnunetutil_dep], include_directories: [incdir, configuration_inc], install: true, install_dir: get_option('libdir'),