Skip to content

Commit 8f7a85a

Browse files
committed
refactor(routes): remove redundant middleware documentation
- Removed detailed documentation from _middleware.dart file - Kept existing middleware functions intact
1 parent baec763 commit 8f7a85a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

routes/api/v1/data/_middleware.dart

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,6 @@ import 'package:flutter_news_app_api_server_full_source_code/src/rbac/permission
88
import 'package:flutter_news_app_api_server_full_source_code/src/rbac/permissions.dart';
99
import 'package:flutter_news_app_api_server_full_source_code/src/registry/model_registry.dart';
1010

11-
/// Middleware specific to the generic `/api/v1/data` route path.
12-
///
13-
/// This middleware chain performs the following in order:
14-
/// 1. **Authentication Check (`requireAuthentication`):** Ensures that the user
15-
/// is authenticated. If not, it aborts the request with a 401.
16-
/// 2. **Data Rate Limiting (`_dataRateLimiterMiddleware`):** Applies a
17-
/// configurable, user-centric rate limit. Bypassed by admin/publisher roles.
18-
/// 3. **Model Validation & Context Provision (`_modelValidationAndProviderMiddleware`):**
19-
/// - Validates the `model` query parameter.
20-
/// - Looks up the `ModelConfig` from the `ModelRegistryMap`.
21-
/// - Provides the `ModelConfig` and `modelName` into the request context.
22-
/// 4. **Authorization Check (`authorizationMiddleware`):** Enforces role-based
23-
/// and model-specific permissions based on the `ModelConfig` metadata.
24-
/// If the user lacks permission, it throws a [ForbiddenException].
25-
///
26-
/// This setup ensures that data routes are protected, have the necessary
27-
/// model-specific configuration available, and access is authorized before
28-
/// reaching the final route handler.
29-
3011
// Helper middleware for applying rate limiting to the data routes.
3112
Middleware _dataRateLimiterMiddleware() {
3213
return (handler) {

0 commit comments

Comments
 (0)