# Path: aurweb/routers/sso.py
# async def login(request: Request, redirect: str = None):
# def is_account_suspended(conn, user_id):
# def open_session(request, conn, user_id):
# def is_ip_banned(conn, ip):
# def is_aur_url(url):
# async def authenticate(request: Request, redirect: str = None, conn=Depends(aurweb.db.connect)):
# async def logout(request: Request):


import http
import aurweb.config
from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from starlette.middleware.sessions import SessionMiddleware
from aurweb.routers import sso




app = FastAPI()

session_secret = aurweb.config.get("fastapi", "session_secret")
if not session_secret:
    raise Exception("[fastapi] session_secret must not be empty")

app.add_middleware(SessionMiddleware, secret_key=session_secret)


# Path: aurweb/routers/sso.py
# async def login(request: Request, redirect: str = None):
# def is_account_suspended(conn, user_id):
# def open_session(request, conn, user_id):
# def is_ip_banned(conn, ip):
# def is_aur_url(url):
# async def authenticate(request: Request, redirect: str = None, conn=Depends(aurweb.db.connect)):
# async def logout(request: Request):


# Path: aurweb/asgi.py
import http
import aurweb.config
from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from starlette.middleware.sessions import SessionMiddleware
from aurweb.routers import sso





app = FastAPI()

session_secret = aurweb.config.get("fastapi", "session_secret")
if not session_secret:
    raise Exception("[fastapi] session_secret must not be empty")

app.add_middleware(SessionMiddleware, secret_key=session_secret)


app.include_router(sso.router)