-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more control for middleware pipeline ordering #15716
Comments
Can you please explain why Related: #15173 (comment) |
Most of Orchards own modules have a default ordering of To summarize: For internal modules I guess |
Hmm. We'd then have three ways to configure this (module dependency, I looked into why ASP.NET Core doesn't have anything for middleware dependencies/such ordering, but I couldn't find anything. I guess there's a reason, though. |
Yeah, in normal ASP.NET it's always explicitly ordered in the startup of the app. Only the modularity of Orchard brings this complexity with it 🤷♂️ And I don't have a simple solution yet. |
@gvkries As you said before most of the built-in OC modules have order 0, could you please give me an example when you set the order of your module is not enough? |
See #15173 (comment) for a real world example, but the problem is not limited to this. Any module with a specific order requirement in relation to two ore more other modules will have this problem. You cannot describe ordering without also changing the order of the core modules. |
You can set the order of newly added modules to run before or after any built-in module, let me check the PR that you refer to |
Yes, but you cannot insert in between two or more modules. |
@gvkries IMO there is no ordering issue with orchard and orchard provides you full control maintain order of middleware in your module. The issue in referenced PR comment is due to incorrectly defining the dependency. IMO you really don't need to define feature
|
That's not really suitable here. Unlike something like modules extending Audit Trail or Deployment with their module-specific features, Secure Media is not something that should be enabled without it being explicitly wanted by the user, since it adds overhead to every /media request. |
This would not solve the problem. If you change |
Secure media could be an optional admin setting on media, available when user security and media feature are enabled, can be achieved using requiresfeature without defining media secure feature |
It could, but that's an arbitrary design decision and I opted for an additional feature. This problem here has nothing to do with it, it was just uncovered by working on the secure media. |
Is your feature request related to a problem? Please describe.
When a feature has a dependency on two other features and must explicitly add a middleware in between these two dependencies, ordering cannot be achieved with
ConfigureOrder
alone without possibly changing the order related to other modules.The ordering of startups currently only allows to have one or more dependencies ensuring startup occurs after those dependencies, or a global
Order
andConfigureOrder
property, which changes the order in relation to all other modules.Describe the solution you'd like
It would be beneficial to explicitly set the order only in relation to other dependencies.
The text was updated successfully, but these errors were encountered: