MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / require_api_auth

Function require_api_auth

src/web/auth.py:72–83  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

70
71
72def require_api_auth(request: Request) -> bool:
73 if is_default_security_config_active():
74 raise HTTPException(
75 status_code=423,
76 detail={
77 "code": "password_change_required",
78 "message": "首次启动请先访问 /setup-password 修改访问密码",
79 },
80 )
81 if not is_request_authenticated(request):
82 raise HTTPException(status_code=401, detail="未登录或登录已失效")
83 return True
84
85
86def is_websocket_authenticated(websocket: WebSocket) -> bool:

Callers

nothing calls this directly

Calls 2

is_request_authenticatedFunction · 0.85

Tested by

no test coverage detected