Merge lp:~facundo/ubuntuone-client/stable-dont-log-credentials into lp:ubuntuone-client/stable-1-4

Proposed by Facundo Batista
Status: Merged
Approved by: Natalia Bidart
Approved revision: 720
Merged at revision: 721
Proposed branch: lp:~facundo/ubuntuone-client/stable-dont-log-credentials
Merge into: lp:ubuntuone-client/stable-1-4
Diff against target: 40 lines (+20/-0)
2 files modified
tests/syncdaemon/test_eventqueue.py (+18/-0)
ubuntuone/syncdaemon/event_queue.py (+2/-0)
To merge this branch: bzr merge lp:~facundo/ubuntuone-client/stable-dont-log-credentials
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Guillermo Gonzalez Approve
Review via email: mp+36577@code.launchpad.net

Commit message

Don't log the SYS_USER_CONNECT event related info, as it's private.

Description of the change

Don't log the SYS_USER_CONNECT event related info, as it's private.

Tests included.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/syncdaemon/test_eventqueue.py'
2--- tests/syncdaemon/test_eventqueue.py 2010-05-26 21:43:27 +0000
3+++ tests/syncdaemon/test_eventqueue.py 2010-09-24 18:18:02 +0000
4@@ -197,6 +197,24 @@
5
6 self.eq.unsubscribe(c)
7
8+ def test_log_pushing_data(self):
9+ """Pushed event and info should be logged."""
10+ self.eq.push("AQ_QUERY_ERROR", 'item', error='err')
11+ self.assertTrue(self.log_handler.check_debug(
12+ "push_event: AQ_QUERY_ERROR, args:('item',), kw:{'error': 'err'}"))
13+
14+ def test_log_delete_in_info(self):
15+ """Pushed any deletion event should be logged in info."""
16+ self.eq.push("FS_DIR_DELETE", 'path')
17+ self.assertTrue(self.log_handler.check_info(
18+ "push_event: FS_DIR_DELETE"))
19+
20+ def test_log_pushing_private_data(self):
21+ """SYS_USER_CONNECT event info must not be logged."""
22+ self.eq.push("SYS_USER_CONNECT", access_token='foo')
23+ self.assertTrue(self.log_handler.check_debug(
24+ "push_event: SYS_USER_CONNECT, args:*, kw:*"))
25+
26
27 class PushTestsWithCallback(BaseEQTestCase):
28 """Test the error handling in the event distribution machinery."""
29
30=== modified file 'ubuntuone/syncdaemon/event_queue.py'
31--- ubuntuone/syncdaemon/event_queue.py 2010-08-31 14:19:53 +0000
32+++ ubuntuone/syncdaemon/event_queue.py 2010-09-24 18:18:02 +0000
33@@ -769,6 +769,8 @@
34 if event_name.endswith('DELETE'):
35 # log every DELETE in INFO level
36 self.log.info(log_msg, event_name, args, kwargs)
37+ elif event_name == 'SYS_USER_CONNECT':
38+ self.log.debug(log_msg, event_name, '*', '*')
39 else:
40 self.log.debug(log_msg, event_name, args, kwargs)
41

Subscribers

People subscribed via source and target branches