Skip to main content

A simple backend implementation for website user management.

Project description

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

  1. (user) User List:

    1. (user_id) User ID (Primary Key): A string of alphanumeric characters (length ≥ 6, ≤ 32)

    2. (passwd_md5) User Password MD5: A lowercase hex hash digest string

    3. (nickname) User Nickname: A string of 32 characters (length ≤ 32)

    4. (introduction) User Profile: A string of 2000 characters (length ≤ 2000)

    5. (is_admin) Administrator Status

  2. (challenge) Challenge Response Table:

    1. (user_id) User ID (Primary Key): A user can have at most one challenge

    2. (create_time) Application Time: Unix time stamp

    3. (content) Challenge Content: A random string of 32 characters (alphanumeric, ≤ 6)

    4. (die_time) Record Timeout: Unix time stamp

  3. (cookie_token) Cookie-token Table:

    1. (cookie_token) Cookie-token Value (Primary Key)

    2. (user_id) User ID: A user can have multiple cookie-tokens. Cookie-token

    3. (create_time) Cookie-token Acquisition Time: Unix time stamp

    4. (die_time) Record Timeout Time: Unix time stamp

    5. (use_time) Record Last Use Time: Unix time stamp

  4. (invitation) Invitation Code Table (for Registering Users):

    1. (content) Invitation Code (Primary Key): A random string of length 32 (alphanumeric underscores)

    2. (die_time) Timeout Time: Unix time stamp

    3. (remain) Remaining Uses: An integer greater than or equal to 1

All Supported Operations

  1. (user_system.ope_new_usr) Register a user using an invitation code (cookie-token not required)

    1. User selects their ID and password using MD5 hash

    2. User provides an invitation code (invitation code validity needs to be verified and uses deducted)

  2. (user_system.ope_ulist) View all non-administrator user lists (cookie-token not required)

    1. Returns a user ID List
  3. (user_system.ope_see) View the nickname and profile of a specified non-administrator user (no cookie-token required)

    1. Specify a user ID

    2. Returns two strings

  4. (user_system.ope_new_ch) Request a challenge response (no cookie-token required)

    1. Specify a user ID

    2. The system will return the challenge content

  5. (user_system.ope_res_ch) Answer a challenge response (no cookie-token required)

    1. Specify a user ID

    2. The system will return a cookie-token upon successful challenge

  6. (user_system.ope_logout) Logout: (cookie-token required) Log out of a cookie-token

    1. Specify your own cookie-token

    2. Specify the cookie-token to be logged out

    3. Administrator users can log out of any cookie-token; regular users can only log out of their own user's cookie-token. Cookie-token

  7. (user_system.ope_tlist) View all cookie-tokens for a specified user (cookie-token required)

    1. Specify your own cookie-token

    2. Specify the user ID

    3. Administrators can view any user's cookie-token; regular users can only view their own.

  8. (user_system.ope_chg_pwd) Change password (cookie-token required):

    1. Specify your own cookie-token

    2. Specify the user ID

    3. Specify the MD5 hash digest of the new password (lowercase hex hash, verification required)

    4. Administrators can change anyone's password; regular users can only change their own.

  9. (user_system.ope_ch_nick) Change nickname (cookie-token required)

    1. Specify your own cookie-token

    2. Specify the user ID

    3. Specify the new nickname (note length verification)

    4. Administrators can modify anyone's nickname; regular users can only modify their own nickname.

  10. (user_system.ope_ch_intro) Modify Profile (Requires cookie-token)

    1. Specify your own cookie-token

    2. Specify your user ID

    3. Specify the new profile (note length validation)

    4. Administrators can modify anyone's profile; regular users can only modify their own profile.

  11. (user_system.ope_set_admin) Set Administrator (Requires cookie-token)

    1. Specify your own cookie-token

    2. Specify your user ID

    3. Only administrators can set other users as administrators.

  12. (user_system.ope_unset_admin) Unset Administrator (Requires cookie-token)

    1. Specify your own cookie-token

    2. Specify your user ID

    3. Only administrators can unset other users as administrators.

    4. Administrators cannot revoke their own administrator status.

  13. (user_system.ope_new_inv) Add Invitation Code (Requires Cookie-token)

    1. Specify your own cookie-token

    2. Specify expiration time

    3. Specify the number of registrations that can be used

    4. Only administrators can add invitation codes.

  14. (user_system.ope_del_inv) Delete Invitation Code (Requires Cookie-token)

    1. Specify your own cookie-token

    2. Specify the invitation code

    3. Only administrators can delete invitation codes.

  15. (user_system.ope_del_usr) Delete User (Requires Cookie-token)

    1. Specify your own cookie-token

    2. Specify user ID

    3. Administrators can delete any non-administrator user; regular users can only delete their own users.

  16. (user_system.ope_ilist) View Invitation Code List (Requires Cookie-token)

    1. Only administrators can view the invitation code list.

    2. You can see the content, remaining uses, and expiration time of each invitation code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

user_system-0.0.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

user_system-0.0.1-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file user_system-0.0.1.tar.gz.

File metadata

  • Download URL: user_system-0.0.1.tar.gz
  • Upload date:
  • Size: 14.1 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

Hashes for user_system-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e6ce09181da22ad65c1f1b1f46caa060790a505872737a16b9465e0d2d42f436
MD5 c7b3c25a2df3aecf07cb55134f36a0e7
BLAKE2b-256 dfa6f37cb6f9d969faa8e4a9ba4daf80f1f2362d46058a38b3b4e21c0d64764a

See more details on using hashes here.

File details

Details for the file user_system-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: user_system-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.8 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

Hashes for user_system-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ab44a5475603230ba066632446e7316280ddf2bea9afb4e27906793089660a6a
MD5 d0b5b6e9736df1d3671876f0de74964d
BLAKE2b-256 d049ebf0c6a6cde2e3f55dec852741e1c0cbf477e4ecdb90851b325f87438f0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page