mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Move authorization block to the main Dispatch function
This commit is contained in:
committed by
Dan Christian Bogos
parent
5b5a9f9b2f
commit
f9fbaeaeed
@@ -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"),
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user