Perform pipeline order checking at build time #51615
Replies: 1 comment 1 reply
-
There are a handful of analyzers that emit diagnostics for issues with the registration order of things in the pipeline, for example ASP0001: Authorization middleware is incorrectly configured or #48180 which will warn when a custom But I agree, it would be beneficial to have checks in place for more of these scenarios, where feasible. I just noticed that a few of the middlewares listed here (CORS, Output Caching, Response Caching, Request Timeouts) don't appear to have corresponding analyzers, although it seems like it would be relatively easy to create ones. Are there any others that you've run into specifically? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So often I’ve wondered why something isn’t working and it’s then I find some obscure document saying “make sure this goes between app.Something() and app.SomethingElse()”.
What I'd like to see with the whole pipeline thing is some sort of build time dependency check.
Could we have some sort of decoration on the pipeline middlewares like [NotBefore(…)] or [NotAfter(…)] so we can tell if a pipeline step isn't going to work as expected. Maybe it could also emit a severity.
This would be an optional thing to only use if the middleware has these sort of dependencies.
Beta Was this translation helpful? Give feedback.
All reactions