Nick
RBAC with tRPC
I've always rolled my own, just left an answer to RBAC here: https://discord.com/channels/867764511159091230/1377625055109976204
4 replies
Can I extend the procedure builder?
This is all pretty normal stuff. The ingredients are indeed a middleware, context, and meta
Middlewares can access inputs but there isn't much reason to since auth details should be in headers/cookies. Importantly they can gate access to procedures by throwing unauthorised errors (etc)
createContext()/Context is the best way to extract some bits from headers in a type-safe way, and middlewares can access this state type safely
Meta is great to allow procedures to be configured, like assigning an entitlement key to a procedure which the middleware can then check against the user, again in a type safe way
9 replies
Upgrading from v10 to v11
It should only be on the links now: https://trpc.io/docs/migrate-from-v10-to-v11#transformers-moved
6 replies
how can I set up trpc to work with nested providers?
The recommended approach would be SOA which we have an example for: https://github.com/trpc/trpc/tree/main/examples/soa
4 replies