-
Notifications
You must be signed in to change notification settings - Fork 508
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
Question: arguments-aware authorization possible? #1513
Comments
Hello there ondrejpar 👋 Thank you for opening your very first issue in this project. We will try to get back to you as soon as we can.👀 |
But the request object |
@WoH well, yes, but I would have to parse the path again and keep patterns in sync at two different places - not DRY. |
Then you probably want your own Decorator. |
Did that and works perfectly. I created my own Authorizer (the code is a bit complex for Typescript 4, I think it could be simplified for Typescript 5) which uses Proxy to intercept all calls to the annotated class and performs authorization. In fact, it's all completely independent on TSOA. |
Hi, I have a controller similar to this:
I need to verify (authorize) that caller can access the shop identified by shopId. The authorization is quite complex and involves database.
I can add
await authorizeShopAccess(shopId)
to the beginning of every method, but is there a way to write this only once? As far as I can tell, the middlewares don't have access to path parameters (or arguments in general) and @Security only handles authentication, not authorization.Sorting
I'm submitting a ...
I confirm that I
The text was updated successfully, but these errors were encountered: