2022-12-31 10:22:38 +01:00
|
|
|
package browser_extension
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
2023-01-30 19:59:42 +01:00
|
|
|
"github.com/twofas/2fas-server/internal/websocket/common"
|
2022-12-31 10:22:38 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type RoutesHandler struct {
|
|
|
|
connectionHandler *common.ConnectionHandler
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewRoutesHandler(handler *common.ConnectionHandler) *RoutesHandler {
|
|
|
|
return &RoutesHandler{
|
|
|
|
connectionHandler: handler,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func GinRoutesHandler(routes *RoutesHandler, router *gin.Engine) {
|
2023-03-07 23:34:29 +01:00
|
|
|
router.GET("/browser_extensions/:extension_id", routes.connectionHandler.Handler())
|
|
|
|
router.GET("/browser_extensions/:extension_id/2fa_requests/:token_request_id", routes.connectionHandler.Handler())
|
2022-12-31 10:22:38 +01:00
|
|
|
|
|
|
|
router.GET("/health", func(c *gin.Context) {
|
|
|
|
c.String(200, "")
|
|
|
|
})
|
|
|
|
}
|