mirror of
https://github.com/j93es/oauth-backend.git
synced 2026-06-04 08:11:52 +09:00
[Update] csrf
This commit is contained in:
parent
e91b2738e1
commit
5fe33564d6
5 changed files with 200 additions and 14 deletions
|
|
@ -2,7 +2,7 @@ from mitmproxy import http
|
|||
import asyncio
|
||||
from pkce_check import PKCEDowngradeChecker
|
||||
from ScopeDetection import ScopeDetection
|
||||
|
||||
from csrf_check import CsrfChecker
|
||||
|
||||
class PKCEAddon:
|
||||
def __init__(self):
|
||||
|
|
@ -16,7 +16,21 @@ class PKCEAddon:
|
|||
await self.checker.test(flow)
|
||||
except Exception as e:
|
||||
print(f"[ERROR] Addon failed: {e}")
|
||||
pass
|
||||
|
||||
|
||||
class CsrfAddon:
|
||||
def __init__(self):
|
||||
self.checker = CsrfChecker()
|
||||
|
||||
async def response(self, flow: http.HTTPFlow):
|
||||
try:
|
||||
await self.checker.response(flow)
|
||||
except Exception as e:
|
||||
print(f"[ERROR] CSRF Addon failed: {e}")
|
||||
pass
|
||||
|
||||
|
||||
class ScopeAddon:
|
||||
def __init__(self):
|
||||
self.checker = ScopeDetection()
|
||||
|
|
@ -35,5 +49,4 @@ class ScopeAddon:
|
|||
except Exception as e:
|
||||
print(f"[ERROR] ScopeDetection failed: {e}")
|
||||
|
||||
|
||||
addons = [PKCEAddon(), ScopeAddon()]
|
||||
addons = [PKCEAddon(), ScopeAddon(), CsrfAddon()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue