feat: add API routes and endpoints
- Add authentication routes for login, logout, and token refresh - Add user management routes with proper authorization - Add session management routes for session operations - Add access control routes for API permissions - Add test routes for development and debugging - Include proper route grouping and middleware application - Implement RESTful API design patterns
This commit is contained in:
19
routes/test.go
Normal file
19
routes/test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"git.secnex.io/secnex/idp-api/api"
|
||||
"git.secnex.io/secnex/idp-api/middlewares"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func TestRoutes(app fiber.Router) {
|
||||
user := app.Group("/test")
|
||||
|
||||
user.Get("/", middlewares.ApiKeyMiddleware(), func(c *fiber.Ctx) error {
|
||||
user := c.Locals("user")
|
||||
return api.Success(c, fiber.Map{
|
||||
"ip": c.IP(),
|
||||
"user": user,
|
||||
}, fiber.StatusOK, nil, nil)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user