diff --git a/data/scripts/generate_dispatchers/generator.go b/data/scripts/generate_dispatchers/generator.go index c41f8f440..cd9fed03f 100644 --- a/data/scripts/generate_dispatchers/generator.go +++ b/data/scripts/generate_dispatchers/generator.go @@ -327,55 +327,6 @@ func generateFuncBody(arg reflect.Type, funcName, subsystem string) (p []ast.Stm opts := ast.NewIdent("opts") p = append(p, generateCond(arg, opts, ast.NewIdent("make(map[string]interface{})"), "APIOpts", reflect.Map)...) - p = append(p, &ast.IfStmt{ - Cond: &ast.BinaryExpr{ - X: ast.NewIdent("len(dS.cfg.DispatcherSCfg().AttributeSConns)"), - Op: token.NEQ, - Y: ast.NewIdent("0"), - }, - Body: &ast.BlockStmt{List: []ast.Stmt{ - &ast.IfStmt{ - Init: &ast.AssignStmt{ - Lhs: []ast.Expr{ast.NewIdent("err")}, - Tok: token.ASSIGN, - Rhs: []ast.Expr{&ast.CallExpr{ - Fun: &ast.SelectorExpr{ - X: ast.NewIdent("dS"), - Sel: ast.NewIdent("authorize"), - }, - Args: []ast.Expr{ - ast.NewIdent("ctx"), - &ast.SelectorExpr{ - X: ast.NewIdent("utils"), - Sel: ast.NewIdent(funcName), - }, - tnt, - &ast.CallExpr{ - Fun: &ast.SelectorExpr{ - X: ast.NewIdent("utils"), - Sel: ast.NewIdent("IfaceAsString"), - }, - Args: []ast.Expr{&ast.IndexExpr{ - X: opts, - Index: &ast.SelectorExpr{ - X: ast.NewIdent("utils"), - Sel: ast.NewIdent("OptsAPIKey"), - }, - }}, - }, - }, - }}, - }, - Cond: &ast.BinaryExpr{ - X: ast.NewIdent("err"), - Op: token.NEQ, - Y: ast.NewIdent("nil"), - }, - Body: &ast.BlockStmt{List: []ast.Stmt{&ast.ReturnStmt{}}}, - }, - }, - }, - }) p = append(p, &ast.ReturnStmt{Results: []ast.Expr{&ast.CallExpr{ Fun: &ast.SelectorExpr{ X: ast.NewIdent("dS"), diff --git a/dispatchers/accounts.go b/dispatchers/accounts.go index 208c80a10..55beb4229 100644 --- a/dispatchers/accounts.go +++ b/dispatchers/accounts.go @@ -37,11 +37,6 @@ func (dS *DispatcherService) AccountSv1AccountsForEvent(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1AccountsForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1AccountsForEvent, args, reply) } func (dS *DispatcherService) AccountSv1ActionRemoveBalance(ctx *context.Context, args *utils.ArgsActRemoveBalances, reply *string) (err error) { @@ -54,11 +49,6 @@ func (dS *DispatcherService) AccountSv1ActionRemoveBalance(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1ActionRemoveBalance, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1ActionRemoveBalance, args, reply) } func (dS *DispatcherService) AccountSv1ActionSetBalance(ctx *context.Context, args *utils.ArgsActSetBalance, reply *string) (err error) { @@ -71,11 +61,6 @@ func (dS *DispatcherService) AccountSv1ActionSetBalance(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1ActionSetBalance, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1ActionSetBalance, args, reply) } func (dS *DispatcherService) AccountSv1DebitAbstracts(ctx *context.Context, args *utils.CGREvent, reply *utils.EventCharges) (err error) { @@ -91,11 +76,6 @@ func (dS *DispatcherService) AccountSv1DebitAbstracts(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1DebitAbstracts, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1DebitAbstracts, args, reply) } func (dS *DispatcherService) AccountSv1DebitConcretes(ctx *context.Context, args *utils.CGREvent, reply *utils.EventCharges) (err error) { @@ -111,11 +91,6 @@ func (dS *DispatcherService) AccountSv1DebitConcretes(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1DebitConcretes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1DebitConcretes, args, reply) } func (dS *DispatcherService) AccountSv1GetAccount(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *utils.Account) (err error) { @@ -128,11 +103,6 @@ func (dS *DispatcherService) AccountSv1GetAccount(ctx *context.Context, args *ut if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1GetAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1GetAccount, args, reply) } func (dS *DispatcherService) AccountSv1MaxAbstracts(ctx *context.Context, args *utils.CGREvent, reply *utils.EventCharges) (err error) { @@ -148,11 +118,6 @@ func (dS *DispatcherService) AccountSv1MaxAbstracts(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1MaxAbstracts, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1MaxAbstracts, args, reply) } func (dS *DispatcherService) AccountSv1MaxConcretes(ctx *context.Context, args *utils.CGREvent, reply *utils.EventCharges) (err error) { @@ -168,11 +133,6 @@ func (dS *DispatcherService) AccountSv1MaxConcretes(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1MaxConcretes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1MaxConcretes, args, reply) } func (dS *DispatcherService) AccountSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -188,11 +148,6 @@ func (dS *DispatcherService) AccountSv1Ping(ctx *context.Context, args *utils.CG if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1Ping, args, reply) } func (dS *DispatcherService) AccountSv1RefundCharges(ctx *context.Context, args *utils.APIEventCharges, reply *string) (err error) { @@ -205,10 +160,5 @@ func (dS *DispatcherService) AccountSv1RefundCharges(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AccountSv1RefundCharges, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAccounts, utils.AccountSv1RefundCharges, args, reply) } diff --git a/dispatchers/actions.go b/dispatchers/actions.go index d7608d77a..e118a539a 100644 --- a/dispatchers/actions.go +++ b/dispatchers/actions.go @@ -37,11 +37,6 @@ func (dS *DispatcherService) ActionSv1ExecuteActions(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ActionSv1ExecuteActions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaActions, utils.ActionSv1ExecuteActions, args, reply) } func (dS *DispatcherService) ActionSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -57,11 +52,6 @@ func (dS *DispatcherService) ActionSv1Ping(ctx *context.Context, args *utils.CGR if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ActionSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaActions, utils.ActionSv1Ping, args, reply) } func (dS *DispatcherService) ActionSv1ScheduleActions(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -77,10 +67,5 @@ func (dS *DispatcherService) ActionSv1ScheduleActions(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ActionSv1ScheduleActions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaActions, utils.ActionSv1ScheduleActions, args, reply) } diff --git a/dispatchers/admins.go b/dispatchers/admins.go index 8323d4e87..86e70bb87 100644 --- a/dispatchers/admins.go +++ b/dispatchers/admins.go @@ -36,11 +36,6 @@ func (dS *DispatcherService) AdminSv1ComputeFilterIndexIDs(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1ComputeFilterIndexIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1ComputeFilterIndexIDs, args, reply) } func (dS *DispatcherService) AdminSv1ComputeFilterIndexes(ctx *context.Context, args *utils.ArgsComputeFilterIndexes, reply *string) (err error) { @@ -53,11 +48,6 @@ func (dS *DispatcherService) AdminSv1ComputeFilterIndexes(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1ComputeFilterIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1ComputeFilterIndexes, args, reply) } func (dS *DispatcherService) AdminSv1FiltersMatch(ctx *context.Context, args *engine.ArgsFiltersMatch, reply *bool) (err error) { @@ -73,11 +63,6 @@ func (dS *DispatcherService) AdminSv1FiltersMatch(ctx *context.Context, args *en if args != nil && args.CGREvent != nil { opts = args.CGREvent.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1FiltersMatch, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1FiltersMatch, args, reply) } func (dS *DispatcherService) AdminSv1GetAccount(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *utils.Account) (err error) { @@ -90,11 +75,6 @@ func (dS *DispatcherService) AdminSv1GetAccount(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAccount, args, reply) } func (dS *DispatcherService) AdminSv1GetAccountIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -107,11 +87,6 @@ func (dS *DispatcherService) AdminSv1GetAccountIDs(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAccountIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAccountIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetAccounts(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*utils.Account) (err error) { @@ -124,11 +99,6 @@ func (dS *DispatcherService) AdminSv1GetAccounts(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAccounts, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAccounts, args, reply) } func (dS *DispatcherService) AdminSv1GetAccountsCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -141,11 +111,6 @@ func (dS *DispatcherService) AdminSv1GetAccountsCount(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAccountsCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAccountsCount, args, reply) } func (dS *DispatcherService) AdminSv1GetAccountsIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -158,11 +123,6 @@ func (dS *DispatcherService) AdminSv1GetAccountsIndexesHealth(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAccountsIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAccountsIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetActionProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ActionProfile) (err error) { @@ -175,11 +135,6 @@ func (dS *DispatcherService) AdminSv1GetActionProfile(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetActionProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetActionProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -192,11 +147,6 @@ func (dS *DispatcherService) AdminSv1GetActionProfileIDs(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetActionProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetActionProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetActionProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.ActionProfile) (err error) { @@ -209,11 +159,6 @@ func (dS *DispatcherService) AdminSv1GetActionProfiles(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetActionProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetActionProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetActionProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -226,11 +171,6 @@ func (dS *DispatcherService) AdminSv1GetActionProfilesCount(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetActionProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetActionProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetActionsIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -243,11 +183,6 @@ func (dS *DispatcherService) AdminSv1GetActionsIndexesHealth(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetActionsIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetActionsIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetAttributeProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.APIAttributeProfile) (err error) { @@ -260,11 +195,6 @@ func (dS *DispatcherService) AdminSv1GetAttributeProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAttributeProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetAttributeProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -277,11 +207,6 @@ func (dS *DispatcherService) AdminSv1GetAttributeProfileIDs(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAttributeProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAttributeProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetAttributeProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.APIAttributeProfile) (err error) { @@ -294,11 +219,6 @@ func (dS *DispatcherService) AdminSv1GetAttributeProfiles(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAttributeProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAttributeProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetAttributeProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -311,11 +231,6 @@ func (dS *DispatcherService) AdminSv1GetAttributeProfilesCount(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAttributeProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAttributeProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetAttributesIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -328,11 +243,6 @@ func (dS *DispatcherService) AdminSv1GetAttributesIndexesHealth(ctx *context.Con if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetAttributesIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetAttributesIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetChargerProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ChargerProfile) (err error) { @@ -345,11 +255,6 @@ func (dS *DispatcherService) AdminSv1GetChargerProfile(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetChargerProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetChargerProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -362,11 +267,6 @@ func (dS *DispatcherService) AdminSv1GetChargerProfileIDs(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetChargerProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetChargerProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetChargerProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.ChargerProfile) (err error) { @@ -379,11 +279,6 @@ func (dS *DispatcherService) AdminSv1GetChargerProfiles(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetChargerProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetChargerProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetChargerProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -396,11 +291,6 @@ func (dS *DispatcherService) AdminSv1GetChargerProfilesCount(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetChargerProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetChargerProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetChargersIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -413,11 +303,6 @@ func (dS *DispatcherService) AdminSv1GetChargersIndexesHealth(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetChargersIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetChargersIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherHost(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.DispatcherHost) (err error) { @@ -430,11 +315,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherHost(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherHost, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherHostIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -447,11 +327,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherHostIDs(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherHostIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherHostIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherHosts(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.DispatcherHost) (err error) { @@ -464,11 +339,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherHosts(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherHosts, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherHosts, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherHostsCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -481,11 +351,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherHostsCount(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherHostsCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherHostsCount, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.DispatcherProfile) (err error) { @@ -498,11 +363,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -515,11 +375,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherProfileIDs(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.DispatcherProfile) (err error) { @@ -532,11 +387,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherProfiles(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatcherProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -549,11 +399,6 @@ func (dS *DispatcherService) AdminSv1GetDispatcherProfilesCount(ctx *context.Con if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatcherProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatcherProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetDispatchersIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -566,11 +411,6 @@ func (dS *DispatcherService) AdminSv1GetDispatchersIndexesHealth(ctx *context.Co if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetDispatchersIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetDispatchersIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetFilter(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.Filter) (err error) { @@ -583,11 +423,6 @@ func (dS *DispatcherService) AdminSv1GetFilter(ctx *context.Context, args *utils if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetFilter, args, reply) } func (dS *DispatcherService) AdminSv1GetFilterIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -600,11 +435,6 @@ func (dS *DispatcherService) AdminSv1GetFilterIDs(ctx *context.Context, args *ut if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetFilterIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetFilterIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetFilterIndexes(ctx *context.Context, args *apis.AttrGetFilterIndexes, reply *[]string) (err error) { @@ -617,11 +447,6 @@ func (dS *DispatcherService) AdminSv1GetFilterIndexes(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetFilterIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetFilterIndexes, args, reply) } func (dS *DispatcherService) AdminSv1GetFilters(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.Filter) (err error) { @@ -634,11 +459,6 @@ func (dS *DispatcherService) AdminSv1GetFilters(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetFilters, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetFilters, args, reply) } func (dS *DispatcherService) AdminSv1GetFiltersCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -651,11 +471,6 @@ func (dS *DispatcherService) AdminSv1GetFiltersCount(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetFiltersCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetFiltersCount, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) (err error) { @@ -668,11 +483,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfile(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -685,11 +495,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfileIDs(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfileRateIDs(ctx *context.Context, args *utils.ArgsSubItemIDs, reply *[]string) (err error) { @@ -702,11 +507,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfileRateIDs(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfileRateIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfileRateIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfileRates(ctx *context.Context, args *utils.ArgsSubItemIDs, reply *[]*utils.Rate) (err error) { @@ -719,11 +519,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfileRates(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfileRates, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfileRates, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfileRatesCount(ctx *context.Context, args *utils.ArgsSubItemIDs, reply *int) (err error) { @@ -736,11 +531,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfileRatesCount(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfileRatesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfileRatesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*utils.RateProfile) (err error) { @@ -753,11 +543,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfiles(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -770,11 +555,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfilesCount(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetRateProfilesIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -787,11 +567,6 @@ func (dS *DispatcherService) AdminSv1GetRateProfilesIndexesHealth(ctx *context.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateProfilesIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateProfilesIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetRateRatesIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -804,11 +579,6 @@ func (dS *DispatcherService) AdminSv1GetRateRatesIndexesHealth(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRateRatesIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRateRatesIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetResourceProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ResourceProfile) (err error) { @@ -821,11 +591,6 @@ func (dS *DispatcherService) AdminSv1GetResourceProfile(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetResourceProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetResourceProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -838,11 +603,6 @@ func (dS *DispatcherService) AdminSv1GetResourceProfileIDs(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetResourceProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetResourceProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetResourceProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.ResourceProfile) (err error) { @@ -855,11 +615,6 @@ func (dS *DispatcherService) AdminSv1GetResourceProfiles(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetResourceProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetResourceProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetResourceProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -872,11 +627,6 @@ func (dS *DispatcherService) AdminSv1GetResourceProfilesCount(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetResourceProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetResourceProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetResourcesIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -889,11 +639,6 @@ func (dS *DispatcherService) AdminSv1GetResourcesIndexesHealth(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetResourcesIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetResourcesIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetReverseFilterHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *map[string]*engine.ReverseFilterIHReply) (err error) { @@ -906,11 +651,6 @@ func (dS *DispatcherService) AdminSv1GetReverseFilterHealth(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetReverseFilterHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetReverseFilterHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetRouteProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.RouteProfile) (err error) { @@ -923,11 +663,6 @@ func (dS *DispatcherService) AdminSv1GetRouteProfile(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRouteProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetRouteProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -940,11 +675,6 @@ func (dS *DispatcherService) AdminSv1GetRouteProfileIDs(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRouteProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRouteProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetRouteProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.RouteProfile) (err error) { @@ -957,11 +687,6 @@ func (dS *DispatcherService) AdminSv1GetRouteProfiles(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRouteProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRouteProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetRouteProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -974,11 +699,6 @@ func (dS *DispatcherService) AdminSv1GetRouteProfilesCount(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRouteProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRouteProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetRoutesIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -991,11 +711,6 @@ func (dS *DispatcherService) AdminSv1GetRoutesIndexesHealth(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetRoutesIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetRoutesIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetStatQueueProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.StatQueueProfile) (err error) { @@ -1008,11 +723,6 @@ func (dS *DispatcherService) AdminSv1GetStatQueueProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetStatQueueProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetStatQueueProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -1025,11 +735,6 @@ func (dS *DispatcherService) AdminSv1GetStatQueueProfileIDs(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetStatQueueProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetStatQueueProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetStatQueueProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.StatQueueProfile) (err error) { @@ -1042,11 +747,6 @@ func (dS *DispatcherService) AdminSv1GetStatQueueProfiles(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetStatQueueProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetStatQueueProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetStatQueueProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -1059,11 +759,6 @@ func (dS *DispatcherService) AdminSv1GetStatQueueProfilesCount(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetStatQueueProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetStatQueueProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetStatsIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -1076,11 +771,6 @@ func (dS *DispatcherService) AdminSv1GetStatsIndexesHealth(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetStatsIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetStatsIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1GetThresholdProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ThresholdProfile) (err error) { @@ -1093,11 +783,6 @@ func (dS *DispatcherService) AdminSv1GetThresholdProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetThresholdProfile, args, reply) } func (dS *DispatcherService) AdminSv1GetThresholdProfileIDs(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]string) (err error) { @@ -1110,11 +795,6 @@ func (dS *DispatcherService) AdminSv1GetThresholdProfileIDs(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetThresholdProfileIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetThresholdProfileIDs, args, reply) } func (dS *DispatcherService) AdminSv1GetThresholdProfiles(ctx *context.Context, args *utils.ArgsItemIDs, reply *[]*engine.ThresholdProfile) (err error) { @@ -1127,11 +807,6 @@ func (dS *DispatcherService) AdminSv1GetThresholdProfiles(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetThresholdProfiles, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetThresholdProfiles, args, reply) } func (dS *DispatcherService) AdminSv1GetThresholdProfilesCount(ctx *context.Context, args *utils.ArgsItemIDs, reply *int) (err error) { @@ -1144,11 +819,6 @@ func (dS *DispatcherService) AdminSv1GetThresholdProfilesCount(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetThresholdProfilesCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetThresholdProfilesCount, args, reply) } func (dS *DispatcherService) AdminSv1GetThresholdsIndexesHealth(ctx *context.Context, args *engine.IndexHealthArgs, reply *engine.FilterIHReply) (err error) { @@ -1161,11 +831,6 @@ func (dS *DispatcherService) AdminSv1GetThresholdsIndexesHealth(ctx *context.Con if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1GetThresholdsIndexesHealth, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1GetThresholdsIndexesHealth, args, reply) } func (dS *DispatcherService) AdminSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -1181,11 +846,6 @@ func (dS *DispatcherService) AdminSv1Ping(ctx *context.Context, args *utils.CGRE if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1Ping, args, reply) } func (dS *DispatcherService) AdminSv1RemoveAccount(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1198,11 +858,6 @@ func (dS *DispatcherService) AdminSv1RemoveAccount(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveAccount, args, reply) } func (dS *DispatcherService) AdminSv1RemoveActionProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1215,11 +870,6 @@ func (dS *DispatcherService) AdminSv1RemoveActionProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveActionProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveAttributeProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1232,11 +882,6 @@ func (dS *DispatcherService) AdminSv1RemoveAttributeProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveAttributeProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveChargerProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1249,11 +894,6 @@ func (dS *DispatcherService) AdminSv1RemoveChargerProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveChargerProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveDispatcherHost(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1266,11 +906,6 @@ func (dS *DispatcherService) AdminSv1RemoveDispatcherHost(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveDispatcherHost, args, reply) } func (dS *DispatcherService) AdminSv1RemoveDispatcherProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1283,11 +918,6 @@ func (dS *DispatcherService) AdminSv1RemoveDispatcherProfile(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveDispatcherProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveFilter(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1300,11 +930,6 @@ func (dS *DispatcherService) AdminSv1RemoveFilter(ctx *context.Context, args *ut if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveFilter, args, reply) } func (dS *DispatcherService) AdminSv1RemoveFilterIndexes(ctx *context.Context, args *apis.AttrRemFilterIndexes, reply *string) (err error) { @@ -1317,11 +942,6 @@ func (dS *DispatcherService) AdminSv1RemoveFilterIndexes(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveFilterIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveFilterIndexes, args, reply) } func (dS *DispatcherService) AdminSv1RemoveRateProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1334,11 +954,6 @@ func (dS *DispatcherService) AdminSv1RemoveRateProfile(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveRateProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveRateProfileRates(ctx *context.Context, args *utils.RemoveRPrfRates, reply *string) (err error) { @@ -1351,11 +966,6 @@ func (dS *DispatcherService) AdminSv1RemoveRateProfileRates(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveRateProfileRates, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveRateProfileRates, args, reply) } func (dS *DispatcherService) AdminSv1RemoveResourceProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1368,11 +978,6 @@ func (dS *DispatcherService) AdminSv1RemoveResourceProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveResourceProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveRouteProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1385,11 +990,6 @@ func (dS *DispatcherService) AdminSv1RemoveRouteProfile(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveRouteProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveStatQueueProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1402,11 +1002,6 @@ func (dS *DispatcherService) AdminSv1RemoveStatQueueProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveStatQueueProfile, args, reply) } func (dS *DispatcherService) AdminSv1RemoveThresholdProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -1419,11 +1014,6 @@ func (dS *DispatcherService) AdminSv1RemoveThresholdProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1RemoveThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1RemoveThresholdProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetAccount(ctx *context.Context, args *utils.AccountWithAPIOpts, reply *string) (err error) { @@ -1436,11 +1026,6 @@ func (dS *DispatcherService) AdminSv1SetAccount(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetAccount, args, reply) } func (dS *DispatcherService) AdminSv1SetActionProfile(ctx *context.Context, args *engine.ActionProfileWithAPIOpts, reply *string) (err error) { @@ -1453,11 +1038,6 @@ func (dS *DispatcherService) AdminSv1SetActionProfile(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetActionProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetAttributeProfile(ctx *context.Context, args *engine.APIAttributeProfileWithAPIOpts, reply *string) (err error) { @@ -1470,11 +1050,6 @@ func (dS *DispatcherService) AdminSv1SetAttributeProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetAttributeProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetChargerProfile(ctx *context.Context, args *apis.ChargerWithAPIOpts, reply *string) (err error) { @@ -1487,11 +1062,6 @@ func (dS *DispatcherService) AdminSv1SetChargerProfile(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetChargerProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetDispatcherHost(ctx *context.Context, args *engine.DispatcherHostWithAPIOpts, reply *string) (err error) { @@ -1504,11 +1074,6 @@ func (dS *DispatcherService) AdminSv1SetDispatcherHost(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetDispatcherHost, args, reply) } func (dS *DispatcherService) AdminSv1SetDispatcherProfile(ctx *context.Context, args *apis.DispatcherWithAPIOpts, reply *string) (err error) { @@ -1521,11 +1086,6 @@ func (dS *DispatcherService) AdminSv1SetDispatcherProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetDispatcherProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetFilter(ctx *context.Context, args *engine.FilterWithAPIOpts, reply *string) (err error) { @@ -1538,11 +1098,6 @@ func (dS *DispatcherService) AdminSv1SetFilter(ctx *context.Context, args *engin if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetFilter, args, reply) } func (dS *DispatcherService) AdminSv1SetRateProfile(ctx *context.Context, args *utils.APIRateProfile, reply *string) (err error) { @@ -1555,11 +1110,6 @@ func (dS *DispatcherService) AdminSv1SetRateProfile(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetRateProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetResourceProfile(ctx *context.Context, args *engine.ResourceProfileWithAPIOpts, reply *string) (err error) { @@ -1572,11 +1122,6 @@ func (dS *DispatcherService) AdminSv1SetResourceProfile(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetResourceProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetRouteProfile(ctx *context.Context, args *engine.RouteProfileWithAPIOpts, reply *string) (err error) { @@ -1589,11 +1134,6 @@ func (dS *DispatcherService) AdminSv1SetRouteProfile(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetRouteProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetStatQueueProfile(ctx *context.Context, args *engine.StatQueueProfileWithAPIOpts, reply *string) (err error) { @@ -1606,11 +1146,6 @@ func (dS *DispatcherService) AdminSv1SetStatQueueProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetStatQueueProfile, args, reply) } func (dS *DispatcherService) AdminSv1SetThresholdProfile(ctx *context.Context, args *engine.ThresholdProfileWithAPIOpts, reply *string) (err error) { @@ -1623,10 +1158,5 @@ func (dS *DispatcherService) AdminSv1SetThresholdProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AdminSv1SetThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAdminS, utils.AdminSv1SetThresholdProfile, args, reply) } diff --git a/dispatchers/analyzers.go b/dispatchers/analyzers.go index 2ccdb958f..a01cdf36c 100644 --- a/dispatchers/analyzers.go +++ b/dispatchers/analyzers.go @@ -38,21 +38,11 @@ func (dS *DispatcherService) AnalyzerSv1Ping(ctx *context.Context, args *utils.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AnalyzerSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAnalyzer, utils.AnalyzerSv1Ping, args, reply) } func (dS *DispatcherService) AnalyzerSv1StringQuery(ctx *context.Context, args *analyzers.QueryArgs, reply *[]map[string]interface{}) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant ev := make(map[string]interface{}) opts := make(map[string]interface{}) - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AnalyzerSv1StringQuery, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAnalyzer, utils.AnalyzerSv1StringQuery, args, reply) } diff --git a/dispatchers/attributes.go b/dispatchers/attributes.go index d81f5917d..7d477bbec 100644 --- a/dispatchers/attributes.go +++ b/dispatchers/attributes.go @@ -38,11 +38,6 @@ func (dS *DispatcherService) AttributeSv1GetAttributeForEvent(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AttributeSv1GetAttributeForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAttributes, utils.AttributeSv1GetAttributeForEvent, args, reply) } func (dS *DispatcherService) AttributeSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -58,11 +53,6 @@ func (dS *DispatcherService) AttributeSv1Ping(ctx *context.Context, args *utils. if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AttributeSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAttributes, utils.AttributeSv1Ping, args, reply) } func (dS *DispatcherService) AttributeSv1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *engine.AttrSProcessEventReply) (err error) { @@ -78,10 +68,5 @@ func (dS *DispatcherService) AttributeSv1ProcessEvent(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.AttributeSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaAttributes, utils.AttributeSv1ProcessEvent, args, reply) } diff --git a/dispatchers/caches.go b/dispatchers/caches.go index 05268882a..f9f4b0aa5 100644 --- a/dispatchers/caches.go +++ b/dispatchers/caches.go @@ -36,14 +36,8 @@ func (dS *DispatcherService) CacheSv1Clear(ctx *context.Context, args *utils.Att if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1Clear, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1Clear, args, reply) } - func (dS *DispatcherService) CacheSv1GetCacheStats(ctx *context.Context, args *utils.AttrCacheIDsWithAPIOpts, reply *map[string]*ltcache.CacheStats) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant if args != nil && len(args.Tenant) != 0 { @@ -54,14 +48,8 @@ func (dS *DispatcherService) CacheSv1GetCacheStats(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetCacheStats, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetCacheStats, args, reply) } - func (dS *DispatcherService) CacheSv1GetGroupItemIDs(ctx *context.Context, args *utils.ArgsGetGroupWithAPIOpts, reply *[]string) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant if args != nil && len(args.Tenant) != 0 { @@ -72,11 +60,6 @@ func (dS *DispatcherService) CacheSv1GetGroupItemIDs(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetGroupItemIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetGroupItemIDs, args, reply) } func (dS *DispatcherService) CacheSv1GetItem(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *interface{}) (err error) { @@ -89,11 +72,6 @@ func (dS *DispatcherService) CacheSv1GetItem(ctx *context.Context, args *utils.A if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetItem, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetItem, args, reply) } func (dS *DispatcherService) CacheSv1GetItemExpiryTime(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *time.Time) (err error) { @@ -106,11 +84,6 @@ func (dS *DispatcherService) CacheSv1GetItemExpiryTime(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetItemExpiryTime, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetItemExpiryTime, args, reply) } func (dS *DispatcherService) CacheSv1GetItemIDs(ctx *context.Context, args *utils.ArgsGetCacheItemIDsWithAPIOpts, reply *[]string) (err error) { @@ -123,11 +96,6 @@ func (dS *DispatcherService) CacheSv1GetItemIDs(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetItemIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetItemIDs, args, reply) } func (dS *DispatcherService) CacheSv1GetItemWithRemote(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *interface{}) (err error) { @@ -140,11 +108,6 @@ func (dS *DispatcherService) CacheSv1GetItemWithRemote(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1GetItemWithRemote, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1GetItemWithRemote, args, reply) } func (dS *DispatcherService) CacheSv1HasGroup(ctx *context.Context, args *utils.ArgsGetGroupWithAPIOpts, reply *bool) (err error) { @@ -157,11 +120,6 @@ func (dS *DispatcherService) CacheSv1HasGroup(ctx *context.Context, args *utils. if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1HasGroup, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1HasGroup, args, reply) } func (dS *DispatcherService) CacheSv1HasItem(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *bool) (err error) { @@ -174,11 +132,6 @@ func (dS *DispatcherService) CacheSv1HasItem(ctx *context.Context, args *utils.A if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1HasItem, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1HasItem, args, reply) } func (dS *DispatcherService) CacheSv1LoadCache(ctx *context.Context, args *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error) { @@ -191,11 +144,6 @@ func (dS *DispatcherService) CacheSv1LoadCache(ctx *context.Context, args *utils if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1LoadCache, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1LoadCache, args, reply) } func (dS *DispatcherService) CacheSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -211,11 +159,6 @@ func (dS *DispatcherService) CacheSv1Ping(ctx *context.Context, args *utils.CGRE if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1Ping, args, reply) } func (dS *DispatcherService) CacheSv1PrecacheStatus(ctx *context.Context, args *utils.AttrCacheIDsWithAPIOpts, reply *map[string]string) (err error) { @@ -228,11 +171,6 @@ func (dS *DispatcherService) CacheSv1PrecacheStatus(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1PrecacheStatus, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1PrecacheStatus, args, reply) } func (dS *DispatcherService) CacheSv1ReloadCache(ctx *context.Context, args *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error) { @@ -245,11 +183,6 @@ func (dS *DispatcherService) CacheSv1ReloadCache(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1ReloadCache, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1ReloadCache, args, reply) } func (dS *DispatcherService) CacheSv1RemoveGroup(ctx *context.Context, args *utils.ArgsGetGroupWithAPIOpts, reply *string) (err error) { @@ -262,11 +195,6 @@ func (dS *DispatcherService) CacheSv1RemoveGroup(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1RemoveGroup, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1RemoveGroup, args, reply) } func (dS *DispatcherService) CacheSv1RemoveItem(ctx *context.Context, args *utils.ArgsGetCacheItemWithAPIOpts, reply *string) (err error) { @@ -279,11 +207,6 @@ func (dS *DispatcherService) CacheSv1RemoveItem(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1RemoveItem, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1RemoveItem, args, reply) } func (dS *DispatcherService) CacheSv1RemoveItems(ctx *context.Context, args *utils.AttrReloadCacheWithAPIOpts, reply *string) (err error) { @@ -296,11 +219,6 @@ func (dS *DispatcherService) CacheSv1RemoveItems(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1RemoveItems, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1RemoveItems, args, reply) } func (dS *DispatcherService) CacheSv1ReplicateRemove(ctx *context.Context, args *utils.ArgCacheReplicateRemove, reply *string) (err error) { @@ -313,11 +231,6 @@ func (dS *DispatcherService) CacheSv1ReplicateRemove(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1ReplicateRemove, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1ReplicateRemove, args, reply) } func (dS *DispatcherService) CacheSv1ReplicateSet(ctx *context.Context, args *utils.ArgCacheReplicateSet, reply *string) (err error) { @@ -330,10 +243,5 @@ func (dS *DispatcherService) CacheSv1ReplicateSet(ctx *context.Context, args *ut if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CacheSv1ReplicateSet, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCaches, utils.CacheSv1ReplicateSet, args, reply) } diff --git a/dispatchers/cdrs.go b/dispatchers/cdrs.go index c2ec46c7f..f429bbf8c 100644 --- a/dispatchers/cdrs.go +++ b/dispatchers/cdrs.go @@ -37,11 +37,6 @@ func (dS *DispatcherService) CDRsV1Ping(ctx *context.Context, args *utils.CGREve if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CDRsV1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCDRs, utils.CDRsV1Ping, args, reply) } func (dS *DispatcherService) CDRsV1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -57,11 +52,6 @@ func (dS *DispatcherService) CDRsV1ProcessEvent(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CDRsV1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCDRs, utils.CDRsV1ProcessEvent, args, reply) } func (dS *DispatcherService) CDRsV1ProcessEventWithGet(ctx *context.Context, args *utils.CGREvent, reply *[]*utils.EventsWithOpts) (err error) { @@ -77,10 +67,5 @@ func (dS *DispatcherService) CDRsV1ProcessEventWithGet(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CDRsV1ProcessEventWithGet, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCDRs, utils.CDRsV1ProcessEventWithGet, args, reply) } diff --git a/dispatchers/chargers.go b/dispatchers/chargers.go index 45007e4d7..f3c8394d4 100644 --- a/dispatchers/chargers.go +++ b/dispatchers/chargers.go @@ -38,11 +38,6 @@ func (dS *DispatcherService) ChargerSv1GetChargersForEvent(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ChargerSv1GetChargersForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaChargers, utils.ChargerSv1GetChargersForEvent, args, reply) } func (dS *DispatcherService) ChargerSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -58,11 +53,6 @@ func (dS *DispatcherService) ChargerSv1Ping(ctx *context.Context, args *utils.CG if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ChargerSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaChargers, utils.ChargerSv1Ping, args, reply) } func (dS *DispatcherService) ChargerSv1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]*engine.ChrgSProcessEventReply) (err error) { @@ -78,10 +68,5 @@ func (dS *DispatcherService) ChargerSv1ProcessEvent(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ChargerSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaChargers, utils.ChargerSv1ProcessEvent, args, reply) } diff --git a/dispatchers/config.go b/dispatchers/config.go index 8853ecec0..51346d62d 100644 --- a/dispatchers/config.go +++ b/dispatchers/config.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) ConfigSv1GetConfig(ctx *context.Context, args *conf if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1GetConfig, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1GetConfig, args, reply) } func (dS *DispatcherService) ConfigSv1GetConfigAsJSON(ctx *context.Context, args *config.SectionWithAPIOpts, reply *string) (err error) { @@ -52,11 +47,6 @@ func (dS *DispatcherService) ConfigSv1GetConfigAsJSON(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1GetConfigAsJSON, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1GetConfigAsJSON, args, reply) } func (dS *DispatcherService) ConfigSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -72,11 +62,6 @@ func (dS *DispatcherService) ConfigSv1Ping(ctx *context.Context, args *utils.CGR if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1Ping, args, reply) } func (dS *DispatcherService) ConfigSv1ReloadConfig(ctx *context.Context, args *config.ReloadArgs, reply *string) (err error) { @@ -89,11 +74,6 @@ func (dS *DispatcherService) ConfigSv1ReloadConfig(ctx *context.Context, args *c if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1ReloadConfig, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1ReloadConfig, args, reply) } func (dS *DispatcherService) ConfigSv1SetConfig(ctx *context.Context, args *config.SetConfigArgs, reply *string) (err error) { @@ -106,11 +86,6 @@ func (dS *DispatcherService) ConfigSv1SetConfig(ctx *context.Context, args *conf if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1SetConfig, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1SetConfig, args, reply) } func (dS *DispatcherService) ConfigSv1SetConfigFromJSON(ctx *context.Context, args *config.SetConfigFromJSONArgs, reply *string) (err error) { @@ -123,11 +98,6 @@ func (dS *DispatcherService) ConfigSv1SetConfigFromJSON(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1SetConfigFromJSON, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1SetConfigFromJSON, args, reply) } func (dS *DispatcherService) ConfigSv1StoreCfgInDB(ctx *context.Context, args *config.SectionWithAPIOpts, reply *string) (err error) { @@ -140,10 +110,5 @@ func (dS *DispatcherService) ConfigSv1StoreCfgInDB(ctx *context.Context, args *c if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ConfigSv1StoreCfgInDB, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaConfig, utils.ConfigSv1StoreCfgInDB, args, reply) } diff --git a/dispatchers/cores.go b/dispatchers/cores.go index 381939cf2..cf77d01ad 100644 --- a/dispatchers/cores.go +++ b/dispatchers/cores.go @@ -34,11 +34,6 @@ func (dS *DispatcherService) CoreSv1Panic(ctx *context.Context, args *utils.Pani if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1Panic, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1Panic, args, reply) } func (dS *DispatcherService) CoreSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -54,11 +49,6 @@ func (dS *DispatcherService) CoreSv1Ping(ctx *context.Context, args *utils.CGREv if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1Ping, args, reply) } func (dS *DispatcherService) CoreSv1Shutdown(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -74,11 +64,6 @@ func (dS *DispatcherService) CoreSv1Shutdown(ctx *context.Context, args *utils.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1Shutdown, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1Shutdown, args, reply) } func (dS *DispatcherService) CoreSv1Sleep(ctx *context.Context, args *utils.DurationArgs, reply *string) (err error) { @@ -91,11 +76,6 @@ func (dS *DispatcherService) CoreSv1Sleep(ctx *context.Context, args *utils.Dura if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1Sleep, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1Sleep, args, reply) } func (dS *DispatcherService) CoreSv1StartCPUProfiling(ctx *context.Context, args *utils.DirectoryArgs, reply *string) (err error) { @@ -108,11 +88,6 @@ func (dS *DispatcherService) CoreSv1StartCPUProfiling(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1StartCPUProfiling, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1StartCPUProfiling, args, reply) } func (dS *DispatcherService) CoreSv1StartMemoryProfiling(ctx *context.Context, args *utils.MemoryPrf, reply *string) (err error) { @@ -125,11 +100,6 @@ func (dS *DispatcherService) CoreSv1StartMemoryProfiling(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1StartMemoryProfiling, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1StartMemoryProfiling, args, reply) } func (dS *DispatcherService) CoreSv1Status(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *map[string]interface{}) (err error) { @@ -142,11 +112,6 @@ func (dS *DispatcherService) CoreSv1Status(ctx *context.Context, args *utils.Ten if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1Status, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1Status, args, reply) } func (dS *DispatcherService) CoreSv1StopCPUProfiling(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *string) (err error) { @@ -159,11 +124,6 @@ func (dS *DispatcherService) CoreSv1StopCPUProfiling(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1StopCPUProfiling, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1StopCPUProfiling, args, reply) } func (dS *DispatcherService) CoreSv1StopMemoryProfiling(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *string) (err error) { @@ -176,10 +136,5 @@ func (dS *DispatcherService) CoreSv1StopMemoryProfiling(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.CoreSv1StopMemoryProfiling, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaCore, utils.CoreSv1StopMemoryProfiling, args, reply) } diff --git a/dispatchers/dispatchers.go b/dispatchers/dispatchers.go index b3a547de4..005c2a6c2 100644 --- a/dispatchers/dispatchers.go +++ b/dispatchers/dispatchers.go @@ -170,6 +170,11 @@ func (dS *DispatcherService) Dispatch(ctx *context.Context, ev *utils.CGREvent, if ev.APIOpts == nil { ev.APIOpts = make(map[string]interface{}) } + if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { + if err = dS.authorize(ctx, serviceMethod, tnt, utils.IfaceAsString(ev.APIOpts[utils.OptsAPIKey])); err != nil { + return + } + } evNm := utils.MapStorage{ utils.MetaReq: ev.Event, utils.MetaOpts: ev.APIOpts, diff --git a/dispatchers/ees.go b/dispatchers/ees.go index 1c2fd9d4c..c1b131637 100644 --- a/dispatchers/ees.go +++ b/dispatchers/ees.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) EeSv1ArchiveEventsInReply(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.EeSv1ArchiveEventsInReply, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaEEs, utils.EeSv1ArchiveEventsInReply, args, reply) } func (dS *DispatcherService) EeSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -55,11 +50,6 @@ func (dS *DispatcherService) EeSv1Ping(ctx *context.Context, args *utils.CGREven if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.EeSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaEEs, utils.EeSv1Ping, args, reply) } func (dS *DispatcherService) EeSv1ProcessEvent(ctx *context.Context, args *utils.CGREventWithEeIDs, reply *map[string]map[string]interface{}) (err error) { @@ -75,10 +65,5 @@ func (dS *DispatcherService) EeSv1ProcessEvent(ctx *context.Context, args *utils if args != nil && args.CGREvent != nil { opts = args.CGREvent.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.EeSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaEEs, utils.EeSv1ProcessEvent, args, reply) } diff --git a/dispatchers/guardian.go b/dispatchers/guardian.go index 1901a54ab..8deb26bf0 100644 --- a/dispatchers/guardian.go +++ b/dispatchers/guardian.go @@ -38,11 +38,6 @@ func (dS *DispatcherService) GuardianSv1Ping(ctx *context.Context, args *utils.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.GuardianSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaGuardian, utils.GuardianSv1Ping, args, reply) } func (dS *DispatcherService) GuardianSv1RemoteLock(ctx *context.Context, args *guardian.AttrRemoteLockWithAPIOpts, reply *string) (err error) { @@ -55,11 +50,6 @@ func (dS *DispatcherService) GuardianSv1RemoteLock(ctx *context.Context, args *g if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.GuardianSv1RemoteLock, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaGuardian, utils.GuardianSv1RemoteLock, args, reply) } func (dS *DispatcherService) GuardianSv1RemoteUnlock(ctx *context.Context, args *guardian.AttrRemoteUnlockWithAPIOpts, reply *[]string) (err error) { @@ -72,10 +62,5 @@ func (dS *DispatcherService) GuardianSv1RemoteUnlock(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.GuardianSv1RemoteUnlock, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaGuardian, utils.GuardianSv1RemoteUnlock, args, reply) } diff --git a/dispatchers/loaders.go b/dispatchers/loaders.go index b0fa74429..08e04e2b1 100644 --- a/dispatchers/loaders.go +++ b/dispatchers/loaders.go @@ -32,11 +32,6 @@ func (dS *DispatcherService) LoaderSv1ImportZip(ctx *context.Context, args *load if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.LoaderSv1ImportZip, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaLoaders, utils.LoaderSv1ImportZip, args, reply) } func (dS *DispatcherService) LoaderSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -52,11 +47,6 @@ func (dS *DispatcherService) LoaderSv1Ping(ctx *context.Context, args *utils.CGR if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.LoaderSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaLoaders, utils.LoaderSv1Ping, args, reply) } func (dS *DispatcherService) LoaderSv1Run(ctx *context.Context, args *loaders.ArgsProcessFolder, reply *string) (err error) { @@ -66,10 +56,5 @@ func (dS *DispatcherService) LoaderSv1Run(ctx *context.Context, args *loaders.Ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.LoaderSv1Run, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaLoaders, utils.LoaderSv1Run, args, reply) } diff --git a/dispatchers/rates.go b/dispatchers/rates.go index e8e238907..e44f5197e 100644 --- a/dispatchers/rates.go +++ b/dispatchers/rates.go @@ -37,11 +37,6 @@ func (dS *DispatcherService) RateSv1CostForEvent(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RateSv1CostForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.RateS, utils.RateSv1CostForEvent, args, reply) } func (dS *DispatcherService) RateSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -57,11 +52,6 @@ func (dS *DispatcherService) RateSv1Ping(ctx *context.Context, args *utils.CGREv if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RateSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.RateS, utils.RateSv1Ping, args, reply) } func (dS *DispatcherService) RateSv1RateProfileRatesForEvent(ctx *context.Context, args *utils.CGREventWithRateProfile, reply *[]string) (err error) { @@ -77,11 +67,6 @@ func (dS *DispatcherService) RateSv1RateProfileRatesForEvent(ctx *context.Contex if args != nil && args.CGREvent != nil { opts = args.CGREvent.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RateSv1RateProfileRatesForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.RateS, utils.RateSv1RateProfileRatesForEvent, args, reply) } func (dS *DispatcherService) RateSv1RateProfilesForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) { @@ -97,10 +82,5 @@ func (dS *DispatcherService) RateSv1RateProfilesForEvent(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RateSv1RateProfilesForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.RateS, utils.RateSv1RateProfilesForEvent, args, reply) } diff --git a/dispatchers/replicator.go b/dispatchers/replicator.go index 9707db1a5..24619d2a6 100644 --- a/dispatchers/replicator.go +++ b/dispatchers/replicator.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) ReplicatorSv1GetAccount(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetAccount, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetActionProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ActionProfile) (err error) { @@ -52,11 +47,6 @@ func (dS *DispatcherService) ReplicatorSv1GetActionProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetActionProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetAttributeProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.AttributeProfile) (err error) { @@ -69,11 +59,6 @@ func (dS *DispatcherService) ReplicatorSv1GetAttributeProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetAttributeProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetChargerProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ChargerProfile) (err error) { @@ -86,11 +71,6 @@ func (dS *DispatcherService) ReplicatorSv1GetChargerProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetChargerProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetDispatcherHost(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.DispatcherHost) (err error) { @@ -103,11 +83,6 @@ func (dS *DispatcherService) ReplicatorSv1GetDispatcherHost(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetDispatcherHost, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetDispatcherProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.DispatcherProfile) (err error) { @@ -120,11 +95,6 @@ func (dS *DispatcherService) ReplicatorSv1GetDispatcherProfile(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetDispatcherProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetFilter(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.Filter) (err error) { @@ -137,11 +107,6 @@ func (dS *DispatcherService) ReplicatorSv1GetFilter(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetFilter, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetIndexes(ctx *context.Context, args *utils.GetIndexesArg, reply *map[string]utils.StringSet) (err error) { @@ -154,11 +119,6 @@ func (dS *DispatcherService) ReplicatorSv1GetIndexes(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetIndexes, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetItemLoadIDs(ctx *context.Context, args *utils.StringWithAPIOpts, reply *map[string]int64) (err error) { @@ -171,11 +131,6 @@ func (dS *DispatcherService) ReplicatorSv1GetItemLoadIDs(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetItemLoadIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetItemLoadIDs, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetRateProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *utils.RateProfile) (err error) { @@ -188,11 +143,6 @@ func (dS *DispatcherService) ReplicatorSv1GetRateProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetRateProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetResource(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.Resource) (err error) { @@ -205,11 +155,6 @@ func (dS *DispatcherService) ReplicatorSv1GetResource(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetResource, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetResource, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetResourceProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ResourceProfile) (err error) { @@ -222,11 +167,6 @@ func (dS *DispatcherService) ReplicatorSv1GetResourceProfile(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetResourceProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetRouteProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.RouteProfile) (err error) { @@ -239,11 +179,6 @@ func (dS *DispatcherService) ReplicatorSv1GetRouteProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetRouteProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.StatQueue) (err error) { @@ -256,11 +191,6 @@ func (dS *DispatcherService) ReplicatorSv1GetStatQueue(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetStatQueue, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetStatQueue, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetStatQueueProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.StatQueueProfile) (err error) { @@ -273,11 +203,6 @@ func (dS *DispatcherService) ReplicatorSv1GetStatQueueProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetStatQueueProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetThreshold(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.Threshold) (err error) { @@ -290,11 +215,6 @@ func (dS *DispatcherService) ReplicatorSv1GetThreshold(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetThreshold, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetThreshold, args, reply) } func (dS *DispatcherService) ReplicatorSv1GetThresholdProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ThresholdProfile) (err error) { @@ -307,11 +227,6 @@ func (dS *DispatcherService) ReplicatorSv1GetThresholdProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1GetThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1GetThresholdProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -327,11 +242,6 @@ func (dS *DispatcherService) ReplicatorSv1Ping(ctx *context.Context, args *utils if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1Ping, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveAccount(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -344,11 +254,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveAccount(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveAccount, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveActionProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -361,11 +266,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveActionProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveActionProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveAttributeProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -378,11 +278,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveAttributeProfile(ctx *context.Co if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveAttributeProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveChargerProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -395,11 +290,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveChargerProfile(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveChargerProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveDispatcherHost(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -412,11 +302,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveDispatcherHost(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveDispatcherHost, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveDispatcherProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -429,11 +314,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveDispatcherProfile(ctx *context.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveDispatcherProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveFilter(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -446,11 +326,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveFilter(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveFilter, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveIndexes(ctx *context.Context, args *utils.GetIndexesArg, reply *string) (err error) { @@ -463,11 +338,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveIndexes(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveIndexes, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveRateProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -480,11 +350,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveRateProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveRateProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveResource(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -497,11 +362,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveResource(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveResource, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveResource, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveResourceProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -514,11 +374,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveResourceProfile(ctx *context.Con if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveResourceProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveRouteProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -531,11 +386,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveRouteProfile(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveRouteProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -548,11 +398,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveStatQueue(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveStatQueue, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveStatQueue, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveStatQueueProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -565,11 +410,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveStatQueueProfile(ctx *context.Co if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveStatQueueProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveThreshold(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -582,11 +422,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveThreshold(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveThreshold, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveThreshold, args, reply) } func (dS *DispatcherService) ReplicatorSv1RemoveThresholdProfile(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -599,11 +434,6 @@ func (dS *DispatcherService) ReplicatorSv1RemoveThresholdProfile(ctx *context.Co if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1RemoveThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1RemoveThresholdProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetAccount(ctx *context.Context, args *utils.AccountWithAPIOpts, reply *string) (err error) { @@ -616,11 +446,6 @@ func (dS *DispatcherService) ReplicatorSv1SetAccount(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetAccount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetAccount, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetActionProfile(ctx *context.Context, args *engine.ActionProfileWithAPIOpts, reply *string) (err error) { @@ -633,11 +458,6 @@ func (dS *DispatcherService) ReplicatorSv1SetActionProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetActionProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetActionProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetAttributeProfile(ctx *context.Context, args *engine.AttributeProfileWithAPIOpts, reply *string) (err error) { @@ -650,11 +470,6 @@ func (dS *DispatcherService) ReplicatorSv1SetAttributeProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetAttributeProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetAttributeProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetChargerProfile(ctx *context.Context, args *engine.ChargerProfileWithAPIOpts, reply *string) (err error) { @@ -667,11 +482,6 @@ func (dS *DispatcherService) ReplicatorSv1SetChargerProfile(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetChargerProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetChargerProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetDispatcherHost(ctx *context.Context, args *engine.DispatcherHostWithAPIOpts, reply *string) (err error) { @@ -684,11 +494,6 @@ func (dS *DispatcherService) ReplicatorSv1SetDispatcherHost(ctx *context.Context if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetDispatcherHost, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetDispatcherHost, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetDispatcherProfile(ctx *context.Context, args *engine.DispatcherProfileWithAPIOpts, reply *string) (err error) { @@ -701,11 +506,6 @@ func (dS *DispatcherService) ReplicatorSv1SetDispatcherProfile(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetDispatcherProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetDispatcherProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetFilter(ctx *context.Context, args *engine.FilterWithAPIOpts, reply *string) (err error) { @@ -718,11 +518,6 @@ func (dS *DispatcherService) ReplicatorSv1SetFilter(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetFilter, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetFilter, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetIndexes(ctx *context.Context, args *utils.SetIndexesArg, reply *string) (err error) { @@ -735,11 +530,6 @@ func (dS *DispatcherService) ReplicatorSv1SetIndexes(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetIndexes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetIndexes, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetLoadIDs(ctx *context.Context, args *utils.LoadIDsWithAPIOpts, reply *string) (err error) { @@ -752,11 +542,6 @@ func (dS *DispatcherService) ReplicatorSv1SetLoadIDs(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetLoadIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetLoadIDs, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetRateProfile(ctx *context.Context, args *utils.RateProfileWithAPIOpts, reply *string) (err error) { @@ -769,11 +554,6 @@ func (dS *DispatcherService) ReplicatorSv1SetRateProfile(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetRateProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetRateProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetResource(ctx *context.Context, args *engine.ResourceWithAPIOpts, reply *string) (err error) { @@ -786,11 +566,6 @@ func (dS *DispatcherService) ReplicatorSv1SetResource(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetResource, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetResource, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetResourceProfile(ctx *context.Context, args *engine.ResourceProfileWithAPIOpts, reply *string) (err error) { @@ -803,11 +578,6 @@ func (dS *DispatcherService) ReplicatorSv1SetResourceProfile(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetResourceProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetResourceProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetRouteProfile(ctx *context.Context, args *engine.RouteProfileWithAPIOpts, reply *string) (err error) { @@ -820,11 +590,6 @@ func (dS *DispatcherService) ReplicatorSv1SetRouteProfile(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetRouteProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetRouteProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetStatQueue(ctx *context.Context, args *engine.StatQueueWithAPIOpts, reply *string) (err error) { @@ -834,11 +599,6 @@ func (dS *DispatcherService) ReplicatorSv1SetStatQueue(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetStatQueue, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetStatQueue, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetStatQueueProfile(ctx *context.Context, args *engine.StatQueueProfileWithAPIOpts, reply *string) (err error) { @@ -851,11 +611,6 @@ func (dS *DispatcherService) ReplicatorSv1SetStatQueueProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetStatQueueProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetStatQueueProfile, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetThreshold(ctx *context.Context, args *engine.ThresholdWithAPIOpts, reply *string) (err error) { @@ -868,11 +623,6 @@ func (dS *DispatcherService) ReplicatorSv1SetThreshold(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetThreshold, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetThreshold, args, reply) } func (dS *DispatcherService) ReplicatorSv1SetThresholdProfile(ctx *context.Context, args *engine.ThresholdProfileWithAPIOpts, reply *string) (err error) { @@ -885,10 +635,5 @@ func (dS *DispatcherService) ReplicatorSv1SetThresholdProfile(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ReplicatorSv1SetThresholdProfile, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaReplicator, utils.ReplicatorSv1SetThresholdProfile, args, reply) } diff --git a/dispatchers/resources.go b/dispatchers/resources.go index 8576f5787..56dfaaff2 100644 --- a/dispatchers/resources.go +++ b/dispatchers/resources.go @@ -38,11 +38,6 @@ func (dS *DispatcherService) ResourceSv1AllocateResources(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1AllocateResources, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1AllocateResources, args, reply) } func (dS *DispatcherService) ResourceSv1AuthorizeResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -58,11 +53,6 @@ func (dS *DispatcherService) ResourceSv1AuthorizeResources(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1AuthorizeResources, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1AuthorizeResources, args, reply) } func (dS *DispatcherService) ResourceSv1GetResource(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.Resource) (err error) { @@ -75,11 +65,6 @@ func (dS *DispatcherService) ResourceSv1GetResource(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1GetResource, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1GetResource, args, reply) } func (dS *DispatcherService) ResourceSv1GetResourceWithConfig(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.ResourceWithConfig) (err error) { @@ -92,11 +77,6 @@ func (dS *DispatcherService) ResourceSv1GetResourceWithConfig(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1GetResourceWithConfig, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1GetResourceWithConfig, args, reply) } func (dS *DispatcherService) ResourceSv1GetResourcesForEvent(ctx *context.Context, args *utils.CGREvent, reply *engine.Resources) (err error) { @@ -112,11 +92,6 @@ func (dS *DispatcherService) ResourceSv1GetResourcesForEvent(ctx *context.Contex if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1GetResourcesForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1GetResourcesForEvent, args, reply) } func (dS *DispatcherService) ResourceSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -132,11 +107,6 @@ func (dS *DispatcherService) ResourceSv1Ping(ctx *context.Context, args *utils.C if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1Ping, args, reply) } func (dS *DispatcherService) ResourceSv1ReleaseResources(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -152,10 +122,5 @@ func (dS *DispatcherService) ResourceSv1ReleaseResources(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ResourceSv1ReleaseResources, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaResources, utils.ResourceSv1ReleaseResources, args, reply) } diff --git a/dispatchers/routes.go b/dispatchers/routes.go index 682bf2439..40c49fbc8 100644 --- a/dispatchers/routes.go +++ b/dispatchers/routes.go @@ -38,11 +38,6 @@ func (dS *DispatcherService) RouteSv1GetRouteProfilesForEvent(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RouteSv1GetRouteProfilesForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaRoutes, utils.RouteSv1GetRouteProfilesForEvent, args, reply) } func (dS *DispatcherService) RouteSv1GetRoutes(ctx *context.Context, args *utils.CGREvent, reply *engine.SortedRoutesList) (err error) { @@ -58,11 +53,6 @@ func (dS *DispatcherService) RouteSv1GetRoutes(ctx *context.Context, args *utils if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RouteSv1GetRoutes, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaRoutes, utils.RouteSv1GetRoutes, args, reply) } func (dS *DispatcherService) RouteSv1GetRoutesList(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) { @@ -78,11 +68,6 @@ func (dS *DispatcherService) RouteSv1GetRoutesList(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RouteSv1GetRoutesList, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaRoutes, utils.RouteSv1GetRoutesList, args, reply) } func (dS *DispatcherService) RouteSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -98,10 +83,5 @@ func (dS *DispatcherService) RouteSv1Ping(ctx *context.Context, args *utils.CGRE if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.RouteSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaRoutes, utils.RouteSv1Ping, args, reply) } diff --git a/dispatchers/sessions.go b/dispatchers/sessions.go index 0c108abb6..90e9e3637 100644 --- a/dispatchers/sessions.go +++ b/dispatchers/sessions.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) SessionSv1ActivateSessions(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ActivateSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ActivateSessions, args, reply) } func (dS *DispatcherService) SessionSv1AuthorizeEvent(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1AuthorizeReply) (err error) { @@ -55,11 +50,6 @@ func (dS *DispatcherService) SessionSv1AuthorizeEvent(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1AuthorizeEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1AuthorizeEvent, args, reply) } func (dS *DispatcherService) SessionSv1AuthorizeEventWithDigest(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1AuthorizeReplyWithDigest) (err error) { @@ -75,11 +65,6 @@ func (dS *DispatcherService) SessionSv1AuthorizeEventWithDigest(ctx *context.Con if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1AuthorizeEventWithDigest, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1AuthorizeEventWithDigest, args, reply) } func (dS *DispatcherService) SessionSv1DeactivateSessions(ctx *context.Context, args *utils.SessionIDsWithAPIOpts, reply *string) (err error) { @@ -92,22 +77,12 @@ func (dS *DispatcherService) SessionSv1DeactivateSessions(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1DeactivateSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1DeactivateSessions, args, reply) } func (dS *DispatcherService) SessionSv1DisconnectPeer(ctx *context.Context, args *utils.DPRArgs, reply *string) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant ev := make(map[string]interface{}) opts := make(map[string]interface{}) - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1DisconnectPeer, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1DisconnectPeer, args, reply) } func (dS *DispatcherService) SessionSv1ForceDisconnect(ctx *context.Context, args *utils.SessionFilter, reply *string) (err error) { @@ -120,11 +95,6 @@ func (dS *DispatcherService) SessionSv1ForceDisconnect(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ForceDisconnect, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ForceDisconnect, args, reply) } func (dS *DispatcherService) SessionSv1GetActiveSessions(ctx *context.Context, args *utils.SessionFilter, reply *[]*sessions.ExternalSession) (err error) { @@ -137,11 +107,6 @@ func (dS *DispatcherService) SessionSv1GetActiveSessions(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1GetActiveSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1GetActiveSessions, args, reply) } func (dS *DispatcherService) SessionSv1GetActiveSessionsCount(ctx *context.Context, args *utils.SessionFilter, reply *int) (err error) { @@ -154,11 +119,6 @@ func (dS *DispatcherService) SessionSv1GetActiveSessionsCount(ctx *context.Conte if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1GetActiveSessionsCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1GetActiveSessionsCount, args, reply) } func (dS *DispatcherService) SessionSv1GetPassiveSessions(ctx *context.Context, args *utils.SessionFilter, reply *[]*sessions.ExternalSession) (err error) { @@ -171,11 +131,6 @@ func (dS *DispatcherService) SessionSv1GetPassiveSessions(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1GetPassiveSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1GetPassiveSessions, args, reply) } func (dS *DispatcherService) SessionSv1GetPassiveSessionsCount(ctx *context.Context, args *utils.SessionFilter, reply *int) (err error) { @@ -188,11 +143,6 @@ func (dS *DispatcherService) SessionSv1GetPassiveSessionsCount(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1GetPassiveSessionsCount, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1GetPassiveSessionsCount, args, reply) } func (dS *DispatcherService) SessionSv1InitiateSession(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1InitSessionReply) (err error) { @@ -208,11 +158,6 @@ func (dS *DispatcherService) SessionSv1InitiateSession(ctx *context.Context, arg if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1InitiateSession, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1InitiateSession, args, reply) } func (dS *DispatcherService) SessionSv1InitiateSessionWithDigest(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1InitReplyWithDigest) (err error) { @@ -228,11 +173,6 @@ func (dS *DispatcherService) SessionSv1InitiateSessionWithDigest(ctx *context.Co if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1InitiateSessionWithDigest, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1InitiateSessionWithDigest, args, reply) } func (dS *DispatcherService) SessionSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -248,11 +188,6 @@ func (dS *DispatcherService) SessionSv1Ping(ctx *context.Context, args *utils.CG if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1Ping, args, reply) } func (dS *DispatcherService) SessionSv1ProcessCDR(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -268,11 +203,6 @@ func (dS *DispatcherService) SessionSv1ProcessCDR(ctx *context.Context, args *ut if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ProcessCDR, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ProcessCDR, args, reply) } func (dS *DispatcherService) SessionSv1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1ProcessEventReply) (err error) { @@ -288,11 +218,6 @@ func (dS *DispatcherService) SessionSv1ProcessEvent(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ProcessEvent, args, reply) } func (dS *DispatcherService) SessionSv1ProcessMessage(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1ProcessMessageReply) (err error) { @@ -308,11 +233,6 @@ func (dS *DispatcherService) SessionSv1ProcessMessage(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ProcessMessage, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ProcessMessage, args, reply) } func (dS *DispatcherService) SessionSv1ReAuthorize(ctx *context.Context, args *utils.SessionFilter, reply *string) (err error) { @@ -325,22 +245,12 @@ func (dS *DispatcherService) SessionSv1ReAuthorize(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ReAuthorize, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ReAuthorize, args, reply) } func (dS *DispatcherService) SessionSv1RegisterInternalBiJSONConn(ctx *context.Context, args string, reply *string) (err error) { tnt := dS.cfg.GeneralCfg().DefaultTenant ev := make(map[string]interface{}) opts := make(map[string]interface{}) - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1RegisterInternalBiJSONConn, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1RegisterInternalBiJSONConn, args, reply) } func (dS *DispatcherService) SessionSv1ReplicateSessions(ctx *context.Context, args sessions.ArgsReplicateSessions, reply *string) (err error) { @@ -350,11 +260,6 @@ func (dS *DispatcherService) SessionSv1ReplicateSessions(ctx *context.Context, a } ev := make(map[string]interface{}) opts := args.APIOpts - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1ReplicateSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1ReplicateSessions, args, reply) } func (dS *DispatcherService) SessionSv1STIRAuthenticate(ctx *context.Context, args *sessions.V1STIRAuthenticateArgs, reply *string) (err error) { @@ -364,11 +269,6 @@ func (dS *DispatcherService) SessionSv1STIRAuthenticate(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1STIRAuthenticate, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1STIRAuthenticate, args, reply) } func (dS *DispatcherService) SessionSv1STIRIdentity(ctx *context.Context, args *sessions.V1STIRIdentityArgs, reply *string) (err error) { @@ -378,11 +278,6 @@ func (dS *DispatcherService) SessionSv1STIRIdentity(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1STIRIdentity, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1STIRIdentity, args, reply) } func (dS *DispatcherService) SessionSv1SetPassiveSession(ctx *context.Context, args *sessions.Session, reply *string) (err error) { @@ -392,11 +287,6 @@ func (dS *DispatcherService) SessionSv1SetPassiveSession(ctx *context.Context, a } ev := make(map[string]interface{}) opts := make(map[string]interface{}) - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1SetPassiveSession, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1SetPassiveSession, args, reply) } func (dS *DispatcherService) SessionSv1SyncSessions(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *string) (err error) { @@ -409,11 +299,6 @@ func (dS *DispatcherService) SessionSv1SyncSessions(ctx *context.Context, args * if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1SyncSessions, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1SyncSessions, args, reply) } func (dS *DispatcherService) SessionSv1TerminateSession(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -429,11 +314,6 @@ func (dS *DispatcherService) SessionSv1TerminateSession(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1TerminateSession, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1TerminateSession, args, reply) } func (dS *DispatcherService) SessionSv1UpdateSession(ctx *context.Context, args *utils.CGREvent, reply *sessions.V1UpdateSessionReply) (err error) { @@ -449,10 +329,5 @@ func (dS *DispatcherService) SessionSv1UpdateSession(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.SessionSv1UpdateSession, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaSessionS, utils.SessionSv1UpdateSession, args, reply) } diff --git a/dispatchers/stats.go b/dispatchers/stats.go index e5749a683..961740665 100644 --- a/dispatchers/stats.go +++ b/dispatchers/stats.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) StatSv1GetQueueDecimalMetrics(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetQueueDecimalMetrics, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetQueueDecimalMetrics, args, reply) } func (dS *DispatcherService) StatSv1GetQueueFloatMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *map[string]float64) (err error) { @@ -52,11 +47,6 @@ func (dS *DispatcherService) StatSv1GetQueueFloatMetrics(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetQueueFloatMetrics, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetQueueFloatMetrics, args, reply) } func (dS *DispatcherService) StatSv1GetQueueIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *[]string) (err error) { @@ -69,11 +59,6 @@ func (dS *DispatcherService) StatSv1GetQueueIDs(ctx *context.Context, args *util if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetQueueIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetQueueIDs, args, reply) } func (dS *DispatcherService) StatSv1GetQueueStringMetrics(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *map[string]string) (err error) { @@ -86,11 +71,6 @@ func (dS *DispatcherService) StatSv1GetQueueStringMetrics(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetQueueStringMetrics, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetQueueStringMetrics, args, reply) } func (dS *DispatcherService) StatSv1GetStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *engine.StatQueue) (err error) { @@ -103,11 +83,6 @@ func (dS *DispatcherService) StatSv1GetStatQueue(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetStatQueue, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetStatQueue, args, reply) } func (dS *DispatcherService) StatSv1GetStatQueuesForEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) { @@ -123,11 +98,6 @@ func (dS *DispatcherService) StatSv1GetStatQueuesForEvent(ctx *context.Context, if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1GetStatQueuesForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1GetStatQueuesForEvent, args, reply) } func (dS *DispatcherService) StatSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -143,11 +113,6 @@ func (dS *DispatcherService) StatSv1Ping(ctx *context.Context, args *utils.CGREv if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1Ping, args, reply) } func (dS *DispatcherService) StatSv1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) { @@ -163,11 +128,6 @@ func (dS *DispatcherService) StatSv1ProcessEvent(ctx *context.Context, args *uti if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1ProcessEvent, args, reply) } func (dS *DispatcherService) StatSv1ResetStatQueue(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -180,10 +140,5 @@ func (dS *DispatcherService) StatSv1ResetStatQueue(ctx *context.Context, args *u if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.StatSv1ResetStatQueue, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaStats, utils.StatSv1ResetStatQueue, args, reply) } diff --git a/dispatchers/thresholds.go b/dispatchers/thresholds.go index b4afbaae7..773daffac 100644 --- a/dispatchers/thresholds.go +++ b/dispatchers/thresholds.go @@ -35,11 +35,6 @@ func (dS *DispatcherService) ThresholdSv1GetThreshold(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1GetThreshold, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1GetThreshold, args, reply) } func (dS *DispatcherService) ThresholdSv1GetThresholdIDs(ctx *context.Context, args *utils.TenantWithAPIOpts, reply *[]string) (err error) { @@ -52,11 +47,6 @@ func (dS *DispatcherService) ThresholdSv1GetThresholdIDs(ctx *context.Context, a if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1GetThresholdIDs, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1GetThresholdIDs, args, reply) } func (dS *DispatcherService) ThresholdSv1GetThresholdsForEvent(ctx *context.Context, args *utils.CGREvent, reply *engine.Thresholds) (err error) { @@ -72,11 +62,6 @@ func (dS *DispatcherService) ThresholdSv1GetThresholdsForEvent(ctx *context.Cont if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1GetThresholdsForEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1GetThresholdsForEvent, args, reply) } func (dS *DispatcherService) ThresholdSv1Ping(ctx *context.Context, args *utils.CGREvent, reply *string) (err error) { @@ -92,11 +77,6 @@ func (dS *DispatcherService) ThresholdSv1Ping(ctx *context.Context, args *utils. if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1Ping, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1Ping, args, reply) } func (dS *DispatcherService) ThresholdSv1ProcessEvent(ctx *context.Context, args *utils.CGREvent, reply *[]string) (err error) { @@ -112,11 +92,6 @@ func (dS *DispatcherService) ThresholdSv1ProcessEvent(ctx *context.Context, args if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1ProcessEvent, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1ProcessEvent, args, reply) } func (dS *DispatcherService) ThresholdSv1ResetThreshold(ctx *context.Context, args *utils.TenantIDWithAPIOpts, reply *string) (err error) { @@ -129,10 +104,5 @@ func (dS *DispatcherService) ThresholdSv1ResetThreshold(ctx *context.Context, ar if args != nil { opts = args.APIOpts } - if len(dS.cfg.DispatcherSCfg().AttributeSConns) != 0 { - if err = dS.authorize(ctx, utils.ThresholdSv1ResetThreshold, tnt, utils.IfaceAsString(opts[utils.OptsAPIKey])); err != nil { - return - } - } return dS.Dispatch(ctx, &utils.CGREvent{Tenant: tnt, Event: ev, APIOpts: opts}, utils.MetaThresholds, utils.ThresholdSv1ResetThreshold, args, reply) }