1
0

feat: endpoint to get all token routes

This commit is contained in:
kolaente
2023-08-31 17:02:25 +02:00
parent e518fb1191
commit 1ca93a678e
2 changed files with 108 additions and 0 deletions

View File

@ -202,6 +202,9 @@ func RegisterRoutes(e *echo.Echo) {
// API Routes
a := e.Group("/api/v1")
e.OnAddRouteHandler = func(host string, route echo.Route, handler echo.HandlerFunc, middleware []echo.MiddlewareFunc) {
collectRoutesForAPITokenUsage(route)
}
registerAPIRoutes(a)
}
@ -286,6 +289,7 @@ func registerAPIRoutes(a *echo.Group) {
setupMetricsMiddleware(a)
a.POST("/tokenTest", apiv1.CheckToken)
a.GET("/routes", GetAvailableAPIRoutesForToken)
// User stuff
u := a.Group("/user")