-
Notifications
You must be signed in to change notification settings - Fork 0
users
Users are very important part of this app. (cause without people to use it, it wont work).
Users in this app are stored in a database with their passwords hashed.
They also have a default set of permissions but can request more.
{
"username": "string",
"password": "string",
"email": "string",
"permissions": {
"perm_name": boolean,
...
},
"public_key": "string",
"user_id": integer
}Example User:
{
"username": "CoolUser",
"password": "$argon2id$v=19$m=65536,t=3,p=4$e62IAa7wkzWZJVihV+IiRQ$YCQGST6V1IhjunNDZn1QJRad9EgX4nyFu0kg9T94kRg",
"email": "cool.user@example.com",
"permissions": {
"get_self": true,
"mofify_self": true,
"delete_self": false,
"get_other_users": true,
"join_rooms": true,
"create_rooms": false,
"ban_users": false,
"unban_users": false,
"create_users": false,
"delete_users": false,
"update_users": false
},
"public_key": "-----BEGIN PUBLIC KEY-----\\n ... \\n-----END PUBLIC KEY-----",
"user_id": 123456789
}| name | type | what it is |
|---|---|---|
| username | string |
The username to the account |
| password | string |
Hashed version of the users password |
string |
the users email | |
| permissions | dict |
A dictionary of the users permissions. Each permission is in format: perm_name (string): boolean (true/false). See bellow for info |
| public_key | string |
The users RSA public key. Used for end to end encryption in DMs. |
| user_id | integer |
The user's id. Will not change as it is used to identify the user no matter the username |
Every user has certain permissions. If they are not a super (cool, awesome) user and they haven't requested any permissions then they get the default set.
User permissions is important because it allows them to access endpoints in the API that they didn't have access to before.
List of current permissions:
If permission has = False it means that it is off by default and needs to be requested
User permissions:
-
get_self: boolean: Be able to get details about the current user (you) -
mofify_self: boolean = False: Permission to modify the current user's account details. -
delete_self: boolean = False: Be able to delete your account -
get_other_users: boolean: Permission to get details on other users
Room permissions:
-
join_rooms: boolean: Be able to join chatrooms -
create_rooms: boolean = False: Permission to create rooms
Admin permissions:
All of these permissions cannot be access unless you have a admin account. These permissions also can't be requested. I will not explain them because its obvious.
ban_users: booleanunban_users: booleancreate_users: booleandelete_users: booleanupdate_users: boolean
Default list of permissions:
get_selfget_other_usersjoin_rooms
Want more? Ask nicely and request them :)