oliver-zehentleitner / maity

hub: placements: one revoked-credential read for _check_rejoin and owner_only_revocation

Sign in to report

tsk-vdjsyqexzsgq Open

Audit round 3 (tsk-hgnbapyw7hnh), read at 588f911b. Kind: duplication.

What is wrong: hub/src/maity_hub/placements.py:1444-1459 (owner_only_revocation) and hub/src/maity_hub/routes/placements.py:751-782 (_check_rejoin) both read credential.revoked_at, revoked_by, revoked_reason and call undone_by_anyone. The domain copy reads the runner's owner itself; the route passes in the runner it already has.

Proposal: one pl.revocation_of(conn, placement) returning the row (or a rejoin_blocked(conn, placement, runner) predicate) used by both; the route only maps it to owner_only or credential_not_revoked.

Effort / risk: S. Low risk.