You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
-`AsyncMiddlewareFunction`: can convert a lambda function (`ArMiddlewareCallback`) to a middleware
273
-
-`AuthenticationMiddleware`: to handle basic/digest authentication globally or per handler
274
-
-`AuthorizationMiddleware`: to handle authorization globally or per handler
275
-
-`CorsMiddleware`: to handle CORS preflight request globally or per handler
276
-
-`HeaderFilterMiddleware`: to filter out headers from the request
277
-
-`HeaderFreeMiddleware`: to only keep some headers from the request, and remove the others
273
+
-`AsyncAuthenticationMiddleware`: to handle basic/digest authentication globally or per handler
274
+
-`AsyncAuthorizationMiddleware`: to handle authorization globally or per handler
275
+
-`AsyncCorsMiddleware`: to handle CORS preflight request globally or per handler
276
+
-`AsyncHeaderFilterMiddleware`: to filter out headers from the request
277
+
-`AsyncHeaderFreeMiddleware`: to only keep some headers from the request, and remove the others
278
278
-`LoggerMiddleware`: to log requests globally or per handler with the same pattern as curl. Will also record request processing time
279
-
-`RateLimitMiddleware`: to limit the number of requests on a windows of time globally or per handler
279
+
-`AsyncRateLimitMiddleware`: to limit the number of requests on a windows of time globally or per handler
280
280
281
-
## How to use authentication with AuthenticationMiddleware
281
+
## How to use authentication with AsyncAuthenticationMiddleware
282
282
283
283
Do not use the `setUsername()` and `setPassword()` methods on the hanlders anymore.
284
284
They are deprecated.
285
285
These methods were causing a copy of the username and password for each handler, which is not efficient.
286
286
287
-
Now, you can use the `AuthenticationMiddleware` to handle authentication globally or per handler.
287
+
Now, you can use the `AsyncAuthenticationMiddleware` to handle authentication globally or per handler.
288
288
289
289
```c++
290
-
AuthenticationMiddleware authMiddleware;
290
+
AsyncAuthenticationMiddleware authMiddleware;
291
291
292
292
// [...]
293
293
@@ -309,10 +309,10 @@ myHandler.addMiddleware(&authMiddleware); // add authentication to a specific ha
309
309
310
310
## Migration to Middleware to improve performance and memory usage
311
311
312
-
-`AsyncEventSource.authorizeConnect(...)` => do not use this method anymore: add a common `AuthorizationMiddleware` to the handler or server, and make sure to add it AFTER the `AuthenticationMiddleware` if you use authentication.
313
-
-`AsyncWebHandler.setAuthentication(...)` => do not use this method anymore: add a common `AuthenticationMiddleware` to the handler or server
312
+
-`AsyncEventSource.authorizeConnect(...)` => do not use this method anymore: add a common `AsyncAuthorizationMiddleware` to the handler or server, and make sure to add it AFTER the `AsyncAuthenticationMiddleware` if you use authentication.
313
+
-`AsyncWebHandler.setAuthentication(...)` => do not use this method anymore: add a common `AsyncAuthenticationMiddleware` to the handler or server
314
314
-`ArUploadHandlerFunction` and `ArBodyHandlerFunction` => these callbacks receiving body data and upload and not calling anymore the authentication code for performance reasons.
315
-
These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time.
315
+
These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AsyncAuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time.
316
316
These callbacks are also not triggering the whole middleware chain since they are not part of the request processing workflow (they are not the final handler).
-`AsyncMiddlewareFunction`: can convert a lambda function (`ArMiddlewareCallback`) to a middleware
273
-
-`AuthenticationMiddleware`: to handle basic/digest authentication globally or per handler
274
-
-`AuthorizationMiddleware`: to handle authorization globally or per handler
275
-
-`CorsMiddleware`: to handle CORS preflight request globally or per handler
276
-
-`HeaderFilterMiddleware`: to filter out headers from the request
277
-
-`HeaderFreeMiddleware`: to only keep some headers from the request, and remove the others
273
+
-`AsyncAuthenticationMiddleware`: to handle basic/digest authentication globally or per handler
274
+
-`AsyncAuthorizationMiddleware`: to handle authorization globally or per handler
275
+
-`AsyncCorsMiddleware`: to handle CORS preflight request globally or per handler
276
+
-`AsyncHeaderFilterMiddleware`: to filter out headers from the request
277
+
-`AsyncHeaderFreeMiddleware`: to only keep some headers from the request, and remove the others
278
278
-`LoggerMiddleware`: to log requests globally or per handler with the same pattern as curl. Will also record request processing time
279
-
-`RateLimitMiddleware`: to limit the number of requests on a windows of time globally or per handler
279
+
-`AsyncRateLimitMiddleware`: to limit the number of requests on a windows of time globally or per handler
280
280
281
-
## How to use authentication with AuthenticationMiddleware
281
+
## How to use authentication with AsyncAuthenticationMiddleware
282
282
283
283
Do not use the `setUsername()` and `setPassword()` methods on the hanlders anymore.
284
284
They are deprecated.
285
285
These methods were causing a copy of the username and password for each handler, which is not efficient.
286
286
287
-
Now, you can use the `AuthenticationMiddleware` to handle authentication globally or per handler.
287
+
Now, you can use the `AsyncAuthenticationMiddleware` to handle authentication globally or per handler.
288
288
289
289
```c++
290
-
AuthenticationMiddleware authMiddleware;
290
+
AsyncAuthenticationMiddleware authMiddleware;
291
291
292
292
// [...]
293
293
@@ -309,10 +309,10 @@ myHandler.addMiddleware(&authMiddleware); // add authentication to a specific ha
309
309
310
310
## Migration to Middleware to improve performance and memory usage
311
311
312
-
-`AsyncEventSource.authorizeConnect(...)` => do not use this method anymore: add a common `AuthorizationMiddleware` to the handler or server, and make sure to add it AFTER the `AuthenticationMiddleware` if you use authentication.
313
-
-`AsyncWebHandler.setAuthentication(...)` => do not use this method anymore: add a common `AuthenticationMiddleware` to the handler or server
312
+
-`AsyncEventSource.authorizeConnect(...)` => do not use this method anymore: add a common `AsyncAuthorizationMiddleware` to the handler or server, and make sure to add it AFTER the `AsyncAuthenticationMiddleware` if you use authentication.
313
+
-`AsyncWebHandler.setAuthentication(...)` => do not use this method anymore: add a common `AsyncAuthenticationMiddleware` to the handler or server
314
314
-`ArUploadHandlerFunction` and `ArBodyHandlerFunction` => these callbacks receiving body data and upload and not calling anymore the authentication code for performance reasons.
315
-
These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time.
315
+
These callbacks can be called multiple times during request parsing, so this is up to the user to now call the `AsyncAuthenticationMiddleware.allowed(request)` if needed and ideally when the method is called for the first time.
316
316
These callbacks are also not triggering the whole middleware chain since they are not part of the request processing workflow (they are not the final handler).
0 commit comments