-
|
Hey, I have lots of illegitimate requests to my public API which try to access paths commonly associated with certain vulnerable software. Most of the request are blocked by a web application firewall, but some still make it through and cause harm-less but unnecessary errors. As my API only hosts tRPC, I simply want to block all request to paths not covered by a router and sub-router. Is there function to get a list of paths for a given |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Turns out an |
Beta Was this translation helpful? Give feedback.
-
|
I figured something out with the help of AI, just gonna paste here just in case it helps. import type { AppRouter } from "./main-router"; /**
/**
export type AppRouterPaths = ExtractAllProcedurePaths & {}; |
Beta Was this translation helpful? Give feedback.
Turns out an
Object.keys(router._def.procedures)is enough