From 45cd85f2cb8fcae6dfb69fd694f535c28cfdec5d Mon Sep 17 00:00:00 2001 From: Lorena Goldoni <33703137+Lorygold@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:17:52 +0200 Subject: [PATCH] 1.2.7 (#85) * Setup config (#70) * Updated setup_config mgmt command * Updated CHANGELOG.md * Added cover * Update README.md * Managed values as a list * Refactoring * Removed comments * buffalogs_1_2_2 * 72 exception keyerror ip in process user (#73) * Fixed KeyError('ip') * Updated CHANGELOG.md * Added user.name exists in Elastic query * Version 1.2.3 * Added new screenshots (#75) * Fixed ValueError('make_aware expects a naive datetime) (#77) * Fixed ValueError('make_aware expects a naive datetime) * fix * Set USE_TZ = True * Updated CHANGELOG.md * Updated CHANGELOG.md * Version 1.2.4 * Fix fw index name (#79) * Fixed fw-proxy index name * Updated CHANGELOG.md * Update README.md (#80) * Version 1.2.5 * Fix linters requirements (#82) * Removed linters requirements from setup * Updated CHANGELOG.md * Updated requirements * Version 1.2.6 * Fix * revert * Fixed alert description format (#84) * Fixed alert description format * fixed test * Version 1.2.7 --- CHANGELOG.md | 3 +++ buffalogs/impossible_travel/modules/impossible_travel.py | 3 +-- buffalogs/impossible_travel/tests/test_views.py | 2 +- django-buffalogs/buffalogs.egg-info/PKG-INFO | 6 +----- django-buffalogs/setup.cfg | 6 +----- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60ff325..b370b87 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ ## 1.2.x +### 1.2.7 +#### Bugfix +* Fixed alert description format ### 1.2.6 #### Bugfix * Removed linters from the setup app requirements diff --git a/buffalogs/impossible_travel/modules/impossible_travel.py b/buffalogs/impossible_travel/modules/impossible_travel.py index c936bc6..975e3f7 100644 --- a/buffalogs/impossible_travel/modules/impossible_travel.py +++ b/buffalogs/impossible_travel/modules/impossible_travel.py @@ -47,8 +47,7 @@ def calc_distance(self, db_user, prev_login, last_login_user_fields): alert_info["alert_name"] = Alert.ruleNameEnum.IMP_TRAVEL alert_info[ "alert_desc" - ] = f"{alert_info['alert_name']} for User: {db_user.username},\ - at: {last_timestamp_datetimeObj_aware}, from: {last_login_user_fields['country']}, previous country: {prev_login.country}, distance covered at {int(vel)} Km/h" + ] = f"{alert_info['alert_name']} for User: {db_user.username}, at: {last_timestamp_datetimeObj_aware}, from: {last_login_user_fields['country']}, previous country: {prev_login.country}, distance covered at {int(vel)} Km/h" return alert_info, int(vel) def update_model(self, db_user, new_login): diff --git a/buffalogs/impossible_travel/tests/test_views.py b/buffalogs/impossible_travel/tests/test_views.py index 35844a5..bc09c0c 100644 --- a/buffalogs/impossible_travel/tests/test_views.py +++ b/buffalogs/impossible_travel/tests/test_views.py @@ -218,8 +218,8 @@ def test_alerts_api(self): start = creation_mock_time end = creation_mock_time + timedelta(minutes=10) list_expected_result = [ - {"timestamp": "2023-05-20T11:45:01.229Z", "username": "Lorena Goldoni", "rule_name": "Login from new device"}, {"timestamp": "2023-06-20T10:17:33.358Z", "username": "Lorena Goldoni", "rule_name": "Impossible Travel detected"}, + {"timestamp": "2023-05-20T11:45:01.229Z", "username": "Lorena Goldoni", "rule_name": "Login from new device"}, ] response = self.client.get(f"{reverse('alerts_api')}?start={start.strftime('%Y-%m-%dT%H:%M:%SZ')}&end={end.strftime('%Y-%m-%dT%H:%M:%SZ')}") self.assertEqual(response.status_code, 200) diff --git a/django-buffalogs/buffalogs.egg-info/PKG-INFO b/django-buffalogs/buffalogs.egg-info/PKG-INFO index 903d0fc..8c2e89e 100644 --- a/django-buffalogs/buffalogs.egg-info/PKG-INFO +++ b/django-buffalogs/buffalogs.egg-info/PKG-INFO @@ -1,10 +1,6 @@ Metadata-Version: 2.1 Name: buffalogs -<<<<<<< HEAD -Version: 1.2.6 -======= -Version: 1.2.5 ->>>>>>> f9f033cfd163c35cbf219f20806c3b4fb845860c +Version: 1.2.7 Summary: A Django app to detect anomaly logins. Home-page: UNKNOWN Author: Lorena Goldoni diff --git a/django-buffalogs/setup.cfg b/django-buffalogs/setup.cfg index 42e4b21..0f2aae6 100644 --- a/django-buffalogs/setup.cfg +++ b/django-buffalogs/setup.cfg @@ -1,10 +1,6 @@ [metadata] name = buffalogs -<<<<<<< HEAD -version = 1.2.6 -======= -version = 1.2.5 ->>>>>>> f9f033cfd163c35cbf219f20806c3b4fb845860c +version = 1.2.7 description = A Django app to detect anomaly logins. long_description = file: README.rst author = Lorena Goldoni