Add support for MPSK
In order for MPSK to be used by our members, an appropriate frontend, including an API endpoint, must be implemented.
The following SQL schema is currently planned:
CREATE TABLE wifi_mpsk_clients(
owner_id INT NOT NULL,
name character varying,
mac macaddr NOT NULL,
UNIQUE(mac),
CONSTRAINT fk_owner_id FOREIGN KEY (owner_id) REFERENCES pycroft."user"(id) ON DELETE CASCADE
);
A MAC address must be uniquely assignable to a user. However, a user can create as many MAC addresses as they wish.
To better distinguish between devices, it is planned to allow users to assign names to their devices.
The frontend can thus be implemented similarly to the existing interface list. This can then be placed in a separate tab, "WiFi" or similar, on the user page.
To simplify troubleshooting in case of issues, a note should be added in the frontend if the user has a legacy WiFi password that is not stored in plain text. (Reminder: WiFi password ≠ login password)
Feel free to ask questions if necessary.
The frontend can thus be implemented similarly to the existing interface list.
To give a few pointers to anyone willing to work on this:
- These are the interface views
https://github.com/agdsn/pycroft/blob/865ebcf6bfc5a7a3b02966bf64e00c2342b42717/web/blueprints/host/init.py#L209-L327
- these are the underlying
libfunctions containing the core CRUD (Create, Read, Update, Delete) logic.
https://github.com/agdsn/pycroft/blob/865ebcf6bfc5a7a3b02966bf64e00c2342b42717/pycroft/lib/host.py#L110-L221
A straightforward way to implement this feature in the UI would be to place a second table, named "mpsk clients", below the hosts table:
I would add a not null for the name so its better identifiable
I currently also added another tab instate of putting it below the old one, first it looks way cleaner at the fronted side and in code as well as it is better structured
First of all thank you @agmes4 :)
I see that you use „WLAN“ in your implementation at the moment. In order to maintain uniformity, it may be better to use „WiFi“. (Except in the German translation, since „WLAN“ is more common in Germany.)
Your totally right will change this thanks :)
@agmes4 feel free to create a draft PR to allow for reviews :)