feat: Add subscriber management API endpoints with RBAC authorization

- Add SubscriberHandler to serverDeps with NewSubscriberService initialization
- Add subscriber routes to v1 API with GET (list, by id, by IMSI) and protected POST/PUT operations
- Add RBAC enforcement for subscriber creation, updates, suspension, and termination (admin, operator roles)
- Add registerSubscriberRoutes function with /subscribers endpoint group
This commit is contained in:
nutcas3
2026-04-25 05:28:14 +03:00
parent d4113d7148
commit 2c5d513c4b
2 changed files with 18 additions and 0 deletions
+3
View File
@@ -18,6 +18,7 @@ type serverDeps struct {
casbinSvc *rbac.CasbinService
authH *handlers.AuthHandler
subscriberH *handlers.SubscriberHandler
servicesH *handlers.ServicesHandler
monitoringH *handlers.MonitoringHandler
deploymentsH *handlers.DeploymentsHandler
@@ -46,6 +47,7 @@ func buildDeps(db *database.Database, cfg *config.Config) *serverDeps {
configStoreSvc := services.NewConfigStoreService(db)
deploymentSvc := services.NewDeploymentService(db)
promSvc := monitoring.NewPrometheusService()
subscriberSvc := services.NewSubscriberService(db, cfg)
// Initialize charging engine client
chargingEngineClient := services.NewChargingEngineClient(&cfg.ChargingEngine)
@@ -59,6 +61,7 @@ func buildDeps(db *database.Database, cfg *config.Config) *serverDeps {
authSvc: authSvc,
casbinSvc: casbinSvc,
authH: handlers.NewAuthHandler(authSvc),
subscriberH: handlers.NewSubscriberHandler(subscriberSvc),
servicesH: handlers.NewServicesHandler(k8sSvc),
monitoringH: handlers.NewMonitoringHandler(promSvc),
deploymentsH: handlers.NewDeploymentsHandler(deploymentSvc),