Commit Graph

24 Commits

Author SHA1 Message Date
Aarif
a1406cddf2 replaced unittest assertions pytest assertions (#26528) 2021-02-18 18:09:45 +05:00
Jawayria
62bc555817 Applied pylint-amnesty to track 2021-02-03 13:10:42 +05:00
Tim McCormack
e0e03dec5f Use more appropriate hash when making tracking ID; document SECRET_KEY use (#26134)
- Make it easier to rotate `SECRET_KEY` by documenting this usage
  for both sensitivity and rotation process. (ARCHBOM-1676).
- Just use a hash of the secret rather than HMAC + MD5. We're not
  authenticating a message, so HMAC isn't really needed -- it just needs
  to be unique, deterministic, and irreversible. SHAKE allows generation
  of an arbitrary length hash without needing to truncate.

Also, rename tracking session ID generator for clarity -- there's no
encryption happening here.

Add additional test for existing claim of uniqueness.
2021-01-27 14:13:42 +00:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Jeremy Bowman
6f18383142 Fix bytes/string handling in tracking middleware 2019-09-18 11:59:24 -04:00
Anthony Wee
b095ce15c8 INCR-124: Run python-modernize on common/djangoapps/track/tests (#20445)
* INCR-124: Run python-modernize on common/djangoapps/track/tests

* isort
2019-05-07 14:05:38 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Syed Hassan Raza
0d6e0ac779 Add latin1 decoding to HTTP Headers 2016-03-08 12:44:55 +05:00
Syed Hassan Raza
de91ceaae2 Fix HTTP_USER_AGENT latin1 characters 2016-01-20 18:40:09 +05:00
Bill DeRusha
40a8608b0b Upgrade IP parsing in tracker middleware 2015-10-08 13:48:53 -04:00
aamir-khan
282b9449a4 ECOM-2150: Added the ga client fetching as a customer header in middleware 2015-09-09 14:50:12 +05:00
Ned Batchelder
78e9445aa1 Add super() calls to setUp/tearDown that are missing them
Also, I replaced a number of tearDown methods with addCleanup instead.
And also remove some unneeded patch.stopall() calls.
2015-05-14 18:14:21 -04:00
Piotr Mitros
cf719a40ba Add referer and accept_language to tracking logs
3 line patch, together with a world of pain due to buggy code, broken abstractions in tests, etc.
2015-02-11 13:35:27 -05:00
Ben Patterson
3ef0653711 pylint cleanup. 2014-10-11 12:51:20 -04:00
Renzo Lucioni
79461722de Re-use GA cookie when sending server-side events to Segment.io 2014-08-21 10:47:35 -04:00
Brian Wilson
f9f4f1c57a Add additional tests for tracking of sessions. 2014-06-03 13:24:48 -04:00
Brian Wilson
119d7768bf Also use md5 for constructing key for hmac. 2014-06-02 12:31:44 -04:00
Brian Wilson
919b433847 Encrypt the session id before writing to tracking logs. 2014-06-02 11:03:41 -04:00
Gabe Mulley
36269bd5a8 Integrate event-tracking in to the LMS
Support incremental conversion of events from the old API to the new, in order to ensure the new system is working, enrollment events have been modified to make use of the new API.
2014-05-01 14:04:35 -04:00
Gabe Mulley
4f4e58b5f6 add user_id to tracking context
AN-213
2013-10-29 08:18:01 -04:00
Gabe Mulley
d2b03e28fb add course_id to event context 2013-10-17 17:44:01 -04:00
Gabe Mulley
761a4dcc97 Make URL patterns to exclude from tracking configurable
* Add unit test coverage for this "exclusion from tracking" logic
* Exclude based on regex match instead of raw string comparison
* Exclude heartbeat requests from tracking
2013-09-13 11:24:51 -04:00