mirror of
https://github.com/j93es/browser-use-oauth.git
synced 2026-06-04 10:51:53 +09:00
[Refactor] 리팩터링
This commit is contained in:
parent
26b40e0e65
commit
bbd2d6d636
20 changed files with 397 additions and 257 deletions
35
main.py
35
main.py
|
|
@ -3,18 +3,18 @@ import argparse
|
|||
import signal
|
||||
from dotenv import load_dotenv
|
||||
from lib.config import BACKEND_URL
|
||||
from lib.utils.notify_backend import notify_backend
|
||||
from lib.utils.is_html import is_html_url
|
||||
from lib.utils.read_txt import read_lines_between
|
||||
from lib.utils.progress_checker import save_progress, load_progress
|
||||
from lib.utils.env_checker import check_env_variables
|
||||
from lib.agents.get_sso_list import get_sso_list
|
||||
from lib.utils import notify_backend, is_html_url, read_lines_between, save_progress, load_progress, check_env_variables
|
||||
from lib.agents import get_sso_list, login_google
|
||||
load_dotenv()
|
||||
|
||||
check_env_variables()
|
||||
|
||||
backend_url = BACKEND_URL
|
||||
|
||||
login_agents = {
|
||||
"google": login_google
|
||||
}
|
||||
|
||||
# ── URL별로 Browser를 새로 띄우는 함수 ──
|
||||
async def scan_one_url(url: str, skip_html_check: bool = False):
|
||||
target_url = url if url.startswith("http") else f"https://{url}"
|
||||
|
|
@ -28,7 +28,28 @@ async def scan_one_url(url: str, skip_html_check: bool = False):
|
|||
# Backend에 스캔 시작 알림
|
||||
notify_backend(target_url)
|
||||
|
||||
print(await get_sso_list(target_url))
|
||||
success, response = await get_sso_list(target_url)
|
||||
if not success:
|
||||
return
|
||||
if len(response.sso_list) == 0:
|
||||
return
|
||||
|
||||
for sso in response.sso_list:
|
||||
target_login_agent = login_agents.get(sso.lower())
|
||||
if target_login_agent:
|
||||
print(f"🔍 {target_url} 에서 SSO 발견: {sso}, 로그인 시도 중...")
|
||||
success, login_response = await target_login_agent(target_url)
|
||||
if not success:
|
||||
print(f"⚠️ {target_url} 에서 {sso} 로그인 실패")
|
||||
continue
|
||||
|
||||
print(f"✅ {target_url} 에서 {sso} 로그인 성공: {login_response.final_url}")
|
||||
else:
|
||||
print(f"✅ {target_url} 에서 SSO 발견: {sso} | TODO")
|
||||
|
||||
# Backend에 스캔 완료 알림
|
||||
# 오탐 검증
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue