You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maybe allowed to change the spec.impl or put some magic in contextValues ?
Describe alternatives you've considered
give a proxy object for router.service, return warped func there
Additional context
For opt-in case, I have to add decorator for all methods, I hope I can do opt-out by check the auth in interceptor instead wrap the method when decorate.
While it may seem like a trivial change to expose the implementation, it will open a whole new way of interacting with the router that could have unintended consequences.
For the opt-out cases there are a couple of ways to solve this:
Use an interceptor that accepts an exclude list for bypassing the authentication:
This way the default is to authenticate and you can opt-out of authentication. If you prefer colocation, you can use decorators
to modify a global exclude list (I wouldn't recommend doing that).
Protobuf options can be used to address this problem. You can decorate RPCs with metadata that can be retrieved in an interceptor. There are several projects that use such techniques, one such project is protovalidate. Although it uses options for fields and message, the techniques and process is similar to methods.
I'd suggest starting with option 1 as that is the simplest and most straightforward, as the project's needs change you can evaluate option 2 and implement it if and when needed.
Is your feature request related to a problem? Please describe.
I want to access the metadata for the impl from interceptor, seems this is impossible.
I want to get the
spec.impl
, it's even better to allowed access the service impl givend byrouter.service
connect-es/packages/connect/src/protocol/invoke-implementation.ts
Lines 39 to 71 in a9b4b83
Describe the solution you'd like
maybe allowed to change the
spec.impl
or put some magic in contextValues ?Describe alternatives you've considered
give a proxy object for
router.service
, return warped func thereAdditional context
For opt-in case, I have to add decorator for all methods, I hope I can do opt-out by check the auth in interceptor instead wrap the method when decorate.
The text was updated successfully, but these errors were encountered: