diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-31 18:26:49 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-31 18:26:49 +0100 |
commit | 0919fe8b52588bd8f3adb83817158abc9434ac5b (patch) | |
tree | 4380e205a4e7dc49543c03c312eb332c5b92160b | |
parent | 33152ae6d820ccf638498ddf264e011540e419a7 (diff) | |
download | anastasis-0919fe8b52588bd8f3adb83817158abc9434ac5b.tar.gz anastasis-0919fe8b52588bd8f3adb83817158abc9434ac5b.zip |
document and shorten default payment timeout (fixes #7073)
-rw-r--r-- | doc/sphinx/rest.rst | 4 | ||||
-rw-r--r-- | src/backend/anastasis-httpd_policy.c | 7 | ||||
-rw-r--r-- | src/backend/anastasis-httpd_policy_upload.c | 2 | ||||
-rw-r--r-- | src/backend/anastasis-httpd_truth.c | 7 |
4 files changed, 3 insertions, 17 deletions
diff --git a/doc/sphinx/rest.rst b/doc/sphinx/rest.rst index 9127354..605fc9f 100644 --- a/doc/sphinx/rest.rst +++ b/doc/sphinx/rest.rst | |||
@@ -216,7 +216,7 @@ In the following, UUID is always defined and used according to `RFC 4122`_. | |||
216 | :query timeout_ms=NUMBER: *Optional.* If specified, the Anastasis server will | 216 | :query timeout_ms=NUMBER: *Optional.* If specified, the Anastasis server will |
217 | wait up to ``timeout_ms`` milliseconds for completion of the payment before | 217 | wait up to ``timeout_ms`` milliseconds for completion of the payment before |
218 | sending the HTTP response. A client must never rely on this behavior, as the | 218 | sending the HTTP response. A client must never rely on this behavior, as the |
219 | backend may return a response immediately. | 219 | backend may return a response immediately. If a ``timeout_ms`` is not given, the Anastasis server may apply a default timeout (usually 30s) when talking to the merchant backend. |
220 | 220 | ||
221 | *If-None-Match*: This header MUST be present and set to the SHA512 hash (Etag) of the body by the client. | 221 | *If-None-Match*: This header MUST be present and set to the SHA512 hash (Etag) of the body by the client. |
222 | The client SHOULD also set the ``Expect: 100-Continue`` header and wait for ``100 continue`` | 222 | The client SHOULD also set the ``Expect: 100-Continue`` header and wait for ``100 continue`` |
@@ -227,7 +227,7 @@ In the following, UUID is always defined and used according to `RFC 4122`_. | |||
227 | 227 | ||
228 | *Anastasis-Policy-Signature*: The client must provide Base-32 encoded EdDSA signature over hash of body with ``$ACCOUNT_PRIV``, affirming desire to upload an encrypted recovery document. | 228 | *Anastasis-Policy-Signature*: The client must provide Base-32 encoded EdDSA signature over hash of body with ``$ACCOUNT_PRIV``, affirming desire to upload an encrypted recovery document. |
229 | 229 | ||
230 | *Payment-Identifier*: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see ``402`` status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the **kdf_id** might be known to an attacker). If this header is missing in the client's request (or the associated payment has exceeded the upload limit), the server must return a ``402`` response. When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request. | 230 | *Payment-Identifier*: Base-32 encoded 32-byte payment identifier that was included in a previous payment (see ``402`` status code). Used to allow the server to check that the client paid for the upload (to protect the server against DoS attacks) and that the client knows a real secret of financial value (as the **kdf_id** might be known to an attacker). If this header is missing in the client's request (or the associated payment has exceeded the upload limit), the server must return a ``402`` response. When making payments, the server must include a fresh, randomly-generated payment-identifier in the payment request. If a payment identifier is given, the Anastasis backend may block for the payment to be confirmed by Taler as specified by the ``timeout_ms`` argument. |
231 | 231 | ||
232 | **Response**: | 232 | **Response**: |
233 | 233 | ||
diff --git a/src/backend/anastasis-httpd_policy.c b/src/backend/anastasis-httpd_policy.c index 6e206a2..99ed719 100644 --- a/src/backend/anastasis-httpd_policy.c +++ b/src/backend/anastasis-httpd_policy.c | |||
@@ -30,13 +30,6 @@ | |||
30 | #include <taler/taler_merchant_service.h> | 30 | #include <taler/taler_merchant_service.h> |
31 | #include <taler/taler_signatures.h> | 31 | #include <taler/taler_signatures.h> |
32 | 32 | ||
33 | /** | ||
34 | * How long do we hold an HTTP client connection if | ||
35 | * we are awaiting payment before giving up? | ||
36 | */ | ||
37 | #define CHECK_PAYMENT_GENERIC_TIMEOUT GNUNET_TIME_relative_multiply ( \ | ||
38 | GNUNET_TIME_UNIT_MINUTES, 30) | ||
39 | |||
40 | 33 | ||
41 | /** | 34 | /** |
42 | * Return the current recoverydocument of @a account on @a connection | 35 | * Return the current recoverydocument of @a account on @a connection |
diff --git a/src/backend/anastasis-httpd_policy_upload.c b/src/backend/anastasis-httpd_policy_upload.c index 4c86241..11f15e2 100644 --- a/src/backend/anastasis-httpd_policy_upload.c +++ b/src/backend/anastasis-httpd_policy_upload.c | |||
@@ -35,7 +35,7 @@ | |||
35 | * we are awaiting payment before giving up? | 35 | * we are awaiting payment before giving up? |
36 | */ | 36 | */ |
37 | #define CHECK_PAYMENT_GENERIC_TIMEOUT GNUNET_TIME_relative_multiply ( \ | 37 | #define CHECK_PAYMENT_GENERIC_TIMEOUT GNUNET_TIME_relative_multiply ( \ |
38 | GNUNET_TIME_UNIT_MINUTES, 30) | 38 | GNUNET_TIME_UNIT_SECONDS, 30) |
39 | 39 | ||
40 | 40 | ||
41 | /** | 41 | /** |
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c index 54969bf..2a80cb7 100644 --- a/src/backend/anastasis-httpd_truth.c +++ b/src/backend/anastasis-httpd_truth.c | |||
@@ -38,13 +38,6 @@ | |||
38 | GNUNET_TIME_UNIT_SECONDS, 30) | 38 | GNUNET_TIME_UNIT_SECONDS, 30) |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * How long do we hold an HTTP client connection if | ||
42 | * we are awaiting payment before giving up? | ||
43 | */ | ||
44 | #define CHECK_PAYMENT_GENERIC_TIMEOUT GNUNET_TIME_relative_multiply ( \ | ||
45 | GNUNET_TIME_UNIT_MINUTES, 30) | ||
46 | |||
47 | /** | ||
48 | * How long should the wallet check for auto-refunds before giving up? | 41 | * How long should the wallet check for auto-refunds before giving up? |
49 | */ | 42 | */ |
50 | #define AUTO_REFUND_TIMEOUT GNUNET_TIME_relative_multiply ( \ | 43 | #define AUTO_REFUND_TIMEOUT GNUNET_TIME_relative_multiply ( \ |