oliver-zehentleitner / maity

hub: outsider admission rules in one domain module; placements stop calling routes/joins private helpers (and drop its type: ignore)

Sign in to report

tsk-q63vfbsfkddy Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: design (route reaching into another route) / rule built twice.

What is wrong

  • routes/placements._outsider_places (routes/placements.py:521-660) calls the private joins._refuse_rate (:535, :623, :657), joins._outside_values with # type: ignore[arg-type] (:579), joins._require_slot (:581) and joins._refuse_open_joins (:619).
  • For an agent that is already a member it restates the existing-member branch of joins._outside_values (routes/joins.py:366-406) inline: trust not outside gives member_join_limit("agent") (placements.py:602-603), isolated gives an inline 403 (:604-612), outside_role_allowed gives member_join_limit("role") (:613-614).
  • It repeats the own-profile and id_or_handle checks of joins._agent_for_join (routes/joins.py:1043-1054) at placements.py:551-560.
  • outsiders.py:111 and :345 import routes.joins for member_agents_limit.

Proposal

  • Move the outsider admission rules (rates, outside values, slot, open-joins refusal, member_agents_limit) into outsiders.py or member_agents.py; the join route and the placement route call one function. The type: ignore goes with it.

Effort / risk: M. Medium; the refusal order is tested on both paths.