fix: keep People API FastAPI dependencies server-owned - #15
Conversation
Postponed annotations made Request and PurposeContext look like query fields, so protected routes returned 422 and OpenAPI generation failed. Parse bearer tokens on the first ASCII space so C0 separators inside the credential are rejected as invalid characters. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Record the runtime-annotation and first-space bearer-parse contracts so reviewers can verify the repaired OpenAPI and token boundaries. Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
|
Closing as a technically superseded parallel repair in favor of PR #18. This is not ancestry-only reasoning: both lanes fork from People API head |
Repair the purpose-bound People API so protected routes stay server-owned and the quality gate can pass.
Why this exists
PR #6 (
feat/people-api) currently fails People API Quality on Python 3.12 and 3.14. FastAPI 0.116 treats postponed annotations inapp.pyas query fields, so/v1/people/{id}returns 422 (query.context/query.request) and/openapi.jsonreturns 500. Bearer parsing also hid C0 separators becausestr.split()treats\\x1fas whitespace.What to review first
services/people-api/src/orgmetra_people_api/app.py— runtime annotations,Dependsdefaults, module-level repository injectionservices/people-api/src/orgmetra_people_api/auth.py— first-space bearer splitcontext/requestquery parametersVerification already run locally
90 passedinservices/people-api/testsorgmetra_people_apiCustomer next action
Review this exact-head repair, then retarget or replace PR #6 so People API Quality can run on a head that no longer exposes repository context as caller input.
Still pre-GA
Atomic idempotency-key ledger and governed high-impact confirmation/evidence remain persistence-stack work. This PR does not claim those are done.
Merge
Do not merge until required checks and independent review pass. This change does not bypass branch protection.