Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
The user management encapsulates the following operations:
Every user that wants to be connected to the network, needs to be announced first. This is done with a one-time registration. This registration requires the User Credentials as parameters. These credentials are used for the following:
- Avoid user ID conflicts
- Avoid multiple registration of the same user
- User Profile Encryption
The registration process includes the following steps:
- Check if a user with the provided user ID already exists.
- If not, a new User Profile is created.
- The created user profile is put to the DHT. (see User Profile Location)
- A new User Locations list is created.
- The created user locations list is put to the DHT.
- A new User Encryption Key Pair is created.
- The created User Encryption Public Key is put to the DHT.
- A new User Authentication Key Pair is created.
A registered user might want to leave the network and not come back. In this case, the user can be unregistered.
This operation has not yet been implemented, but would comprise the following steps:
- Unshare all shared folders.
- Remove the User Encryption Public Key from the DHT.
- Remove the User Locations list from the DHT.
- Remove the User Profile from the DHT.
However, in case a user does not unregister from the network but remains absent for long time, the Time-To-Live (TTL) mechanism will remove all of the user's files, that are not shared, from the network.
Upon successful login, the connected user client is triggered to synchronize its local state with the network. Also, since this client now is online, it is able to receive Notifications.
The login process includes the following steps:
- The User Profile is fetched from the DHT.
- A new Client Session is created.
- The User Locations list is fetched from the DHT.
- The connecting clients' location information is added to the list.
- Possible unfriendly leaves of other user clients are detected.
- It's evaluated whether the connecting user client is the Master Client.
- The user locations list is put back to the DHT.
- File Synchronization takes place.
- If the connecting user client is the master client, all User Profile Tasks are processed.
A user that is logged in with one of her User Clients might want to disconnect the connected client. In this case, the user client can be logged out. As soon as all user clients of a user are logged out, the user is presented as offline.
A proper logout is referred to as friendly leave from the network. (As opposed to unfreindly leave.)
In order to detect file changes during the offline phase of a user client, the last synchronized state is persisted on the client’s local disk. This information is considered during the next login.
The logout process includes the following steps: