feat: 환경 변수를 설정하고 Google 로그인 힌트 기능을 추가

This commit is contained in:
imnyang 2025-06-15 12:53:07 +09:00
commit 40867acb26
2 changed files with 16 additions and 1 deletions

View file

@ -27,6 +27,10 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: uv sync run: uv sync
- name: Set up environment variables
run: |
echo "GOOGLE_ID=bot.imnya.ng@gmail.com" > .env
- name: Start application and run proxy test - name: Start application and run proxy test
run: | run: |
# Start the application in background # Start the application in background

View file

@ -1,3 +1,4 @@
from json import load
from mitmproxy import http from mitmproxy import http
import asyncio import asyncio
from pkce_check import PKCEDowngradeChecker from pkce_check import PKCEDowngradeChecker
@ -7,6 +8,10 @@ from nonce_check import NonceChecker
from redirect_uri_check import RedirectBypassChecker from redirect_uri_check import RedirectBypassChecker
from access_token import AccessTokenScanner from access_token import AccessTokenScanner
from GoogleLoginHint import GoogleLoginHint from GoogleLoginHint import GoogleLoginHint
import os
from dotenv import load_dotenv
load_dotenv(override=True)
class PKCEAddon: class PKCEAddon:
def __init__(self): def __init__(self):
@ -90,8 +95,14 @@ class RedirectBypassAddon:
class GoogleLoginHintAddon(): class GoogleLoginHintAddon():
def __init__(self) -> None: def __init__(self) -> None:
if os.getenv('GOOGLE_ID'):
self.checker = GoogleLoginHint() self.checker = GoogleLoginHint()
else:
self.checker = None
def request(self, flow: http.HTTPFlow): def request(self, flow: http.HTTPFlow):
if self.checker is None:
return
try: try:
asyncio.run(self.checker.request(flow)) asyncio.run(self.checker.request(flow))
except Exception as e: except Exception as e: