@@ -118,6 +118,7 @@ func (a *App) registerHandlers() {
118118 userRouter := authRouter .PathPrefix ("/user" ).Subrouter ()
119119 invoiceRouter := authRouter .PathPrefix ("/invoice" ).Subrouter ()
120120 cardRouter := userRouter .PathPrefix ("/card" ).Subrouter ()
121+ logRouter := userRouter .PathPrefix ("/log" ).Subrouter ()
121122 notificationRouter := authRouter .PathPrefix ("/notification" ).Subrouter ()
122123 vmRouter := authRouter .PathPrefix ("/vm" ).Subrouter ()
123124 k8sRouter := authRouter .PathPrefix ("/k8s" ).Subrouter ()
@@ -156,6 +157,8 @@ func (a *App) registerHandlers() {
156157 cardRouter .HandleFunc ("" , WrapFunc (a .ListCardHandler )).Methods ("GET" , "OPTIONS" )
157158 cardRouter .HandleFunc ("/default" , WrapFunc (a .SetDefaultCardHandler )).Methods ("PUT" , "OPTIONS" )
158159
160+ logRouter .HandleFunc ("" , WrapFunc (a .ListLogsHandler )).Methods ("GET" , "OPTIONS" )
161+
159162 invoiceRouter .HandleFunc ("" , WrapFunc (a .ListInvoicesHandler )).Methods ("GET" , "OPTIONS" )
160163 invoiceRouter .HandleFunc ("/{id}" , WrapFunc (a .GetInvoiceHandler )).Methods ("GET" , "OPTIONS" )
161164 invoiceRouter .HandleFunc ("/download/{id}" , WrapFunc (a .DownloadInvoiceHandler )).Methods ("GET" , "OPTIONS" )
@@ -204,10 +207,10 @@ func (a *App) registerHandlers() {
204207 voucherRouter .HandleFunc ("/all/reset" , WrapFunc (a .ResetUsersVoucherBalanceHandler )).Methods ("PUT" , "OPTIONS" )
205208
206209 // middlewares
207- r .Use (middlewares .LoggingMW )
208210 r .Use (middlewares .EnableCors )
209211
210212 authRouter .Use (middlewares .Authorization (a .db , a .config .Token .Secret , a .config .Token .Timeout ))
213+ authRouter .Use (middlewares .AuditLogMiddleware (a .db ))
211214 adminRouter .Use (middlewares .AdminAccess (a .db ))
212215
213216 // prometheus registration
0 commit comments