user_system
A simple backend implementation for website user management.
GitHub repo: https://github.com/GGN-2015/user_system
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.
-
Metadata
Release files for user_system 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| user_system-0.0.1.tar.gz | 14.1 kB | Without provenance | Details for user_system-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| user_system-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for user_system-0.0.1-py3-none-any.whl |
Total release size: 39.8 kB
Release files / user_system-0.0.1.tar.gz
| Download URL | user_system-0.0.1.tar.gz |
|---|---|
| Size | 14.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6ce09181da22ad65c1f1b1f46caa060790a505872737a16b9465e0d2d42f436
|
|
BLAKE2b-256 checksum How to use checksums |
dfa6f37cb6f9d969faa8e4a9ba4daf80f1f2362d46058a38b3b4e21c0d64764a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.7 Linux/6.17.7-aosc-main
|
Release files / user_system-0.0.1-py3-none-any.whl
| Download URL | user_system-0.0.1-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab44a5475603230ba066632446e7316280ddf2bea9afb4e27906793089660a6a
|
|
BLAKE2b-256 checksum How to use checksums |
d049ebf0c6a6cde2e3f55dec852741e1c0cbf477e4ecdb90851b325f87438f0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.7 Linux/6.17.7-aosc-main
|
Security for user_system 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.