|
| 1 | +# crAPI – Happy Path Guide |
| 2 | + |
| 3 | +## Purpose of This Document |
| 4 | +crAPI (Completely Ridiculous API) is intentionally vulnerable, but new users often struggle to understand |
| 5 | +how the application is supposed to work *before* exploring security issues. |
| 6 | + |
| 7 | +This document explains the **happy path** — the normal, intended workflow — so users can: |
| 8 | +- Understand application behavior |
| 9 | +- Navigate APIs with confidence |
| 10 | +- Clearly differentiate expected behavior vs vulnerabilities |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | +Before following this guide, ensure: |
| 16 | +- crAPI is running locally using Docker |
| 17 | +- You can access: |
| 18 | + - Swagger UI (OpenAPI) |
| 19 | + - Postman collection (optional but recommended) |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Application Overview (Conceptual) |
| 24 | +crAPI simulates a backend system for: |
| 25 | +- User identity and authentication |
| 26 | +- User profiles |
| 27 | +- Mechanic services |
| 28 | +- Orders and notifications |
| 29 | + |
| 30 | +The happy path represents **how a legitimate user interacts with the system**. |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Happy Path Workflow (High Level) |
| 35 | + |
| 36 | +1. User signs up |
| 37 | +2. User logs in |
| 38 | +3. User accesses their profile |
| 39 | +4. User interacts with available APIs as intended |
| 40 | +5. System responds with valid data and permissions |
| 41 | + |
| 42 | +--- |
| 43 | + |
| 44 | +## Step-by-Step Happy Path |
| 45 | + |
| 46 | +### 1. User Registration |
| 47 | +**Goal:** Create a new user account |
| 48 | + |
| 49 | +- Endpoint: `/identity/api/auth/signup` |
| 50 | +- Action: |
| 51 | + - Provide email, username, and password |
| 52 | +- Expected Result: |
| 53 | + - Successful registration confirmation |
| 54 | + |
| 55 | +This step establishes a valid user identity in the system. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +### 2. User Login |
| 60 | +**Goal:** Authenticate and obtain an access token |
| 61 | + |
| 62 | +- Example endpoint: `/identity/api/auth/signup` |
| 63 | +- Action: |
| 64 | + - Login using registered credentials |
| 65 | +- Expected Result: |
| 66 | + - Access token returned |
| 67 | + |
| 68 | +This token is required for all authenticated API calls. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### 3. Access User Profile |
| 73 | +**Goal:** Verify authenticated access |
| 74 | + |
| 75 | +- Example endpoint: `/identity/api/auth/signup` |
| 76 | +- Action: |
| 77 | + - Include access token in Authorization header |
| 78 | +- Expected Result: |
| 79 | + - User’s own profile data is returned |
| 80 | + |
| 81 | +This confirms authentication and authorization are working as intended. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +### 4. Explore Available APIs |
| 86 | +**Goal:** Understand normal system behavior |
| 87 | + |
| 88 | +- Browse Swagger UI to view: |
| 89 | + - User APIs |
| 90 | + - Mechanic APIs |
| 91 | + - Order-related APIs |
| 92 | +- Execute read-only or permitted actions |
| 93 | + |
| 94 | +This step helps users recognize **expected responses** and permissions. |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### 5. Normal Application Usage |
| 99 | +**Goal:** Follow intended business logic |
| 100 | + |
| 101 | +- Create or view resources where permitted |
| 102 | +- Receive appropriate success or error responses |
| 103 | +- Observe correct access controls |
| 104 | + |
| 105 | +At this stage, users fully understand the baseline system behavior. |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Why This Matters |
| 110 | +Understanding the happy path allows users to: |
| 111 | +- Identify where behavior deviates from expectations |
| 112 | +- Recognize insecure authorization or validation |
| 113 | +- Learn API security concepts more effectively |
| 114 | + |
| 115 | +This guide should be followed **before attempting any challenges or exploitation**. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +## Next Steps |
| 120 | +Once the happy path is clear, users can proceed to: |
| 121 | +- `docs/challenges.md` |
| 122 | +- `docs/challengeSolutions.md` |
| 123 | + |
| 124 | +to explore vulnerabilities intentionally built into crAPI. |
0 commit comments