middleware icon indicating copy to clipboard operation
middleware copied to clipboard

NAS-130867 / 25.04 / Simplify {TCPIP/UnixSock}Origin to ConnectionOrigin

Open yocalebo opened this issue 1 year ago • 1 comments

I broke app.query recently because we're passing @pass_app objects around. After investigating this for 2 days, I realized we can simplify all of this and get rid of public methods like websocket_local_ip and websocket_interface and get the same information directly from the app.origin object.

This removes all the Origin classes (and subclass) and creates a singular ConnectionOrigin object. I moved over the logic from the other classes to this one but added a few convenient properties (is_ha_connection) so it's easier to use. This removes the necessity for importing these origin classes everywhere and doing isinstance calls. I also get rid of the read_proc_net and get_remote_addr functions. The former is actually deprecated and the latter is unnecessarily expensive.

CI runs for both HA and Single node passed with no obvious regressions: (here and here)

yocalebo avatar Aug 29 '24 19:08 yocalebo

Jira URL: https://ixsystems.atlassian.net/browse/NAS-130867

bugclerk avatar Aug 29 '24 19:08 bugclerk

This PR has been merged and conversations have been locked. If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

bugclerk avatar Aug 30 '24 16:08 bugclerk