Skip to content

Commit

Permalink
Update subflags for *rals from SessionSv1.ProcessEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
TeoV authored and danbogos committed Mar 26, 2020
1 parent 9f80f5e commit b92e96d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions apier/v1/sessions_process_event_it_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func testSSv1ItProcessEventAuth(t *testing.T) {
authUsage := 5 * time.Minute
args := &sessions.V1ProcessEventArgs{
Flags: []string{utils.ConcatenatedKey(utils.MetaResources, utils.MetaAuthorize),
utils.ConcatenatedKey(utils.MetaRALs, utils.MetaAuth),
utils.ConcatenatedKey(utils.MetaRALs, utils.MetaAuthorize),
utils.MetaSuppliers, utils.MetaAttributes},
CGREvent: &utils.CGREvent{
Tenant: "cgrates.org",
Expand Down Expand Up @@ -229,7 +229,7 @@ func testSSv1ItProcessEventAuth(t *testing.T) {
func testSSv1ItProcessEventInitiateSession(t *testing.T) {
initUsage := 5 * time.Minute
args := &sessions.V1ProcessEventArgs{
Flags: []string{utils.ConcatenatedKey(utils.MetaRALs, utils.MetaInit),
Flags: []string{utils.ConcatenatedKey(utils.MetaRALs, utils.MetaInitiate),
utils.ConcatenatedKey(utils.MetaResources, utils.MetaAllocate), utils.MetaAttributes},
CGREvent: &utils.CGREvent{
Tenant: "cgrates.org",
Expand Down
4 changes: 2 additions & 2 deletions docs/sessions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,10 @@ Instead of arguments, the options for enabling various functionaity will come in
\*rals
Process the event with :ref:`RALs`. Auxiliary flags available:

**\*auth**
**\*authorize**
Authorize the event.

**\*init**
**\*initiate**
Initialize a session out of event.

**\*update**
Expand Down
1 change: 1 addition & 0 deletions packages/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ cgrates (0.10.1~dev) UNRELEASED; urgency=medium
DataDB/StorDB
* [Migrator] Auto discover tenant from key instead of taking it from config
* [Templates] Fixed missing "*" for strip and padding strategy
* [SessionS] Update subflags for *rals ( *authorize and *initiate )

-- Alexandru Tripon <alexandru.tripon@itsyscom.com> Wed, 19 Feb 2020 15:22:59 +0200

Expand Down
4 changes: 2 additions & 2 deletions sessions/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3037,15 +3037,15 @@ func (sS *SessionS) BiRPCv1ProcessEvent(clnt rpcclient.ClientConnector,
//for the moment only the the flag will be executed
switch {
//check for auth session
case ralsFlagsWithParams.HasKey(utils.MetaAuth):
case ralsFlagsWithParams.HasKey(utils.MetaAuthorize):
maxUsage, err := sS.authEvent(args.CGREvent.Tenant,
engine.MapEvent(args.CGREvent.Event))
if err != nil {
return utils.NewErrRALs(err)
}
rply.MaxUsage = maxUsage
// check for init session
case ralsFlagsWithParams.HasKey(utils.MetaInit):
case ralsFlagsWithParams.HasKey(utils.MetaInitiate):
if ev.HasField(utils.CGRDebitInterval) { // dynamic DebitInterval via CGRDebitInterval
if dbtItvl, err = ev.GetDuration(utils.CGRDebitInterval); err != nil {
return utils.NewErrRALs(err)
Expand Down

0 comments on commit b92e96d

Please sign in to comment.