Back to the room

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

Code Observatory / function

token_problems

shared.auth.token_problems

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

Calls (1)
SymbolFileResolved by
_configuredauth.pysame file
Called by (1)
SymbolFileResolved by
system_statusrouter.pythrough an import
Inside (1)
SymbolFileResolved by
authauth.pysame file
shared.auth.token_problemsbackend/app/shared/auth.py, lines 144–157Open source
def token_problems() -> list[str]:    """Configuration warnings surfaced at startup (never the token values)."""    problems = []    admin = _configured("PHAROS_ADMIN_TOKEN")    if not admin:        problems.append("PHAROS_ADMIN_TOKEN is not set: every protected endpoint will return 401")    elif len(admin) < MIN_TOKEN_LENGTH:        problems.append(f"PHAROS_ADMIN_TOKEN is shorter than {MIN_TOKEN_LENGTH} characters")    reader = _configured("PHAROS_READ_TOKEN")    if reader and len(reader) < MIN_TOKEN_LENGTH:        problems.append(f"PHAROS_READ_TOKEN is shorter than {MIN_TOKEN_LENGTH} characters")    if admin and reader and hmac.compare_digest(admin.encode(), reader.encode()):        problems.append("PHAROS_READ_TOKEN equals PHAROS_ADMIN_TOKEN, so the read-only scope has no effect")    return problems

What the index recorded

Signature
def token_problems() -> list[str]:
File
backend/app/shared/auth.py
Lines
144–157
Parser
python-ast
Git blob
c77f24b3d7406a6b302764a8fc5e475c40480e60
Call sites
5 named, 2 resolved, 3 left unlinked
Outside this subset
3 more edges reach code outside the graph shown here

Read it on GitHub at this commit