fix(tradein/auth): убрать устаревшее «Caddy basic_auth required» из 401 (#2573) #2649
3 changed files with 4 additions and 4 deletions
|
|
@ -78,7 +78,7 @@ async def me(
|
||||||
if not x_authenticated_user:
|
if not x_authenticated_user:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=401,
|
status_code=401,
|
||||||
detail="no authenticated user (Caddy basic_auth required)",
|
detail="no authenticated user (valid session required)",
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
return get_user_scope(x_authenticated_user)
|
return get_user_scope(x_authenticated_user)
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ def _assert_estimate_access(created_by: str | None, x_authenticated_user: str |
|
||||||
if not x_authenticated_user:
|
if not x_authenticated_user:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=401,
|
status_code=401,
|
||||||
detail="no authenticated user (Caddy basic_auth required)",
|
detail="no authenticated user (valid session required)",
|
||||||
)
|
)
|
||||||
|
|
||||||
from app.core.auth import get_role
|
from app.core.auth import get_role
|
||||||
|
|
@ -688,7 +688,7 @@ def estimate_history(
|
||||||
if not x_authenticated_user:
|
if not x_authenticated_user:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=401,
|
status_code=401,
|
||||||
detail="no authenticated user (Caddy basic_auth required)",
|
detail="no authenticated user (valid session required)",
|
||||||
)
|
)
|
||||||
|
|
||||||
from app.core.auth import get_role
|
from app.core.auth import get_role
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ async def rbac_guard(
|
||||||
if not username:
|
if not username:
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=401,
|
status_code=401,
|
||||||
content={"detail": "no authenticated user (Caddy basic_auth required)"},
|
content={"detail": "no authenticated user (valid session required)"},
|
||||||
)
|
)
|
||||||
|
|
||||||
# #2213 defense-in-depth: если общий секрет задан — запрос с X-Authenticated-User
|
# #2213 defense-in-depth: если общий секрет задан — запрос с X-Authenticated-User
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue