feat(api): organization-owned regions, checkers and status page servers
Organizations create regions and agents for themselves under Regions & checkers; an org checker only receives its org's monitors. Platform admins manage shared regions and agents in the admin panel or with the CLI, which gains 'api admin grant|revoke'. The first user of a self-hosted installation becomes a platform admin. Region lists show the org's own regions first. Closes #52 Refs #29 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
1 parent
607798d742
commit
22f0740056
19 files changed
+1932
-301
No files matched your search
+15
-1
@@ -86,7 +86,6 @@ func (s *Server) Mount(r gin.IRouter) {
|
||||
|
||||
v1 := g.Group("/api/v1")
|
||||
v1.POST("/locale", s.setLocale)
|
||||
v1.GET("/regions", auth.Require(), s.listRegions)
|
||||
|
||||
a := v1.Group("/auth")
|
||||
a.POST("/signup", s.signup)
|
||||
@@ -113,6 +112,21 @@ func (s *Server) Mount(r gin.IRouter) {
|
||||
org.PUT("/monitors/:id", can(authz.MonitorsWrite), s.updateMonitor)
|
||||
org.DELETE("/monitors/:id", can(authz.MonitorsWrite), s.deleteMonitor)
|
||||
|
||||
org.GET("/regions", can(authz.MonitorsRead), s.listOrgRegions)
|
||||
org.POST("/regions", sessionOnly(), can(authz.OrgManage), s.createOrgRegion)
|
||||
org.DELETE("/regions/:id", sessionOnly(), can(authz.OrgManage), s.deleteOrgRegion)
|
||||
org.GET("/agents", can(authz.OrgManage), s.listOrgAgents)
|
||||
org.POST("/agents", sessionOnly(), can(authz.OrgManage), s.createOrgAgent)
|
||||
org.DELETE("/agents/:id", sessionOnly(), can(authz.OrgManage), s.deleteOrgAgent)
|
||||
|
||||
admin := v1.Group("/admin", s.requireAdmin())
|
||||
admin.GET("/regions", s.adminListRegions)
|
||||
admin.POST("/regions", s.adminCreateRegion)
|
||||
admin.DELETE("/regions/:id", s.adminDeleteRegion)
|
||||
admin.GET("/agents", s.adminListAgents)
|
||||
admin.POST("/agents", s.adminCreateAgent)
|
||||
admin.DELETE("/agents/:id", s.adminDeleteAgent)
|
||||
|
||||
org.GET("/incidents", can(authz.IncidentsRead), s.listIncidents)
|
||||
|
||||
org.GET("/channels", can(authz.NotificationsRead), s.listChannels)
|
||||
|
||||
Reference in new issue
Block a user