From e79136c4e7cf57aefda6584c9bc7f6f27ff1eee4 Mon Sep 17 00:00:00 2001 From: Chandan Rai Date: Thu, 23 Feb 2017 21:57:07 +0530 Subject: [PATCH 1/6] corrected typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b59a1f3..3cb0c1a 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ The functions for the commands are defined in `commands.py` and their structure ### Messaging Securitybot is designed to be compatible with a wide variety of messaging systems. We currently provide bindings for Slack, but feel free to contribute any other plugins, like for Gitter or Zulip, upstream. -Messaging is made possible by `securitybot/chat/chat.py` which provides a small number of functions for querying users in a messaging group, messaing those users, and sending messages to a specific channel/room. +Messaging is made possible by `securitybot/chat/chat.py` which provides a small number of functions for querying users in a messaging group, messaging those users, and sending messages to a specific channel/room. To add bindings for a new messaging system, subclass `Chat`. ### 2FA @@ -81,7 +81,7 @@ If you encounter a SHA-256 collision, please contact someone your nearest Univer ## FAQ -pls ask us things +Please ask us things ## Contributing Contributors must abide by the [Dropbox Contributor License Agreement][cla]. From 823af2864fa8bd0c50ee5883c8cbe8fc30101930 Mon Sep 17 00:00:00 2001 From: Janella Date: Fri, 24 Feb 2017 07:13:57 +1300 Subject: [PATCH 2/6] Correct formatting of list --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3cb0c1a..cc3021a 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ Having a database allows alerts to be persistent and means that the bot doesn't ### Securitybot proper The bot itself performs a small set of functions: + 1. Reads messages, interpreting them as commands. 1. Polls each user object to update their state of applicable. 1. Grabs new alerts from the database and assigns them to users or escalates on an unknown user. From 5d8c8fcd7bf85536e28a9903bdaae90ff91216eb Mon Sep 17 00:00:00 2001 From: Craig Date: Thu, 23 Feb 2017 10:24:02 -0800 Subject: [PATCH 3/6] Added missing word --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc3021a..440aa64 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ We keep track of whatever information a messaging system gives to us, but really ### Alerts Alerts are uniquely identified by a SHA-256 hash which comes from some hash of the event that generated them. We assume that a SHA-256 hash is sufficiently random for there to be no collisions. -If you encounter a SHA-256 collision, please contact someone your nearest University and enjoy the fame and fortune it brings upon you. +If you encounter a SHA-256 collision, please contact someone at your nearest University and enjoy the fame and fortune it brings upon you. ## FAQ From b7c16f9223ce62e47d9fb9c158a8f3422a46e8e7 Mon Sep 17 00:00:00 2001 From: Patrick Lecuyer Date: Sun, 26 Feb 2017 17:34:23 -0500 Subject: [PATCH 4/6] Fixed business hours issue for test_auto_escalate --- tests/user_test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/user_test.py b/tests/user_test.py index 0f10879..1f129f6 100644 --- a/tests/user_test.py +++ b/tests/user_test.py @@ -3,6 +3,7 @@ from collections import defaultdict from datetime import timedelta +from time import sleep import securitybot.user as user import securitybot.bot @@ -279,8 +280,9 @@ def test_not_allow_2fa_flow(self, auth, mock_task): test_user._last_message.text == '') mock_task.stop() - - @patch('securitybot.user.ESCALATION_TIME', timedelta(seconds=-1)) + # Putting escalation time in the past to make sure tests outsisde of + # business hours won't fail + @patch('securitybot.user.ESCALATION_TIME', timedelta(weeks=-1)) @patch('securitybot.tasker.tasker.Task') @patch('securitybot.auth.auth.Auth', autospec=True) def test_auto_escalate(self, auth, mock_task): @@ -299,7 +301,8 @@ def test_auto_escalate(self, auth, mock_task): assert str(test_user._fsm.state) == 'action_performed_check' # Auto-escalation should happen immediately because escalation time - # is set to be zero seconds + # is set in the past + test_user.step() assert str(test_user._fsm.state) == 'task_finished' From 63cc1f9cad575f4a6f9bfc42c25d706c3fc57e32 Mon Sep 17 00:00:00 2001 From: Patrick Lecuyer Date: Sun, 26 Feb 2017 17:57:46 -0500 Subject: [PATCH 5/6] Workaround for flake8 F401 error on type hints --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 18e0f53..f733e25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,5 @@ python: sudo: false install: pip install -r requirements.txt script: - - flake8 securitybot/ + - flake8 --ignore F401 securitybot/ - PYTHONPATH=$(pwd) py.test -v tests/ - From 8cc4846602011db396df621d2e84e5808a6f3441 Mon Sep 17 00:00:00 2001 From: Ishan Jain Date: Sat, 15 Apr 2017 05:30:46 +0530 Subject: [PATCH 6/6] Fix for #14 --- securitybot/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/securitybot/commands.py b/securitybot/commands.py index c1f1a94..099f052 100644 --- a/securitybot/commands.py +++ b/securitybot/commands.py @@ -66,8 +66,8 @@ def ignore(bot, user, args): # Find correct task in user object task = None - if which == 'last' and user.old_tasks: - task = user.old_tasks[-1] + if which == 'last' and user.tasks: + task = user.tasks[-1] elif which == 'current' and user.pending_task: task = user.pending_task if task is None: