Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release_generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- uses: ncipollo/release-action@v1
id: create_release
with:
name: GPT Computer Assistant ${{ steps.tag_extractor.outputs.latest_tag }}
name: GPT Computer Agent ${{ steps.tag_extractor.outputs.latest_tag }}
generateReleaseNotes: true
tag: ${{ steps.tag_extractor.outputs.latest_tag }}

Expand Down
119 changes: 119 additions & 0 deletions AUTHENTICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Authentication System

This document provides an overview of the authentication system implemented in the GPT Computer Agent.

## Features

- JWT-based authentication
- User registration and login
- Password hashing with bcrypt
- Role-based access control (RBAC)
- Refresh token support
- Secure password reset flow
- API key authentication for programmatic access

## Setup

1. Install the required dependencies:

```bash
pip install python-jose[cryptography] passlib[bcrypt] python-multipart
```

2. Set up your environment variables in `.env`:

```env
# Authentication
SECRET_KEY=your-secret-key-here
ACCESS_TOKEN_EXPIRE_MINUTES=1440 # 24 hours
REFRESH_TOKEN_EXPIRE_DAYS=30
JWT_ALGORITHM=HS256
JWT_ISSUER=gpt-computer-agent

# First superuser (created on first run if no users exist)
FIRST_SUPERUSER=admin@example.com
FIRST_SUPERUSER_PASSWORD=changeme
```

3. Run the database migrations:

```bash
alembic upgrade head
```

## API Endpoints

### Authentication

- `POST /api/auth/register` - Register a new user
- `POST /api/auth/token` - Login and get access token
- `POST /api/auth/refresh` - Refresh access token
- `POST /api/auth/forgot-password` - Request password reset
- `POST /api/auth/reset-password` - Reset password with token

### Users

- `GET /api/users/me` - Get current user info
- `PUT /api/users/me` - Update current user
- `GET /api/users/` - List all users (admin only)
- `GET /api/users/{user_id}` - Get user by ID
- `PUT /api/users/{user_id}` - Update user (admin or self)
- `DELETE /api/users/{user_id}` - Delete user (admin only)

## Usage

### Register a new user

```bash
curl -X 'POST' \
'http://localhost:8000/api/auth/register' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"email": "user@example.com",
"username": "user",
"password": "string",
"full_name": "string"
}'
```

### Login

```bash
curl -X 'POST' \
'http://localhost:8000/api/auth/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=&username=user%40example.com&password=string&scope=&client_id=&client_secret='
```

### Make authenticated request

```bash
curl -X 'GET' \
'http://localhost:8000/api/users/me' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
```

## Security Considerations

- Always use HTTPS in production
- Store secrets in environment variables, never in code
- Set appropriate CORS policies
- Implement rate limiting
- Use secure, random secret keys
- Keep dependencies updated
- Regularly rotate secrets

## Testing

To run the test suite:

```bash
pytest tests/
```

## License

This authentication system is part of the GPT Computer Agent project and is licensed under the MIT License.
6 changes: 3 additions & 3 deletions README.TR.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/36714716-6990-40b0-84d5-cd7432811bcb" alt="Logo" >
</a>

<h3 align="center">GPT Computer Assistant</h3>
<h3 align="center">GPT Computer Agent</h3>
<p align="center">
<a href="https://discord.gg/qApFmWMt8x"><img alt="Static Badge" src="https://img.shields.io/badge/Discord-Join?style=social&logo=discord" width=150></a>
</p>
Expand Down Expand Up @@ -230,11 +230,11 @@ https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/26ae3624-e619-4
<table>
<tr>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/b4a4f11e-5588-4656-b5d7-b612a9a2855b" alt="Take Meeting Notes" width="500"/></td>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/49eeac70-b33a-4ec4-8125-64127621ed62" alt="Daily Assistant" width="500"/></td>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/49eeac70-b33a-4ec4-8125-64127621ed62" alt="DailyAgent" width="500"/></td>
</tr>
<tr>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/10b69a18-033c-4d81-8ac9-f4e3c65b59c3" alt="Read Docs" width="500"/></td>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/0f483bae-ffaf-4311-8653-c0dc64fb5ebe" alt="Coding Assistant" width="500"/></td>
<td><img src="https://github.com/khulnasoft/gpt-computer-agent/assets/41792982/0f483bae-ffaf-4311-8653-c0dc64fb5ebe" alt="CodingAgent" width="500"/></td>

</tr>
</table>
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</p>

<p align="center">
<a href="https://www.producthunt.com/posts/gpt-computer-agent?embed=true&utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-gpt&#0045;computer&#0045;assistant" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=465468&theme=dark&period=daily" alt="GPT&#0032;Computer&#0032;Assistant - Create&#0032;intelligence&#0032;for&#0032;your&#0032;products | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
<a href="https://www.producthunt.com/posts/gpt-computer-agent?embed=true&utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-gpt&#0045;computer&#0045;agent" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-badge.svg?post_id=465468&theme=dark&period=daily" alt="GPT&#0032;Computer&#0032;agent - Create&#0032;intelligence&#0032;for&#0032;your&#0032;products | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
.
<a href="https://discord.gg/qApFmWMt8x"><img alt="Static Badge" src="https://img.shields.io/badge/Discord-Join?style=social&logo=discord" width=150></a>
.
Expand Down Expand Up @@ -125,7 +125,7 @@ remote.save_openai_api_key("sk-**")
# Name of the assitant:
remote.change_name("X Intelligence")

#Developer personna of the assistant:
#Developer personna of the agent:
remote.change_developer("X Company")
```

Expand Down Expand Up @@ -180,7 +180,7 @@ def my_server_status() -> bool:

### remote.input

Talk with assistant, about user and computer. With this api you can create an consulting process.
Talk with agent, about user and computer. With this api you can create an consulting process.

```markdown
`Hi, look to user window and return which app using now`
Expand Down Expand Up @@ -254,7 +254,7 @@ print(output)
| Text Inputs | Completed | Q2 2024 |
| Just Text Mode (Mute Speech) | Completed | Q2 2024 |
| Added profiles (Different Chats) | Completed | Q2 2024 |
| More Feedback About Assistant Status | Completed | Q2 2024 |
| More Feedback AboutAgent Status | Completed | Q2 2024 |
| Local Model Vision and Text (With Ollama, and vision models) | Completed | Q2 2024 |
| **Our Customizable Agent Infrastructure** | Completed | Q2 2024 |
| Supporting Groq Models | Completed | Q2 2024 |
Expand Down Expand Up @@ -307,7 +307,7 @@ At this time we have many infrastructure elements. We just aim to provide whole
| **[Add more tool](https://github.com/khulnasoft/gpt-computer-agent/blob/master/gpt_computer_agent/standard_tools.py)** | ? |

### Predefined Agents
If you enable it your assistant will work with these teams:
If you enable it your agent will work with these teams:

| Team Name | Status |
|------------------------------------|----------------------------------|
Expand Down
160 changes: 0 additions & 160 deletions README.zh_CN.md

This file was deleted.

Loading