diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-27 11:31:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-27 11:31:09 +0200 |
commit | 06825b77136e5b978b10152583fff594ae0206a3 (patch) | |
tree | 3bdcd28b79108091ca5ade8deba5ae815c7bb677 | |
parent | 43d3e62ab5321cfcbe1e4d7e77601f3f251a4a2a (diff) | |
parent | 27149117a486a8f339c6a3e19740c9ff91ea205e (diff) | |
download | merchant-06825b77136e5b978b10152583fff594ae0206a3.tar.gz merchant-06825b77136e5b978b10152583fff594ae0206a3.tar.bz2 merchant-06825b77136e5b978b10152583fff594ae0206a3.zip |
Merge branch 'master' of git+ssh://git.taler.net/merchant
-rw-r--r-- | src/merchant-tools/taler-merchant-setup-reserve.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/merchant-tools/taler-merchant-setup-reserve.c b/src/merchant-tools/taler-merchant-setup-reserve.c index 66ece5af..b229af39 100644 --- a/src/merchant-tools/taler-merchant-setup-reserve.c +++ b/src/merchant-tools/taler-merchant-setup-reserve.c @@ -87,6 +87,11 @@ static char *certfile; static char *keyfile; /** + * This value goes in the Authorization:-header. + */ +static char *apikey; + +/** * Passphrase to decrypt client's TLS private key file (optional). */ static char *keypass; @@ -189,6 +194,18 @@ run (void *cls, certfile, keyfile, keypass); + if (NULL != apikey) + { + // not assuming that libcurl copies this value. + char *auth_header; + + GNUNET_assert (GNUNET_OK == GNUNET_asprintf (&auth_header, + "Authorizattion: ApiKey %s", + apikey)); + GNUNET_CURL_append_header (ctx, + auth_header); + } + /* setup termination logic */ GNUNET_SCHEDULER_add_shutdown (&do_shutdown, NULL); @@ -261,6 +278,11 @@ main (int argc, "KEYFILEPASSPHRASE", "passphrase needed to decrypt the TLS client private key file", &keypass), + GNUNET_GETOPT_option_string ('K', + "apikey", + "APIKEY", + "API key to use in the HTTP request", + &apikey), GNUNET_GETOPT_option_string ('t', "type", "CERTTYPE", |