I've been trying this for the past hours without any success. Basically, I want to implement my own middlewares to check for permissions. The security policies are good for authentication, but not enough for my needs. I thought I could create my own middlewares and end the request, or return next(error), but that always ends in validation error.
The security middleware from swagger-tools seems to be exiting early when an authentication error occurs, but I did not figure out how to reproduce this behaviour. So there goes my question, how do I implement another set of security middlewares to early bail from an unauthorised request?
I've been trying this for the past hours without any success. Basically, I want to implement my own middlewares to check for permissions. The security policies are good for authentication, but not enough for my needs. I thought I could create my own middlewares and end the request, or return
next(error)
, but that always ends in validation error.The security middleware from swagger-tools seems to be exiting early when an authentication error occurs, but I did not figure out how to reproduce this behaviour. So there goes my question, how do I implement another set of security middlewares to early bail from an unauthorised request?
Any suggestion is welcome. Thanks!