diff options
author | Christian Blättler <blatc2@bfh.ch> | 2023-11-27 07:25:23 +0100 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2023-11-27 07:25:23 +0100 |
commit | 6500ab37f7b14f0a4d163e3325172171fb939390 (patch) | |
tree | 081021108a072cfa794431625600bd8be9d7c853 /src/include | |
parent | 14dae4fd53aaadbf7792eda5aa3158b562ccff3a (diff) | |
parent | 23b109ce4bfa30fba74e3caa7fb1a38d58a36058 (diff) |
Merge branch 'master' into feature/tokens
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/taler_crypto_lib.h | 6 | ||||
-rw-r--r-- | src/include/taler_exchange_service.h | 2 | ||||
-rw-r--r-- | src/include/taler_json_lib.h | 100 | ||||
-rw-r--r-- | src/include/taler_util.h | 11 |
4 files changed, 113 insertions, 6 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 65a28d715..cecd0562e 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -69,8 +69,12 @@ enum TALER_AmlDecisionState /** * An AML decision has concluded that the funds must be frozen. */ - TALER_AML_FROZEN = 2 + TALER_AML_FROZEN = 2, + /** + * Maximum allowed numeric value for AML status. + */ + TALER_AML_MAX = 2 }; diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index d2bf918da..7b9b1dd41 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -2075,7 +2075,7 @@ struct TALER_EXCHANGE_ReserveHistoryEntry struct { /** - * Receiver account information for the outgoing wire transfer. + * Receiver account information for the outgoing wire transfer as a payto://-URI. */ const char *receiver_account_details; diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index 1a1466700..dc8061705 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -355,6 +355,98 @@ struct GNUNET_JSON_Specification TALER_JSON_spec_denom_pub (const char *field, struct TALER_DenominationPublicKey *pk); + +/** + * Generate line in parser specification for error codes. + * + * @param field name of the field + * @param[out] ec error code to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_ec (const char *field, + enum TALER_ErrorCode *ec); + + +/** + * Generate line in parser specification for + * HTTP/HTTPS URLs. + * + * @param field name of the field + * @param[out] url web URL to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_web_url (const char *field, + const char **url); + + +/** + * Generate line in parser specification for + * "payto://" URIs. + * + * @param field name of the field + * @param[out] payto_uri RFC 8905 URI to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_payto_uri (const char *field, + const char **payto_uri); + + +/** + * Generate line in parser specification for AML decision states. + * + * @param field name of the field + * @param[out] aml_state AML state to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_aml_decision (const char *field, + enum TALER_AmlDecisionState *aml_state); + + +/** + * Representation of a protocol version. + */ +struct TALER_JSON_ProtocolVersion +{ + /** + * Current version of the protocol. + */ + unsigned int current; + + /** + * Implementation revision for the @e current + * version. + */ + unsigned int revision; + + /** + * Number of protocol versions this @e revision is + * backwards-compatible with. Subtract this number + * from @a current to get the minimum protocol version + * required from the client. + */ + unsigned int age; +}; + + +/** + * Generate line in parser specification for protocol + * versions (``/config``). The field must be a string + * encoding the version as "$CURRENT:$REVISION:$AGE". + * + * @param field name of the field (usually "version") + * @param[out] current protocol current to initialize + * @param[out] revision protocol revision to initialize + * @param[out] age protocol age to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_version (const char *field, + struct TALER_JSON_ProtocolVersion *ver); + /** * Generate a parser specification for a denomination public key of a given * cipher. @@ -365,10 +457,10 @@ TALER_JSON_spec_denom_pub (const char *field, * @return corresponding field spec */ struct GNUNET_JSON_Specification -TALER_JSON_spec_denom_pub_cipher (const char *field, - enum GNUNET_CRYPTO_BlindSignatureAlgorithm - cipher, - struct TALER_DenominationPublicKey *pk); +TALER_JSON_spec_denom_pub_cipher ( + const char *field, + enum GNUNET_CRYPTO_BlindSignatureAlgorithm cipher, + struct TALER_DenominationPublicKey *pk); /** diff --git a/src/include/taler_util.h b/src/include/taler_util.h index 19dc84fc0..7c2cc6880 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -367,6 +367,17 @@ TALER_url_valid_charset (const char *url); /** + * Test if the URL is a valid "http" (or "https") + * URL (includes test for #TALER_url_valid_charset()). + * + * @param url a string to test if it could be a valid URL + * @return true if @a url is well-formed + */ +bool +TALER_is_web_url (const char *url); + + +/** * Check if @a lang matches the @a language_pattern, and if so with * which preference. * See also: https://tools.ietf.org/html/rfc7231#section-5.3.1 |