Hello, this is my first post
I took a look this night at source codes, watching for a way to implement this.
Because of some booze I got for the evening, I may have took this all wrong, but here's my 2 cents:
Intended plan:
Multi-user things are only for remote operation. No change in the rpc syntax should happen. Users are defined by an UID, a login and a password. In local mode, the UID will be 0, the "administrator account" which uses normal RPC log in in the settings, that will have access to every torrent.
Passes to implement:
- Add a UID list in tr_torrent struct.
initially I thought for an int, but a list may be used in future, watching the "A anb B download the same file" case.
- add an UID int correspondance with every authed session
(I thought using the X-Transmission-Session-Id field, but it seems made global, so there is maybe need to implement something new here)
- Make torrent listings show only torrents which have the session-UID in the tr_torrent->uid list (in case the session-uid is 0, ignore the filtering)
- Make adding remote torrents inherit the session-uid in their tr_torrent->uid (0 for local or admin-torrent)
- Implementation of a Login/user dictionary with UID association. (for the moment the dic will be UID:login:password lists, other options after)
This will be the first phase. At this moment, no custom user download dirs are configured. Only for showing the list.
This can be configured in the same fashon of the point 4 of the first phase.
Configuration:
at first I see an offline configuration method: at every start the userlist is read.
Resume:
adding an UID field to the resume file is needed, but at first an "all-resumed-uids-are-0" method may be used.
So, for the moment:
the thing more "hard" is the point 2.
In fact the authentication pass is made using http basic authentication, so it's sent with every request.
Probably we may hook up the
rpc-server.c around
handle_request() and make the Auth Basic [b16encodedshit] association....