oauth-backend/addon/init.py

16 lines
477 B
Python

from mitmproxy import http
import asyncio
from pkce_check import PKCEDowngradeChecker
class PKCEAddon:
def __init__(self):
self.checker = PKCEDowngradeChecker()
async def request(self, flow: http.HTTPFlow):
print(f"[DEBUG] Processing request: {flow.request.method} {flow.request.pretty_url}")
try:
await self.checker.test(flow)
except Exception as e:
print(f"[ERROR] Addon failed: {e}")
addons = [PKCEAddon()]