This commit is contained in:
+17
-7
@@ -218,15 +218,25 @@ func main() {
|
||||
jobsGroup.GET("/metrics", jobsHandlers.GetJobMetrics)
|
||||
}
|
||||
|
||||
// Service dependency graph (requires admin permission)
|
||||
// Service dependency graph
|
||||
graphGroup := v1.Group("/graph")
|
||||
graphGroup.Use(auth.AuthMiddleware(), handlers.RequireAdmin())
|
||||
graphGroup.Use(auth.AuthMiddleware())
|
||||
{
|
||||
graphGroup.GET("", graphHandlers.GetYAML)
|
||||
graphGroup.PUT("", graphHandlers.UpdateYAML)
|
||||
graphGroup.GET("/order", graphHandlers.StartupOrder)
|
||||
graphGroup.GET("/cycle", graphHandlers.CycleCheck)
|
||||
graphGroup.GET("/failure", graphHandlers.GetFailureRootCause)
|
||||
// Read-only endpoints: GET (require view)
|
||||
graphView := graphGroup.Group("")
|
||||
graphView.Use(handlers.RequireView())
|
||||
{
|
||||
graphView.GET("", graphHandlers.GetYAML)
|
||||
graphView.GET("/order", graphHandlers.StartupOrder)
|
||||
graphView.GET("/cycle", graphHandlers.CycleCheck)
|
||||
graphView.GET("/failure", graphHandlers.GetFailureRootCause)
|
||||
}
|
||||
// Write endpoints: PUT (require admin)
|
||||
graphAdmin := graphGroup.Group("")
|
||||
graphAdmin.Use(handlers.RequireAdmin())
|
||||
{
|
||||
graphAdmin.PUT("", graphHandlers.UpdateYAML)
|
||||
}
|
||||
}
|
||||
|
||||
// Agent registration
|
||||
|
||||
Reference in New Issue
Block a user