get_radius_clients() and get_radius_users() caught every exception and returned [], so a caller could not tell "no entries" from "no answer".
netOrk asks these getters whether a RADIUS entry whose add was cut off is still on the firewall (NetOrk/netork#2162, PR NetOrk/netork#2546). On an empty list it would forget a NAS client that is still live there, with its shared secret.
What changes
Both getters now raise when the request fails or the answer holds no rows list (_search_rows). An empty list now means FreeRADIUS has none.
RADIUS_READS_RAISE = True on the driver class declares this. netOrk (PR NetOrk/netork#2546) trusts an empty list only from a driver that says so.
create_radius_client() and create_radius_user() still answer success after a saved add whose id lookup fails. The add went through, and the id stays None, as before when the name was not found.
Callers
No other caller of the two getters exists in the driver or in netOrk except netOrk's RADIUS runs on PR NetOrk/netork#2546: the delete by name and the settling of a pending entry. Both treat a raise as "could not tell", keep the row, and ask again later.
Tests
First the new tests, which failed: a failed request and an answer without rows raise; an empty rows list is []; the driver declares RADIUS_READS_RAISE; a saved add whose lookup fails is still a success.
Then the fix. The driver's whole suite: 626 passed. Ruff and mypy are clean.
`get_radius_clients()` and `get_radius_users()` caught every exception and returned `[]`, so a caller could not tell "no entries" from "no answer".
netOrk asks these getters whether a RADIUS entry whose add was cut off is still on the firewall (NetOrk/netork#2162, PR NetOrk/netork#2546). On an empty list it would forget a NAS client that is still live there, with its shared secret.
## What changes
- Both getters now **raise** when the request fails or the answer holds no `rows` list (`_search_rows`). An empty list now means FreeRADIUS has none.
- `RADIUS_READS_RAISE = True` on the driver class declares this. netOrk (PR NetOrk/netork#2546) trusts an empty list only from a driver that says so.
- `create_radius_client()` and `create_radius_user()` still answer `success` after a saved add whose id lookup fails. The add went through, and the id stays `None`, as before when the name was not found.
## Callers
No other caller of the two getters exists in the driver or in netOrk except netOrk's RADIUS runs on PR NetOrk/netork#2546: the delete by name and the settling of a pending entry. Both treat a raise as "could not tell", keep the row, and ask again later.
## Tests
- First the new tests, which failed: a failed request and an answer without `rows` raise; an empty `rows` list is `[]`; the driver declares `RADIUS_READS_RAISE`; a saved add whose lookup fails is still a success.
- Then the fix. The driver's whole suite: 626 passed. Ruff and mypy are clean.
Closes #49
get_radius_clients() and get_radius_users() caught every exception and
returned [], so a caller could not tell no entries from no answer. netOrk
asks them whether an entry whose add was cut off is on the firewall, and an
empty list would have made it forget a NAS client still live there. Both now
raise for a failed request or an answer without rows; an empty list is the
firewall's answer, which RADIUS_READS_RAISE = True declares. A saved add
whose id lookup fails still answers success, with no id.
Closes#49
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
get_radius_clients()andget_radius_users()caught every exception and returned[], so a caller could not tell "no entries" from "no answer".netOrk asks these getters whether a RADIUS entry whose add was cut off is still on the firewall (NetOrk/netork#2162, PR NetOrk/netork#2546). On an empty list it would forget a NAS client that is still live there, with its shared secret.
What changes
rowslist (_search_rows). An empty list now means FreeRADIUS has none.RADIUS_READS_RAISE = Trueon the driver class declares this. netOrk (PR NetOrk/netork#2546) trusts an empty list only from a driver that says so.create_radius_client()andcreate_radius_user()still answersuccessafter a saved add whose id lookup fails. The add went through, and the id staysNone, as before when the name was not found.Callers
No other caller of the two getters exists in the driver or in netOrk except netOrk's RADIUS runs on PR NetOrk/netork#2546: the delete by name and the settling of a pending entry. Both treat a raise as "could not tell", keep the row, and ask again later.
Tests
rowsraise; an emptyrowslist is[]; the driver declaresRADIUS_READS_RAISE; a saved add whose lookup fails is still a success.Closes #49