oliver-zehentleitner / maity

hub: one 'caller session in good standing' check and one not_in_good_standing refusal (four copies)

Sign in to report

tsk-deq6rbw1evy6 Proposed

Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. Kind: duplication.

What is wrong

  • invitations.standing_refusal (invitations.py:555-576, new in the range) and routes/restricted.py:66-75 each read the human_session row by caller.human_session, call sessions.good_standing, and build the 403 with reason not_in_good_standing inline.
  • notifications/address.py:172-174 and :459-460, and auth/second_factor.py:786-787, build the same reason through their own helpers.
  • Related but separate: tsk-ftmhm1b15nek (one reader of a presented session cookie).

Proposal

  • sessions.caller_in_good_standing(conn, caller) -> bool and one refusal helper with the reason; the four places call them, each keeping its own message text if the docs require it.

Effort / risk: S. Low; the refusals are pinned by the invitation, restricted and address tests.