Back to the room

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

Code Observatory / function

principal_for_token

shared.auth.principal_for_token

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
Inside (1)
SymbolFileResolved by
authauth.pysame file
shared.auth.principal_for_tokenbackend/app/shared/auth.py, lines 102–110Open source
def principal_for_token(token: str) -> Principal | None:    admin = _configured("PHAROS_ADMIN_TOKEN")    reader = _configured("PHAROS_READ_TOKEN")    encoded = token.encode()    if admin and hmac.compare_digest(encoded, admin.encode()):        return ADMIN    if reader and hmac.compare_digest(encoded, reader.encode()):        return READER    return None

What the index recorded

Signature
def principal_for_token(token: str) -> Principal | None:
File
backend/app/shared/auth.py
Lines
102–110
Parser
python-ast
Git blob
c77f24b3d7406a6b302764a8fc5e475c40480e60
Call sites
3 named, 2 resolved, 1 left unlinked
Outside this subset
2 more edges reach code outside the graph shown here

Read it on GitHub at this commit