Nobody has started this yet — be first.
Business impact
Any route configured with auth.type: bearer is completely unusable -- every single request gets 401'd, including ones with a perfectly valid token. If a customer-facing API is fronted by a bearer-auth route, this is a full outage for that route, not a degradation: 100% of traffic fails, and the error message ("missing x-api-key header") actively misleads whoever is debugging it, since the client is correctly sending Authorization: Bearer ..., not x-api-key.
Problem
AuthConfig.header_name() is supposed to return x-api-key for api_key routes and authorization for bearer routes (unless a route overrides it via auth.header). Right now it returns "x-api-key" unconditionally, regardless of .
Current behavior
header_name()'s per-type branch has been collapsed to a single unconditional return, so AuthConfig(type="bearer").header_name() returns "x-api-key" instead of "authorization", even though self.type is right there to branch on.
Expected behavior
A route with auth.type: bearer (and no explicit auth.header override) reads the credential from the Authorization header, exactly as app/auth/checks.py::check_bearer expects.
Steps to reproduce
auth: {type: bearer, credentials: {"tok-1": "client-a"}}.Authorization: Bearer tok-1.Why this matters
header_name() is the single source of truth both check_api_key and check_bearer (app/auth/checks.py) call to find their credential -- it is shared logic with a per-type branch that is supposed to pick the right default. Collapsing the branch to always return one value is the kind of copy-paste-and-forgot-to-finish mistake that is easy to miss because api_key routes (the more common case, probably written and tested first) keep working fine.
Suggested approach
Look at header_name()'s only two possible return values and the docstring comment two lines above it that already states the intended mapping. The method has all the information it needs (self.type) to pick correctly -- it just is not using it.
Acceptance criteria
Verification
pytest practice_tickets/tests/test_ticket_02_bearer_auth_wrong_header.py -v
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
Sign in to create it automatically, or do it yourself:
$git checkout -b fix/bearer-auth-wrong-headerFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/bearer-auth-wrong-headerSubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign inself.typehttp://localhost:8080fast_echo/echo/.../large/{size_mb}slow_upstream/delay/{s}/flaky/always-downroutes.yamlcurl localhost:8080/healthzcurl localhost:8080/readyz/admin/*Authorization: Bearer <GATEWAY_ADMIN_TOKEN>You do not need Docker running at all to work the tickets — the test suite fakes Redis with fakeredis (plus lupa for real Lua-script support), so everything runs against a plain virtualenv:
python3 -m venv .venv && .venv/bin/pip install -r requirements-dev.txt
.venv/bin/pytest practice_tickets/tests/test_ticket_09_breaker_threshold_off_by_one.py -v # a single ticket
./practice_tickets/run_tickets.sh # all 15, clean pass/fail summary
./practice_tickets/run_tickets.sh 06 09 15 # just a few, by number
All 15 tests fail at the start; as you fix each ticket in app/, its test (and only its test) should flip to passing. .venv/bin/pytest tests/ runs the project's own main suite — as of writing it shows 8 pre-existing failures caused by ticket bugs 02, 04, 06, and 09; fixing those tickets fixes those failures too, not a separate task.
Level 1
Fix a bug
Read existing behaviour, correct it.