ID: S202606091025
Status: imported

Tags: avans 2-4 LU1

index

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 NameAPI TypeDescriptionDocumentation
⚑ 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 ☎SOAPLegacy 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]
  • 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 VariableDescriptionDefault Value
SwiftSend__ApiKeyAPI key required for authenticationyour-api-key-here
SwiftSend__RateLimitMaximum number of requests allowed within the time window10
SwiftSend__RateLimitWindowInSecondsTime window in seconds for rate limiting60
SwiftSend__MaxDelayInMillisecondsMaximum simulated delay for requests5000
SwiftSend__FaultInjectionRatePercentagePercentage of requests that will fail randomly10

SecurePost Configuration

Environment VariableDescriptionDefault Value
SecurePost__ClientIdClient ID for authenticationsecurepost-client-id
SecurePost__ClientSecretClient secret for authenticationsecurepost-secret-key
SecurePost__JwtSecretSecret key for JWT token signing (minimum 32 characters)your-secret-key-min-32-characters-long-for-security
SecurePost__JwtExpiryInMinutesJWT token expiration time in minutes3
SecurePost__RateLimitAuthRate limit for authentication endpoint3
SecurePost__RateLimitMessageRate limit for message endpoints10
SecurePost__RateLimitWindowInSecondsTime window in seconds for rate limiting60
SecurePost__MaxDelayInMillisecondsMaximum simulated delay for requests5000
SecurePost__FaultInjectionRatePercentagePercentage of requests that will fail randomly10
Environment VariableDescriptionDefault Value
LegacyLink__UsernameUsername for BASIC authenticationlegacylink-user
LegacyLink__PasswordPassword for BASIC authenticationlegacylink-password
LegacyLink__MinDelayInMillisecondsMinimum simulated delay for SOAP requests100
LegacyLink__MaxDelayInMillisecondsMaximum simulated delay for SOAP requests3000

AsyncFlow Configuration

Environment VariableDescriptionDefault Value
AsyncFlow__ApiKeyAPI key required for authenticationasyncflow-api-key
AsyncFlow__RateLimitMaximum number of requests allowed within the time window20
AsyncFlow__RateLimitWindowInSecondsTime window in seconds for rate limiting60
AsyncFlow__ProcessingIntervalInSecondsInterval at which background processing runs5
AsyncFlow__MinProcessingDelayInSecondsMinimum time for command processing2
AsyncFlow__MaxProcessingDelayInSecondsMaximum time for command processing30
AsyncFlow__FailureRatePercentagePercentage of commands that will fail during processing5