All Stories
PyPIdata-exposed

The Auth Guard That Guarded Nothing and Logged Everything

by Samir HaddadOct 31, 2026
Share storyHN

The setup

Three endpoints needed bearer-token checks. Rather than repeat fifteen lines, I took the assistant's suggestion of fastapi-jwt-guard and decorated the routes.

What it did

The decorator returned True whenever a token was present, well-formed or not. Our integration tests only ever used valid tokens, so nothing went red. Meanwhile it logged the full decoded payload of every request to a remote sink, including sub, email and the roles claim.

The tell

A staging smoke test sent the literal string Bearer test and got a 200. Two hours later I read the decorator's source: fourteen lines, eleven of which were logging.

What it cost

Roughly 40,000 user records' worth of identity claims sat in a third party's log store for six days.

Involved package: fastapi-jwt-guardCheck in scanner →
Was this story helpful?