falcon icon indicating copy to clipboard operation
falcon copied to clipboard

feat: Override middleware configuration for a certain route, sink, or static route

Open kgriffs opened this issue 6 years ago • 2 comments

Example use case: Implement a health check endpoint that excludes an auth middleware but retains middleware that adds a trace id to req.context.

kgriffs avatar May 11 '18 21:05 kgriffs

Another use case from @adsahay_twitter on Gitter:

Is it possible to assign different set of middleware for different paths/resources? For instance - while normally our JSON API expects an API key, there are certain callback urls where other services redirect to our url upon completing a transaction - and they do a simple redirect without API key. Therefore, these endpoints do not need the middleware that checks for valid API keys.

First instinct - use "ResourceGroups" (list of Resources) and apply middleware to them, which overrides app.middleware.

kgriffs avatar May 11 '18 22:05 kgriffs

Hello @kgriffs, I think that a functionality to handle a process_request before routing will be broken. Do you have any good idea how to resolve this issue?

dmvass avatar Oct 13 '18 19:10 dmvass