Introduction
FakeComWorld is a modular .NET C# project designed to simulate diverse messaging providers for educational purposes. Each provider mimics real-world communication APIs, featuring unique authentication mechanisms, error injection, and response formats.
This project is intended for students to practice integrating with different types of APIs, handling errors, and implementing robust client solutions.
The project includes four distinct API types:
| Provider Name | API Type | Description | Documentation |
|---|---|---|---|
| ⚡ SwiftSend ⚡ | REST (API Key) | Traditional REST API with X-API-KEY validation. | View Docs |
| 🔒 SecurePost 🔒 | REST (JWT) | REST API with JWT authentication. Tokens must be obtained via a separate endpoint. | View Docs |
| ☎ LegacyLink ☎ | SOAP | Legacy SOAP API with BASIC authentication. | View Docs |
| 📋 AsyncFlow 📋 | REST (Async) | Asynchronous API: submit commands and check status later. | View Docs |
API Overview
Please note for all requests the X-STUDENT-GROUP header is mandatory. This header is used to distinguish requests from different student groups in a production scenario.
1. ⚡ SwiftSend (REST API with X-API-KEY) ⚡
- Authentication: X-API-KEY header.
- Features: Simulates delays, random errors, and rate limiting.
- Use Case: Ideal for students to practice handling API keys and RESTful communication.
- 📋 [Full Documentation]
2. 🔒 SecurePost (REST API with JWT) 🔒
- Authentication: JWT token obtained via a login endpoint.
- Features: Token-based authentication, error injection, and simulated latency.
- Use Case: Teaches students about token management and secure REST communication.
- 📋 [Full Documentation]
3. ☎ LegacyLink (SOAP API with BASIC Auth) ☎
- Authentication: BASIC authentication header.
- Features: SOAP XML contract, error simulation, and legacy protocol handling.
- Use Case: Introduces students to SOAP APIs and BASIC authentication.
- 📋 [Full Documentation]
4. 📋 AsyncFlow (Async API) 📋
- Authentication: X-API-KEY header.
- Features: Command submission, status polling, and simulated processing delays.
- Use Case: Demonstrates asynchronous workflows and status tracking.
- 📋 [Full Documentation]
Error Handling
All APIs simulate real-world conditions. Students are encouraged to implement robust error handling and retry mechanisms in their client applications.
Configuration
The application can be configured using environment variables. Below is a complete list of all available configuration options.
SwiftSend Configuration
| Environment Variable | Description | Default Value |
|---|---|---|
SwiftSend__ApiKey | API key required for authentication | your-api-key-here |
SwiftSend__RateLimit | Maximum number of requests allowed within the time window | 10 |
SwiftSend__RateLimitWindowInSeconds | Time window in seconds for rate limiting | 60 |
SwiftSend__MaxDelayInMilliseconds | Maximum simulated delay for requests | 5000 |
SwiftSend__FaultInjectionRatePercentage | Percentage of requests that will fail randomly | 10 |
SecurePost Configuration
| Environment Variable | Description | Default Value |
|---|---|---|
SecurePost__ClientId | Client ID for authentication | securepost-client-id |
SecurePost__ClientSecret | Client secret for authentication | securepost-secret-key |
SecurePost__JwtSecret | Secret key for JWT token signing (minimum 32 characters) | your-secret-key-min-32-characters-long-for-security |
SecurePost__JwtExpiryInMinutes | JWT token expiration time in minutes | 3 |
SecurePost__RateLimitAuth | Rate limit for authentication endpoint | 3 |
SecurePost__RateLimitMessage | Rate limit for message endpoints | 10 |
SecurePost__RateLimitWindowInSeconds | Time window in seconds for rate limiting | 60 |
SecurePost__MaxDelayInMilliseconds | Maximum simulated delay for requests | 5000 |
SecurePost__FaultInjectionRatePercentage | Percentage of requests that will fail randomly | 10 |
LegacyLink Configuration
| Environment Variable | Description | Default Value |
|---|---|---|
LegacyLink__Username | Username for BASIC authentication | legacylink-user |
LegacyLink__Password | Password for BASIC authentication | legacylink-password |
LegacyLink__MinDelayInMilliseconds | Minimum simulated delay for SOAP requests | 100 |
LegacyLink__MaxDelayInMilliseconds | Maximum simulated delay for SOAP requests | 3000 |
AsyncFlow Configuration
| Environment Variable | Description | Default Value |
|---|---|---|
AsyncFlow__ApiKey | API key required for authentication | asyncflow-api-key |
AsyncFlow__RateLimit | Maximum number of requests allowed within the time window | 20 |
AsyncFlow__RateLimitWindowInSeconds | Time window in seconds for rate limiting | 60 |
AsyncFlow__ProcessingIntervalInSeconds | Interval at which background processing runs | 5 |
AsyncFlow__MinProcessingDelayInSeconds | Minimum time for command processing | 2 |
AsyncFlow__MaxProcessingDelayInSeconds | Maximum time for command processing | 30 |
AsyncFlow__FailureRatePercentage | Percentage of commands that will fail during processing | 5 |