added version gateway to the push transactions API to only allow latest versions schemes to enter the APP

Signed-off-by: Jürgen Eckel <juergen@riddleandcode.com>
This commit is contained in:
Jürgen Eckel 2022-12-12 12:03:56 +01:00
parent 0c6d12f6ae
commit 5734a29756
No known key found for this signature in database

View File

@ -92,6 +92,13 @@ class TransactionListApi(Resource):
except ValidationError as e: except ValidationError as e:
return make_error(400, "Invalid transaction ({}): {}".format(type(e).__name__, e)) return make_error(400, "Invalid transaction ({}): {}".format(type(e).__name__, e))
else: else:
if tx_obj.version != Transaction.VERSION:
return make_error(
401,
"Invalid transaction version: The transaction is valid, \
but this node only accepts transaction with higher \
schema version number.",
)
status_code, message = planet.write_transaction(tx_obj, mode) status_code, message = planet.write_transaction(tx_obj, mode)
if status_code == 202: if status_code == 202: