A simple backend implementation for website user management.
Project description
user_system
A simple backend implementation for website user management.
Installation
pip install user_system
Tables in the Database
-
(
user) User List:-
(
user_id) User ID (Primary Key): A string of alphanumeric characters (length ≥ 6, ≤ 32) -
(
passwd_md5) User Password MD5: A lowercase hex hash digest string -
(
nickname) User Nickname: A string of 32 characters (length ≤ 32) -
(
introduction) User Profile: A string of 2000 characters (length ≤ 2000) -
(
is_admin) Administrator Status
-
-
(
challenge) Challenge Response Table:-
(
user_id) User ID (Primary Key): A user can have at most one challenge -
(
create_time) Application Time: Unix time stamp -
(
content) Challenge Content: A random string of 32 characters (alphanumeric, ≤ 6) -
(
die_time) Record Timeout: Unix time stamp
-
-
(
cookie_token) Cookie-token Table:-
(
cookie_token) Cookie-token Value (Primary Key) -
(
user_id) User ID: A user can have multiple cookie-tokens. Cookie-token -
(
create_time) Cookie-token Acquisition Time: Unix time stamp -
(
die_time) Record Timeout Time: Unix time stamp -
(
use_time) Record Last Use Time: Unix time stamp
-
-
(
invitation) Invitation Code Table (for Registering Users):-
(
content) Invitation Code (Primary Key): A random string of length 32 (alphanumeric underscores) -
(
die_time) Timeout Time: Unix time stamp -
(
remain) Remaining Uses: An integer greater than or equal to 1
-
All Supported Operations
-
(
user_system.ope_new_usr) Register a user using an invitation code (cookie-token not required)-
User selects their ID and password using MD5 hash
-
User provides an invitation code (invitation code validity needs to be verified and uses deducted)
-
-
(
user_system.ope_ulist) View all non-administrator user lists (cookie-token not required)- Returns a user ID List
-
(
user_system.ope_see) View the nickname and profile of a specified non-administrator user (no cookie-token required)-
Specify a user ID
-
Returns two strings
-
-
(
user_system.ope_new_ch) Request a challenge response (no cookie-token required)-
Specify a user ID
-
The system will return the challenge content
-
-
(
user_system.ope_res_ch) Answer a challenge response (no cookie-token required)-
Specify a user ID
-
The system will return a cookie-token upon successful challenge
-
-
(
user_system.ope_logout) Logout: (cookie-token required) Log out of a cookie-token-
Specify your own cookie-token
-
Specify the cookie-token to be logged out
-
Administrator users can log out of any cookie-token; regular users can only log out of their own user's cookie-token. Cookie-token
-
-
(
user_system.ope_tlist) View all cookie-tokens for a specified user (cookie-token required)-
Specify your own cookie-token
-
Specify the user ID
-
Administrators can view any user's cookie-token; regular users can only view their own.
-
-
(
user_system.ope_chg_pwd) Change password (cookie-token required):-
Specify your own cookie-token
-
Specify the user ID
-
Specify the MD5 hash digest of the new password (lowercase hex hash, verification required)
-
Administrators can change anyone's password; regular users can only change their own.
-
-
(
user_system.ope_ch_nick) Change nickname (cookie-token required)-
Specify your own cookie-token
-
Specify the user ID
-
Specify the new nickname (note length verification)
-
Administrators can modify anyone's nickname; regular users can only modify their own nickname.
-
-
(
user_system.ope_ch_intro) Modify Profile (Requires cookie-token)-
Specify your own cookie-token
-
Specify your user ID
-
Specify the new profile (note length validation)
-
Administrators can modify anyone's profile; regular users can only modify their own profile.
-
-
(
user_system.ope_set_admin) Set Administrator (Requires cookie-token)-
Specify your own cookie-token
-
Specify your user ID
-
Only administrators can set other users as administrators.
-
-
(
user_system.ope_unset_admin) Unset Administrator (Requires cookie-token)-
Specify your own cookie-token
-
Specify your user ID
-
Only administrators can unset other users as administrators.
-
Administrators cannot revoke their own administrator status.
-
-
(
user_system.ope_new_inv) Add Invitation Code (Requires Cookie-token)-
Specify your own cookie-token
-
Specify expiration time
-
Specify the number of registrations that can be used
-
Only administrators can add invitation codes.
-
-
(
user_system.ope_del_inv) Delete Invitation Code (Requires Cookie-token)-
Specify your own cookie-token
-
Specify the invitation code
-
Only administrators can delete invitation codes.
-
-
(
user_system.ope_del_usr) Delete User (Requires Cookie-token)-
Specify your own cookie-token
-
Specify user ID
-
Administrators can delete any non-administrator user; regular users can only delete their own users.
-
-
(
user_system.ope_ilist) View Invitation Code List (Requires Cookie-token)-
Only administrators can view the invitation code list.
-
You can see the content, remaining uses, and expiration time of each invitation code.
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file user_system-0.0.0.tar.gz.
File metadata
- Download URL: user_system-0.0.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.7 Linux/6.17.7-aosc-main
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24620e63f0fa12037d81d00f6fe3ba25882396964a5565852de73dd9df580501
|
|
| MD5 |
9c09aa815da4dc5331af7f574089ace5
|
|
| BLAKE2b-256 |
dbc3d883d29f8129b91d5209dc1fbbe2c8b8c65103e105b3690eb9f71245e5e2
|
File details
Details for the file user_system-0.0.0-py3-none-any.whl.
File metadata
- Download URL: user_system-0.0.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.7 Linux/6.17.7-aosc-main
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67962e93fafcf4e82c7df0767f200a625e32f8d27122cc6ca9941d67ceb4b489
|
|
| MD5 |
dc3ca845c5d885d8f7d1c1795a7f528a
|
|
| BLAKE2b-256 |
c97a926e3655d495c199615f0e73a038e393273917089aab0845e2bf47ee51be
|