fix(users): admin-gated /users routes accept api-key auth #23
Reference in New Issue
Block a user
Delete Branch "fix/users-require-admin-accept-apikey"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
require_admindefined locally inapp/api/routers/users.pydepended onget_current_user, which is OAuth2 JWT only.is_admin=Trueuser.get_current_user_or_apikey(the one already used by schedule_type.py and other admin routes) so X-API-Key and Bearer-as-apikey fallback both work. The admin gate itself still readsUser.is_admin— only the auth carrier broadens.Test plan
hf user list→ 401 "Could not validate credentials"or_apikeybranch which tries JWT first when the token comes in via Bearer)Surfaced during recruitment workflow Step 3 on prod-t2.