Back to the room

Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works

Code Observatory / function

require_admin

shared.auth.require_admin

PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.

PHAROS at 975a38dMIT license

Around this symbol

Search all symbols

Loading

Inside (1)
SymbolFileResolved by
authauth.pysame file
shared.auth.require_adminbackend/app/shared/auth.py, lines 136–141Open source
def require_admin(request: Request) -> Principal:    """FastAPI dependency for endpoints that change state."""    principal = getattr(request.state, "principal", None)    if principal is None or not principal.is_admin:        raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="admin token required")    return principal

What the index recorded

Signature
def require_admin(request: Request) -> Principal:
File
backend/app/shared/auth.py
Lines
136–141
Parser
python-ast
Git blob
c77f24b3d7406a6b302764a8fc5e475c40480e60
Call sites
2 named, 0 resolved, 2 left unlinked

Read it on GitHub at this commit