Skip to content

Commit d385c55

Browse files
Docs: Add Happy Path guide for crAPI. (#360)
* docs: add -L flag to curl commands to follow redirects * docs: add happy path guide and link from README --------- Co-authored-by: Roshan Piyush <piyush.roshan@gmail.com>
1 parent e575f83 commit d385c55

2 files changed

Lines changed: 133 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ know more about crAPI, please check [crAPI's overview][overview].
1010

1111
## QuickStart Guide
1212

13+
### Application Workflow (Happy Path)
14+
15+
After setting up crAPI, it is recommended to follow the intended user workflow
16+
to understand how the application is supposed to work before attempting any
17+
security challenges.
18+
19+
-[Application Workflow (Happy Path)](docs/happy-path.md)
20+
21+
1322
### Docker and docker compose
1423

1524
You'll need to have Docker and docker compose installed and running on your host system. Also, the version of docker compose should be `1.27.0` or above. Check your docker compose version using:

docs/happy-path.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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

Comments
 (0)