Specifically, a developer can define additional middleware for route actions.
This change allows my server to successfully add my Oauth2.0 scope checks to my desired API endpoints.
I can successfully set the scopes as User.Group.Update or User.Chat.Update to my tokens, and be blocked on API requests if I don't have the required scope.
Note, that for my case, I defined a closure that I provide to each call of the routeActionMiddleware function. I'd still like to have it defined on the server once, but didn't see a way to implement that without significant refactors.
Finally, I can definitely clean this up as desired. Let me know if a different name/key is preferred, or if you want me to remove the type annotations.
Implements #265
Specifically, a developer can define additional middleware for route actions. This change allows my server to successfully add my Oauth2.0 scope checks to my desired API endpoints. I can successfully set the scopes as
User.Group.Update
orUser.Chat.Update
to my tokens, and be blocked on API requests if I don't have the required scope.Note, that for my case, I defined a closure that I provide to each call of the
routeActionMiddleware
function. I'd still like to have it defined on the server once, but didn't see a way to implement that without significant refactors.Finally, I can definitely clean this up as desired. Let me know if a different name/key is preferred, or if you want me to remove the type annotations.