-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (23 loc) · 1.01 KB
/
app.py
File metadata and controls
30 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from flask import Flask, request, jsonify
import hashlib
app = Flask(__name__)
# Replace with your actual values
VERIFICATION_TOKEN = "F7hP_A2t-98sMqd3RHLwXyZbG4KjN9ufC0E6DkV3"
ENDPOINT_URL = "https://ebay-kvyi.onrender.com/account-deletion"
@app.route("/account-deletion", methods=["GET", "POST"])
def account_deletion():
if request.method == "GET":
# Handle eBay challenge
challenge_code = request.args.get("challenge_code")
if not challenge_code:
return "Missing challenge_code", 400
raw_string = challenge_code + VERIFICATION_TOKEN + ENDPOINT_URL
challenge_response = hashlib.sha256(raw_string.encode("utf-8")).hexdigest()
return jsonify({"challengeResponse": challenge_response}), 200
elif request.method == "POST":
# Handle actual deletion event
data = request.json
print("Received account deletion event:", data)
return "", 200
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)