This is a FastAPI project that provides an authentication and admin API with the following functionalities:
- Authentication: User registration, login, and token validation.
- Admin Features: Managing user permissions, banning users, and HWID resets.
- Reseller Management: Reseller license creation.
- Owner Features: Changing user roles.
To run this project locally, you need:
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Install the required packages:
pip install -r requirements.txt
-
Run the application:
uvicorn main:app --reload
-
Open your browser and navigate to:
http://127.0.0.1:8000/docs
You will find the Swagger documentation for the API.
Method | Endpoint | Description |
---|---|---|
POST | /auth/register |
Register a new user. |
POST | /auth/login |
User login. |
POST | /auth/token-check |
Validate a token. |
Method | Endpoint | Description |
---|---|---|
POST | /admin/ban |
Ban a user. |
POST | /admin/unban |
Unban a user. |
POST | /admin/hwid_reset |
Reset HWID for a user. |
POST | /admin/add_time |
Add time to a user. |
POST | /admin/remove_time |
Remove time from a user. |
POST | /admin/freeze_time |
Freeze a user's time. |
Method | Endpoint | Description |
---|---|---|
POST | /reseller/create_license |
Create a reseller license. |
Method | Endpoint | Description |
---|---|---|
POST | /owner/change_role |
Change the role of a user. |
Method | Endpoint | Description |
---|---|---|
POST | /customer/renew_license |
Renew the license. |
POST | /customer/transfer_license |
Transfer the license. |
POST | /customer/reset_password |
Reset the password. |
To access certain admin and reseller endpoints, you need to be authorized. Click the Authorize
button in the API documentation and enter the required credentials.
This project contains several request and response schemas:
- RegisterForm: Schema for registering a new user.
- License: Schema for handling license information.
- TokenCheckRequest: Schema for validating access tokens.
- ValidationError: Schema for validation errors in requests.
The API documentation is available via Swagger UI. You can access it at:
https://professional-faith-colorware-a5c65759.koyeb.app/docs