Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 998a374

Browse files
committed
docs(api): update comments for route handler middleware
- Remove unnecessary comments about ownership checks - Clarify that User may be null if not authenticated - Simplify description of the final data operation - Fix typo: "inner-most" should be "innermost"
1 parent b9d844f commit 998a374

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

‎routes/api/v1/data/_middleware.dart‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,12 @@ Handler middleware(Handler handler) {
185185
// route handler).
186186
//
187187
// 5. Actual Route Handler (from `index.dart` or `[id].dart`):
188-
// - This runs last, only if all preceding middlewares pass. It will have
189-
// access to a non-null `User` (if authenticated), `ModelConfig`, and
190-
// `modelName` from the context.
191-
// - It performs the data operation and any necessary handler-level
192-
// ownership checks (if flagged by `ModelActionPermission.requiresOwnershipCheck`).
188+
// - This runs last, only if all preceding middlewares pass. It has
189+
// access to a `User?`, `ModelConfig`, and `modelName` from the context.
190+
// - It performs the final data operation.
193191
//
194192
return handler
195-
.use(authorizationMiddleware()) // Applied fourth (inner-most)
193+
.use(authorizationMiddleware()) // Applied fourth (innermost)
196194
.use(_dataRateLimiterMiddleware()) // Applied third
197195
.use(_conditionalAuthenticationMiddleware()) // Applied second
198196
.use(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /