delphimvcframework icon indicating copy to clipboard operation
delphimvcframework copied to clipboard

[feature_filters] Update TMVCSwaggerMiddleware to be a protocol filter

Open danieleteti opened this issue 2 years ago • 3 comments
trafficstars

In 4.0.0-oxygen middlewares will be splittend in "protocol" and "controller" filters (read this for more info) TMVCSwaggerMiddleware must be converted in a Protocol Filter.

@joaoduarte19 could you convert it? I was wondering if a filter in charge to do some king of authentication could implement a IAuthAuthFilter too.

danieleteti avatar Jul 16 '23 14:07 danieleteti

What is the thinking behind the change from middleware to filters - as this looks to be quite a breaking change. For instance I have an OIDC filter that handles authentication (by checking the bearer token) and also authorisation (by looking at custom attributes on the controller class and actions.) Would I be required to split the functions ?

fastbike avatar Jul 16 '23 19:07 fastbike

It is really important for code symmetricity. Let's say we have 3 Middleware and the 3rd raise an exception in the OnBeforeRouting, by design should be executed only the OnAfterRouting of the first two. It's quite complex to handle and is not robust as the filters approach. There is no functionality loss. It's a breaking change easily manageable from the user POV. If you have custom Middleware and you need help to migrate it to the new architecture write me an email and we can arrange a call.

danieleteti avatar Jul 16 '23 22:07 danieleteti

@joaoduarte19 could you convert it? I was wondering if a filter in charge to do some king of authentication could implement a IAuthAuthFilter too.

Yes, I will do the conversion.

joaoduarte19 avatar Jul 17 '23 11:07 joaoduarte19