From 9390a79ccab14b07880ca46af2b639784b7fb072 Mon Sep 17 00:00:00 2001 From: Fitti Date: Tue, 22 Jun 2021 17:06:56 +0200 Subject: [PATCH] Validate api_post_donation requests --- lnbits/extensions/twitchalerts/views_api.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lnbits/extensions/twitchalerts/views_api.py b/lnbits/extensions/twitchalerts/views_api.py index 893b53e8..24637358 100644 --- a/lnbits/extensions/twitchalerts/views_api.py +++ b/lnbits/extensions/twitchalerts/views_api.py @@ -77,20 +77,11 @@ async def api_create_donation(): @twitchalerts_ext.route("/api/v1/postdonation", methods=["POST"]) -# @api_validate_post_request( -# schema={ -# "id": {"type": "string", "required": True}, -# "description": {"type": "string", "allow_unknown": True}, -# "onchainaddress": {"type": "string", "allow_unknown": True}, -# "payment_request": {"type": "string", "allow_unknown": True}, -# "payment_hash": {"type": "string", "allow_unknown": True}, -# "time": {"type": "integer", "allow_unknown": True}, -# "amount": {"type": "integer", "allow_unknown": True}, -# "paid": {"type": "boolean", "allow_unknown": True}, -# "timestamp": {"type": "integer", "allow_unknown": True}, -# "completelink": {"type": "string", "allow_unknown": True}, -# } -# ) +@api_validate_post_request( + schema={ + "id": {"type": "string", "required": True}, + } +) async def api_post_donation(): """Posts a paid donation to Stremalabs/StreamElements.