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
{{ message }}
Repository navigation
Extending Meta with middlewares / concat / plugins #6203
Originally posted by HamishBuckmaster November 7, 2024
Context
Let's set the scene of the problem and some ideas of what could be done.
Let's say we have a base product that is just for authenticating users and we have multiple contexts that can change and you may want to allow for adjusting the context / meta of the request by what products. Say you want the Base Meta to look something like this
Now it would be great if we could create a plugin called "permissionPlugin" that could be "hooked" in to allow the base meta to be extended to look something like this:
So that when we use said plugin using concat it would require the developer to update the meta of the router to include this
foo: protectedProcedure.unstable_concat(permissionPlugin.pluginProc).meta({application: "application-xyz"permission: "foo:bar"// <- This would come into the picture when using the permissionPlugin that has extended the meta})// etc
Be great to get some other ideas on how others have done this in the past other then creating heaps of procedures, this would allow for a more of a "plug & play" what you need into the router
Currently when doing this approach the meta can't be extended because of "meta" mismatch
hi, is this still wanted? the issue is from 2024 and on current main it still is not there: procedure meta still does not extend through middleware concat. i'd actually thread the extra meta types through concat so plugins can add fields. should i send a pr, or did the plan change?
Activity
ArjunCodess commentedon Sep 20, 2026
hi, is this still wanted? the issue is from 2024 and on current main it still is not there: procedure meta still does not extend through middleware concat. i'd actually thread the extra meta types through concat so plugins can add fields. should i send a pr, or did the plan change?