Skip to content

fix: keep People API FastAPI dependencies server-owned - #16

Closed
cursor[bot] wants to merge 68 commits into
feat/people-apifrom
cursor/bc-60bc32b0-d306-43b8-9b8c-e6daf86e50c2-7c2e
Closed

fix: keep People API FastAPI dependencies server-owned#16
cursor[bot] wants to merge 68 commits into
feat/people-apifrom
cursor/bc-60bc32b0-d306-43b8-9b8c-e6daf86e50c2-7c2e

Conversation

@cursor

@cursor cursor Bot commented Aug 16, 2026

Copy link
Copy Markdown

What changed

  • People API route handlers now inject PurposeContext and the repository through runtime FastAPI Depends defaults instead of postponed Annotated parameters.
  • app.py no longer uses from __future__ import annotations, so FastAPI 0.116 cannot treat server-owned context, request, or repository objects as caller query fields.
  • Bearer parsing splits only on the first ASCII space so C0 separators such as \\x1f stay visible and are rejected.
  • OpenAPI and source contracts now forbid context, request, and repository_port as caller parameters.
  • ADR-0006, the People API contract, doctoring references, traceability, architecture, and CHANGELOG record the boundary.

This branch starts from the current Keyverse authorizer head (PR #7) and repairs the People API Quality failure on that stack.

Why

On the current PR #7 head, every protected People route returned HTTP 422 and /openapi.json omitted info because FastAPI 0.116 interpreted postponed annotations as query.context / query.request. That blocks the Keyverse authorizer stack from proving the People API still authorizes correctly after independent scope enforcement.

Customer next action

Review this exact-head repair, confirm People API Quality is green on Python 3.12 and 3.14, then use it to replace or update PR #7 before any retarget onto the protected default branch.

Verification already run locally

  • 90 passed in services/people-api/tests
  • exact 100% production statement and branch coverage on orgmetra_people_api
  • public docstring gate passed
  • pip check passed

Honest release boundary

This remains a stacked pre-GA verifier plus People API factory. Discovery/JWKS egress, identity-link lifecycle, live Keyverse conformance, atomic idempotency, and external security review are still release gates. Keep the stack Draft until the foundation and predecessor PRs merge, then retarget and require fresh exact-head review and checks.

Merge

Do not merge until required checks and independent review pass. This change does not bypass branch protection.

Open in Web View Automation 

seonghobae and others added 22 commits August 16, 2026 23:35
FastAPI 0.116 treated postponed annotations as query fields, so every
protected People route returned 422 and OpenAPI generation failed.
Inject PurposeContext and the repository through runtime Depends
defaults, split bearer tokens on the first ASCII space, and lock the
contract with OpenAPI and source tests.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
State that PurposeContext and the repository port are host-injected
Depends values so reviewers can see the FastAPI annotation contract
without opening the route module.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Bring the Keyverse authorizer repair onto the current People API head
and keep the runtime Depends boundary after the protected-default-branch
wording update.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
The repository contract now requires buyer-facing integrity metadata to
name foundation PR #8 and include the People API and persistence paths.
Refresh hashes so the stacked Keyverse repair stays honest.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
pydantic-core 2.33.2 has no cp314 wheel, and pip check failed on 3.12
because httpx/httpcore require certifi. Use the same Pydantic 2.13.4
and certifi pins already proven by Keyverse authorization CI.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #16 at f4595f1 is a correct People API dependency-ownership repair. It is not merge-ready. Keep it Draft.

Finding

The claimed fix is present and hosted People API Quality is green on this SHA for Python 3.12 and 3.14. app.py has no postponed annotations; routes use runtime Depends defaults; bearer split is split(" ", 1); OpenAPI omits context / request / repository_port as caller fields. Keyverse Authorization Quality and Package are also green. Domain Quality was still pending at review time and is not treated as a reason to stop work.

No blocking defect on the claimed repair.

Residual risk on this exact head

The OpenAPI test is a three-name blacklist, not a published-shape lock. A later FastAPI/Pydantic change that leaked credentials, scheme, or flattened PurposeContext fields would not fail that test. There is also no in-repo HTTP probe that sends attacker query names and asserts the stable 404. Those contract gaps are not merge blockers for this repair, but they are the next test lock.

Merge decision

Do not merge to the protected default branch. Do not retarget until predecessor PRs merge and this exact head, or its successor, receives independent review plus green required checks. PR #7 must not merge at the older red People API head.

Next loop already in flight

The buyer-facing gap after this repair is hire completion: create candidate, retrieve candidate, retrieve hire link, record employment, retrieve employment. That work is on the successor branch from this head and must stay Draft with the same stack-order rule.

Open in Web View Automation 

Sent by Cursor Automation: Fix Issues

@cursor
cursor Bot requested a review from seonghobae August 16, 2026 15:14

Copy link
Copy Markdown
Contributor

Closing as superseded by PR #18. Fresh ancestry proof shows #18 head b7d8584104819978af22baca1ad5a4b5a3cf4a74 is 1 commit ahead of and 0 commits behind this PR's exact head f4595f1ef6f7d9c1c2e1f0317508241dd5f02808, with the merge base exactly equal to this PR head. #18 therefore preserves this FastAPI dependency-ownership repair and extends the same lane with candidate reads plus employment create/read behavior. Reviews/checks do not transfer; #18 must satisfy fresh exact-head gates before integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants