Skip to content

Latest commit

 

History

History
392 lines (334 loc) · 17.5 KB

File metadata and controls

392 lines (334 loc) · 17.5 KB

1 Authentication

Part of: Page Flow Documentation


Flow 1: Registration & First Login

┌─────────────────────────────────────────────────────────────┐
│                    PAGE: / (Landing Page)                    │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  OmoiOS Logo                                         │   │
│  │  "Autonomous Engineering Execution Dashboard"        │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  [Sign Up] [Sign In] [Sign In with GitHub]                  │
│                                                              │
└───────────────────────────┬──────────────────────────────────┘
                            │
        ┌───────────────────┴───────────────────┐
        │                                       │
        │ Click "Sign Up"                        │ Click "Sign In with GitHub"
        │                                       │
        ▼                                       ▼
┌───────────────────────────────┐  ┌───────────────────────────────┐
│  PAGE: /register              │  │ PAGE: /login (OAuth)         │
│  (Email Registration)         │  │                              │
│                               │  │ Redirecting to GitHub...    │
│  ┌─────────────────────────┐ │  │ [Authorize OmoiOS]           │
│  │ Create Account          │ │  │                              │
│  │                         │ │  └──────────────────────────────┘
│  │ Email: [________]      │ │
│  │ Password: [________]    │ │
│  │ Full Name: [________]   │ │
│  │                         │ │
│  │ [Create Account]        │ │
│  └─────────────────────────┘ │
│                               │
└───────────────┬───────────────┘
                │
                │ After registration
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│          PAGE: /verify-email (Email Verification)          │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Verify Your Email                                   │   │
│  │                                                      │   │
│  │  We've sent a verification link to your email.       │   │
│  │  Please check your inbox and click the link.        │   │
│  │                                                      │   │
│  │  [Resend Email] [Change Email]                      │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
└───────────────────────────┬──────────────────────────────────┘
                            │
                            │ Email verified
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│          PAGE: /onboarding (First-Time User)               │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Welcome to OmoiOS!                                   │   │
│  │                                                       │   │
│  │  Let's get you started:                              │   │
│  │  1. Set up your organization                         │   │
│  │  2. Connect your first repository                    │   │
│  │  3. Configure agents                                 │   │
│  │  4. Create your first project                        │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Organization Setup                                  │   │
│  │                                                       │   │
│  │  Organization Name: [________________]               │   │
│  │  Slug: [auto-generated] [Edit]                      │   │
│  │  Description: [________________]                    │   │
│  │                                                       │   │
│  │  Resource Limits:                                   │   │
│  │  Max Concurrent Agents: [5]                         │   │
│  │  Max Runtime Hours: [100.0]                         │   │
│  │                                                       │   │
│  │  Billing Email (optional): [________________]        │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Agent Configuration                                  │   │
│  │                                                       │   │
│  │  Number of Parallel Agents: [1-5] [3]                │   │
│  │                                                       │   │
│  │  Review Requirements:                                 │   │
│  │  ○ Auto-approve (agents proceed automatically)        │   │
│  │  ● Manual approval (require user approval at gates)  │   │
│  │                                                       │   │
│  │  Agent Types:                                         │   │
│  │  ☑ Worker (Execution)                                │   │
│  │  ☑ Planner (Planning)                                │   │
│  │  ☐ Validator (Testing)                               │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Workspace Configuration                              │   │
│  │                                                       │   │
│  │  Workspace Root: [./workspaces] [Change]            │   │
│  │  Worker Directory: [/tmp/omoi_os_workspaces] [Change]│   │
│  │                                                       │   │
│  │  Default Workspace Type:                             │   │
│  │  ○ Local (default)                                   │   │
│  │  ○ Docker                                            │   │
│  │  ○ Kubernetes                                        │   │
│  │  ○ Remote                                           │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  [Skip Tour]  [Start Tour]  [Continue]                     │
│                                                              │
└───────────────────────────┬──────────────────────────────────┘
                            │
                            │ Click "Continue"
                            │
                            ▼
┌─────────────────────────────────────────────────────────────┐
│              PAGE: /dashboard (Empty State)                  │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Sidebar Navigation                                  │   │
│  │  • Home (active)                                     │   │
│  │  • Projects                                         │   │
│  │  • Agents                                           │   │
│  │  • Settings                                         │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Overview Section                                    │   │
│  │  • Total Specs: 0                                    │   │
│  │  • Active Agents: 0                                  │   │
│  │  • Tickets in Progress: 0                            │   │
│  │  • Recent Commits: 0                                 │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Empty State                                         │   │
│  │                                                      │   │
│  │  🎯 No projects yet                                  │   │
│  │                                                      │   │
│  │  Create your first project to get started:          │   │
│  │                                                      │   │
│  │  [Explore New Project]  [Quick Start]              │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Quick Actions                                        │   │
│  │  [+ New Spec] [+ New Project]                        │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
│  ┌──────────────────────────────────────────────────────┐   │
│  │  Recent Activity Feed (Collapsible)                  │   │
│  │  (Empty - no activity yet)                           │   │
│  └──────────────────────────────────────────────────────┘   │
│                                                              │
└─────────────────────────────────────────────────────────────┘

API Integration

Backend Endpoints

All authentication endpoints are prefixed with /api/v1/auth/.


POST /api/v1/auth/register

Description: Register a new user account

Request Body:

{
  "email": "user@example.com",
  "password": "SecurePass123!",
  "full_name": "John Doe",
  "department": "Engineering"
}

Response (201):

{
  "id": "uuid",
  "email": "user@example.com",
  "full_name": "John Doe",
  "department": "Engineering",
  "is_verified": false,
  "created_at": "2025-01-15T10:00:00Z"
}

POST /api/v1/auth/login

Description: Authenticate user and return JWT tokens

Request Body:

{
  "email": "user@example.com",
  "password": "SecurePass123!"
}

Response (200):

{
  "access_token": "eyJ...",
  "refresh_token": "eyJ...",
  "expires_in": 900
}

POST /api/v1/auth/refresh

Description: Refresh access token using refresh token

Request Body:

{
  "refresh_token": "eyJ..."
}

Response (200):

{
  "access_token": "eyJ...",
  "refresh_token": "eyJ...",
  "expires_in": 900
}

POST /api/v1/auth/logout

Description: Logout current user (invalidate session)

Headers: Authorization: Bearer <access_token>

Response (200):

{
  "message": "Logged out successfully"
}

GET /api/v1/auth/me

Description: Get current authenticated user information

Headers: Authorization: Bearer <access_token>

Response (200):

{
  "id": "uuid",
  "email": "user@example.com",
  "full_name": "John Doe",
  "department": "Engineering",
  "is_verified": true,
  "attributes": {}
}

PATCH /api/v1/auth/me

Description: Update current user profile

Headers: Authorization: Bearer <access_token>

Request Body:

{
  "full_name": "John Smith",
  "department": "Product",
  "attributes": { "theme": "dark" }
}

POST /api/v1/auth/verify-email

Description: Verify user email using verification token

Request Body:

{
  "token": "verification-token-from-email"
}

POST /api/v1/auth/forgot-password

Description: Request password reset email

Request Body:

{
  "email": "user@example.com"
}

POST /api/v1/auth/reset-password

Description: Reset password using reset token

Request Body:

{
  "token": "reset-token-from-email",
  "new_password": "NewSecurePass123!"
}

POST /api/v1/auth/change-password

Description: Change password for authenticated user

Headers: Authorization: Bearer <access_token>

Request Body:

{
  "current_password": "OldPass123!",
  "new_password": "NewPass456!"
}

POST /api/v1/auth/api-keys

Description: Create API key for programmatic access

Headers: Authorization: Bearer <access_token>

Request Body:

{
  "name": "CI/CD Pipeline",
  "scopes": ["read:agents", "write:tickets"],
  "organization_id": "org-uuid",
  "expires_in_days": 90
}

Response (201):

{
  "id": "uuid",
  "name": "CI/CD Pipeline",
  "key": "sk_live_...",
  "scopes": ["read:agents", "write:tickets"],
  "created_at": "2025-01-15T10:00:00Z",
  "expires_at": "2025-04-15T10:00:00Z"
}

GET /api/v1/auth/api-keys

Description: List user's API keys

Headers: Authorization: Bearer <access_token>


DELETE /api/v1/auth/api-keys/{key_id}

Description: Revoke an API key

Headers: Authorization: Bearer <access_token>

Path Params: key_id (uuid)


Next: See README.md for complete documentation index.