oliver-zehentleitner / maity

hub: placements: one runner-relation value instead of four owner predicates in routes/placements

Sign in to report

tsk-htyveqverjak Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: design. Neighbour of tsk-j0vqtv3zhacw item 5 (placement start rules); different code.

What is wrong: hub/src/maity_hub/routes/placements.py carries several "runner owner" predicates, three of them added in this range: _has_right (:111-118, members:admin plus owner), _runner_side (:520-523, the caller's human is the owner), _runner_owner (:526-529, a human owner as a member, any trust), _owns_its_runner (:162-170, its own join query) and _outside_owner (:532-551, a third query shape). patch_placement combines six booleans (right, proposer, owner, by_runner_owner, starts, admin_asks) at :656-670.

Proposal: one RunnerRelation value (owner / owner's agent / admin-owner / none) computed once per call, plus one table of what each relation may do, matching docs/api.md:19399-19403. Behaviour stays the same; the tests must cover the table.

Effort / risk: M. Medium risk (authorization paths).