Commit Graph

12992 Commits

Author SHA1 Message Date
ionutboangiu
d8ad760dbb Update both ReAuthorize API signatures
The one from sessions takes an additional event alongside the
SessionFilter, while the one from agents will accept a CGREvent
instead of a simple originID string

The additional event sent to SessionSv1ReAuthorize will be merged
with the EventStart event from the matched session and can be used
when building server initiated requests from the *req map. The
initial packet which was initially inside *req, will be moved to
the *oreq ExtraDP (stands for original request).
2024-02-14 10:15:51 +01:00
ionutboangiu
61bcf48678 Bump go version 2024-02-14 10:15:51 +01:00
ionutboangiu
9494fc6e5e Implement PrepareMap methods for virtual EE 2024-02-09 17:39:18 +01:00
ionutboangiu
c5b197db6f Simplify event cloning (ees) 2024-02-09 17:36:24 +01:00
ionutboangiu
3637e4364e Clone export event only if processed by attributes 2024-02-09 15:57:25 +01:00
ionutboangiu
3ff7007421 Revise failing tests after CoA update 2024-02-09 15:57:25 +01:00
ionutboangiu
0dc1567a7a Ensure event is cloned before being sent to attributes
Also the exporter ID has been added in APIOpts under the *exporterID
key.
2024-02-09 15:57:25 +01:00
ionutboangiu
7129d349a1 Merge CoA into ReAuthorize logic
Also updated the integration test.
2024-02-08 13:14:14 +01:00
ionutboangiu
02c8ed11c1 Implement support for RADIUS CoA 2024-02-07 18:28:17 +01:00
ionutboangiu
9991b29cae Implement DisconnectSession API for RADIUS Agent
Updated radigo library to latest version.

Updated RadiusAgent to satisfy the birpc client interface.

Added *radDAdiscMsg OrderedNavigableMap type field within AgentRequest.
This one is similar to *diamreq, as it is used for building RADIUS
server-initiated Disconnect Requests.

radReplyAppendAttributes: refactored to reflect that it can now be
used to also append attributes to request packets, not only reply.

Added bidirectional support for session related RadiusAgent methods.

For Dynamic Authorization to be possible, a new field was added within RadiusAgent
that holds dicts and secrets only for the clients that support it. They are used
to create the DA Client sending Disconnect Requests.

Added a new cache partition to store Access-Request packets with the purpose
of using them to build the Disconnect Requests. They are identified by sessionID.
It defaults to the value of 'Acct-Session-id'.

Added a predefined '*dmr' template as well as a 'dmr_template' config option within
the 'radius_agent' config section. This will map to a custom or to the predefined
template and will be used to build the Disconnect Request. By default, it doesn't
point to any template (this also means that the Access-Request packets will not be
cached).

Another option added to 'radius_agent' is 'client_da_addresses', which lists the
RADIUS clients supporting Dynamic Authorization. The key represents the host of
the client, while the value represents the address to which we will send the
Disconnect Request.

Added integration test.
2024-02-07 18:28:17 +01:00
ionutboangiu
d182d6f601 Revise behaviour of balance factor
Now it multiplies instead of dividing.
2024-02-06 10:06:30 +01:00
ionutboangiu
f01ae9fb37 Add compatibility support between *remove_balance and *cdrlog actions 2024-01-30 18:46:48 +01:00
ionutboangiu
8c0bee1a1a Add error constant for INSUFFICIENT_CREDIT_BALANCE_BLOCKER 2024-01-29 09:57:49 +01:00
ionutboangiu
c4899cc01b Update blocker tests and add test for balance factor 2024-01-29 09:57:49 +01:00
ionutboangiu
050af6032c Include DestinationIDs and Factor when cloning balances
This fixes an issue where, if data_db is of type *internal, the Factor value is lost
on GetAccount
2024-01-29 09:57:49 +01:00
gezimbll
823b1ac37a integration tests for *http type of filter and attributes 2024-01-26 12:11:46 +01:00
gezimbll
dfb8011a1a Fix encoding dataprovider as json body for *http filter 2024-01-26 12:11:46 +01:00
ionutboangiu
911cd1b607 Update SMCostRetries backoff increment unit to ms 2024-01-25 18:41:17 +01:00
ionutboangiu
5c96ecf27e Update balance factor to depend on category
Updated unit tests to reflect that also.
2024-01-25 18:41:17 +01:00
ionutboangiu
dca2c4b6a1 Revise unit tests following the blocker update 2024-01-23 14:12:33 +01:00
ionutboangiu
36bdc41e97 Add support for kafka ssl encryption
For both poster and reader.
Added integration test.
2024-01-23 14:12:33 +01:00
DanB
e0d15f1a9e Prevent balance Blocker to partially debit 2024-01-19 16:28:09 +01:00
ionutboangiu
2fab0b92c5 Update balance blocker test (incomplete) 2024-01-19 10:35:18 +01:00
gezimbll
6f6374abb9 added *http attribute type 2024-01-15 16:17:02 +01:00
gezimbll
584a55ab25 added *http filter type 2024-01-15 16:17:02 +01:00
ionutboangiu
b76d61281c Implement new *transfer_balance action
Added possibility to mock datamanager account functions.

Fixed typo in SubtractValue function name.

Added unit & integration tests.
2024-01-15 16:15:18 +01:00
Dan Christian Bogos
57413b1346 Merge pull request #4237 from arberkatellari/TMPmaster
caching_delay implementation
2024-01-15 16:13:21 +01:00
arberkatellari
b88045872f Optimise caching_delay 2024-01-09 09:42:48 -05:00
arberkatellari
29698051b0 Merge branch 'master' into TMPmaster 2024-01-09 02:45:45 -05:00
arberkatellari
0cfc4b5658 Continue caching_delay implementation & tests 2024-01-08 11:00:10 -05:00
arberkatellari
d5d873b851 Add caching_delay flag to cgr-loader 2024-01-06 17:15:33 +01:00
ionutboangiu
a5361485d9 Update fsock library 2023-12-22 18:55:58 +01:00
arberkatellari
87bb4b1665 Add caching_delay flag to cgr-loader 2023-12-22 10:20:31 -05:00
gezimbll
422d9196b4 Added new filter "*contains" 2023-12-18 17:30:15 +01:00
ionutboangiu
b4ef61d6f2 Update eventcost FieldAsInterface methods
Rating map is now accessible from Accounting.

ExtraCharges struct is accessible from Accounting.

RatingUnit fields that did not represent the id of another event cost struct
are now retrievable.
2023-12-13 20:32:27 +01:00
ionutboangiu
17fbc2d51b Rename mongoScheme opt to mongoConnScheme 2023-12-12 10:10:26 +01:00
ionutboangiu
24cbe49d90 Add support for mongodb+srv conn format
Option can be found in db opts under the name 'mongoSchema'.
2023-12-11 17:15:40 +01:00
ionutboangiu
1154cad0df Rename max_recursion_depth cfg param to fallback_depth 2023-12-07 17:08:22 +01:00
ionutboangiu
ff53446e41 Make recursion_max_depth a configurable option
Also added an integration test checking the recursion depth functionality.
2023-12-07 17:08:22 +01:00
ionutboangiu
7886a35d63 Rename composeURI func to composeMongoURI
To reflect that it's used exclusively for MongoDB (for now at least).

Also added a descriptive comment to the function.
2023-12-07 17:07:42 +01:00
ionutboangiu
a057b34505 Use simple string concatenation to build URI
No need to keep the Parse call as a validation step since
any issue would be caught when establishing a connection.

Renamed buildURL to composeURI.
2023-12-07 17:07:42 +01:00
ionutboangiu
b502920b0b Revise buildURL function
The RawQuery field would not be properly populated in
the old implementation. Has been fixed by calling the
Parse function at the end.
2023-12-07 17:07:42 +01:00
gezimbll
f258a289f4 Updated statmetrics test && added comments 2023-12-01 18:27:44 +01:00
gezimbll
b99d87c262 Added OneEvent functionality for statmetrics && tests 2023-12-01 18:27:44 +01:00
gezimbll
b2aad38e68 Added OneEvent functionality to StatS 2023-12-01 18:27:44 +01:00
gezimbll
5f801c8b67 Revise integration tests 2023-11-30 16:52:43 +01:00
gezimbll
443cb81828 Updated registrarc config to populate connection id from NodeID 2023-11-30 16:52:43 +01:00
ionutboangiu
0c91933065 Revise ERs event exporting
Add ees_success_ids and ees_failed_ids fields in reader config. The
former will be used to set EeIDs when the event processing returns
no error, while the latter will be used otherwise.

Add config sanity checks for the added options.

Remove Processed opts and everything related to them since they should
not be used anymore.

Fixed test compilation errors caused by the change.
2023-11-29 16:21:51 +01:00
ionutboangiu
f4e11d8a5a Add ees_conns field option for ERs section 2023-11-29 16:21:51 +01:00
arberkatellari
20f2f7353e Add tests for SSv1AuthorizeEvent with *sms & *data 2023-11-16 11:17:54 +01:00