Commit Graph

18578 Commits

Author SHA1 Message Date
Matthew Piatetsky
ff839c364e Merge pull request #26143 from edx/AA-613
[AA-613] Add contains_content_type_gated_content attribute to display items in the Sequence Metadata API.
2021-01-28 12:28:05 -05:00
Matthew Piatetsky
84fb4679c9 Add contains_content_type_gated_content attribute to display items in the Sequence Metadata API. This attribute is used to display the content type gating paywall in frontend-app-learning.
Also, refactor existing timed exam code that checks for content_type_gated_content in a sequence to make it try with the new code
AA-613
2021-01-28 12:00:53 -05:00
Albert (AJ) St. Aubin
1927ea234a [MICROBA-952] Updating CourseEntitlements Admin to disallow changes to
order number
.
2021-01-28 08:55:53 -05:00
stvn
b55a3f9680 Merge PR #26200 fix/mfe-rollout/anonymous-access
* Commits:
  fix: Fix KeyError in vertical_block
2021-01-27 12:19:20 -08:00
stvn
e09a5c9d94 fix: Fix KeyError in vertical_block
This now mimics the way this is (safely) done in the sequence module [1].

References:
- [1] 5f94a082ce/common/lib/xmodule/xmodule/seq_module.py (L657-L658)
2021-01-27 11:40:13 -08:00
Tim McCormack
4359be96f3 Tweaks to anonymous user ID code path monitoring (#26194)
- Use different attribute names for new and old versions of function
- Use a shorter name overall (for ease of analysis)
- Add monitor for fetched-existing case
- Only record computed-stored if `get_or_create` succeeds, but also
  break it into created vs. fetched cases by checking return value
- Correct name of monitor in `except` clause -- that should only happen
  for a race inside `get_or_create` itself. There's a different race in
  the `anonymous_uid_for_user` between fetch and compute/save.
- Other name tweaks

ARCHBOM-1674
2021-01-27 16:12:55 +00: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
Muhammad Soban Javed
d26a59eb67 import task decorator from celery APP instance in CMS (#25953)
* import task decorator from celery APP instance instead of celery package in CMS

* replaced task decorator with shared_task in cms and common

* Fixed import of shared_task

* Fixed import
2021-01-27 18:35:11 +05:00
Manjinder Singh
2723e0e2bd [ARCHBOM-1645] Modifying anonymous_id_for_user() to handly SECRET_KEY rotation (#26162)
These changes were initially made to make it easier to do SECRET_KEY rotations.  Along the way, we found it made sense to refractor the code as well.

Changes made:
- changed get_to_create to create because now the code should only get to this block when a write is necessary
- added a lookup for anonymous_user_id. This is to return an existing anonymous_user_id rather than calculating. This will mitigate the results of SECRET_KEY rotation.
- Added monitoring to help us make better decisions: should we not sue SECRET_KEY, performance considerations...
- put old function behind toggle in case something goes wrong in production with new code
- refractoring function structure for better understanding
2021-01-27 07:23:19 -05:00
Kyle McCormick
e3cfaab487 Merge pull request #25955 from open-craft/symbolist/convert-hidden-module-to-xblock
[BD-04] [SE-3708] Convert HiddenDescriptor to an XBlock.
2021-01-26 13:56:06 -05:00
Tim McCormack
0fbd134c55 Add monitoring for anonymous user ID code paths (#26176)
For ARCHBOM-1674 we need more information on how often save=False is
actually used vs. other code paths.
2021-01-26 18:06:39 +00:00
edX cache uploader bot
feab79fc73 Updating Bokchoy testing database cache 2021-01-25 10:37:56 -05:00
Régis Behmo
97399cf97c Fix TypeError during transcript upload to S3
On a platform that is configured to upload video transcripts to S3
(`DEFAULT_FILE_STORAGE = "storages.backends.s3boto3.S3Boto3Storage"`),
uploads from the studio fail with a TypeError: "Unicode-objects must be
encoded before hashing"

A full stacktrace of the issue can be found here:
https://sentry.overhang.io/share/issue/2249b6f67d794c7e986cc288758f4ebe/

This error is triggered by md5 hashing in the botocore library, which
itself is used by the S3Boto3Storage storage class. This error does not
occur with filesystem-based uploads because it does not perform checksum
verification. The reason why this error would not occur on edx.org is
unknown. Similar issues were already fixed from edxval.

To address this issue, we encode the transcript file content prior to
sending it to s3.
2021-01-25 12:23:31 +01:00
edX cache uploader bot
e5ebd2077d Updating Bokchoy testing database cache 2021-01-22 10:08:31 -05:00
Braden MacDonald
ae16394ee5 Fix: update new runtime's runtime.anonymous_student_id to store in DB
This addresses a longstanding TODO item to make runtime.anonymous_student_id for content libraries v2 work the same way as it does for XBlocks in regular courses, persisting the "context ID" (equivalent to course ID) to the database. This way, if SECRET KEY is changed, existing anonymous IDs will continue to work unchanged.

This is a potentially breaking change, but should mostly affect capa problems using external code graders or Matlab code input, and I'm not aware of any such usage of the new runtime / libraries v2.
2021-01-21 15:38:53 -08:00
M. Zulqarnain
bfabc1ff41 BOM-2233 : Upgrade social-auth-core to > 4.0 (#26055)
* Upgrade social-auth-core

* Fixing a test.

Co-authored-by: Usama Sadiq <usama.sadiq@arbisoft.com>
Co-authored-by: Awais Qureshi <awais.qureshi@arbisoft.com>
2021-01-21 12:54:26 +05:00
Zainab Amir
7737c67588 Add query param to account activation redirect (#26107) 2021-01-21 10:18:54 +05:00
edX cache uploader bot
64e06aff02 Updating Bokchoy testing database cache (#26118) 2021-01-20 16:02:43 +05:00
Ali Akbar
38e2a5242e Merge pull request #216 from edx/IM/security-fixes-7
Incident Management Security Fixes 7
2021-01-19 19:26:45 +05:00
edX cache uploader bot
6ab6cc1536 Updating Bokchoy testing database cache 2021-01-15 08:57:04 -05:00
Calen Pennington
197c6d11ee Merge pull request #26043 from cpennington/user-profile-segment-identify
Call segment.identify with any changed values when user profile field…
2021-01-14 08:54:21 -05:00
Calen Pennington
f42dfe69d2 Remove emit_setting_changed_event in favor of emit_settings_changed_event 2021-01-13 15:58:55 -05:00
Calen Pennington
c8b6d69341 Implement emit_setting_changed_event in terms of emit_settings_changed_event 2021-01-13 15:58:55 -05:00
Usman Khalid
9116599f00 Convert HiddenDescriptor to an XBlock.
The class name has been retained because the class path is
specified in the modulestore config in a number of places.
2021-01-14 01:22:08 +05:00
Tim McCormack
129cd48266 Include security patch for pinning JWT signature algorithm in apple-id (#26059)
Extract from social-auth-core eed3007c4ccdbe959b1a3ac83102fe869d261948
2021-01-13 17:19:37 +00:00
Calen Pennington
fdac36ec13 Call segment.identify with any changed values when user profile fields change 2021-01-13 10:40:25 -05:00
David Ormsbee
098e047fce Merge pull request #25987 from edx/ormsbee/tnl-7636-xblock-access
Check sequence-level gating in render_xblock (TNL-7636)
2021-01-13 09:35:56 -05:00
Ahtisham Shahid
780deeed7a Merge pull request #217 from edx/ahtisham/PROD-1916-p
Error incase of disabled user social login
2021-01-13 16:24:02 +05:00
edX Transifex Bot
5d1934725d geoip2: update maxmind geolite country database 2021-01-13 04:52:41 -05:00
David Ormsbee
5f94a082ce Check sequence-level gating in render_xblock (TNL-7636).
There is certain gating logic around pre-reqs, timed exams, etc.
that happen at the SequenceModule level, and should be respected
when rendering descendant XBlocks (like individual problems) that
are in that Sequence. Rather than do a risky refactoring, I'm
keeping that logic where it is and having the render_xblock view
climb up through the ancestor list to call the SequenceModule for
that gating information.

We do _not_ check all descendants (so cousin leaf nodes in the
sequence) for cotent-type-based restrictions because sequences can
become very large (esp. when content libraries are used), and there
is a performance overhead.

If the enclosing sequence is gated in some way, we redirect to the
render_xblock view for that sequence, where hopefully some useful
messaging will be available. This is a stopgap. That redirect
should never happen because we should never be calling the leaf
XBlock for a sequence that is restricted in the MFE. But if somehow
we get there anyway, either by bug or by intrepid user fiddling,
it's better to redirect somewhere that an error _might_ be surfaced
rather than just failing.

This will actually be a little overzealous and lock things down
that should be made visible later. If there's a timed exam and the
exam is completed, it should be the case that content is visible
(just read-only). This commit will block the content before the exam
starts (this is right), open the content while the exam is live
(this is right), but make the content unavailable after the exam
period has finished (this is wrong).

But I am going to go forward with this even knowing it's wrong
because:

1. The render_xblock endpoint should never currently be used in
   timed exams in an intentional way. Neither the mobile experience
   nor the courseware MFE support it.
2. This fix will address security concerns for creative access
   patterns, even if it goes too far.
3. We're going to need to do a lot of work to address both pluggable
   access permissions handling and special exams in the courseware
   MFE, and a better implementation can be done then.
4. I've had multiple failed attempts to get this to work without
   breaking things on and off over the course of weeks, and this
   is a relatively low risk way of doing it that doesn't involve
   a major refactoring (though the bill for that will come due
   when we bring timed exams to the MFE).
2021-01-12 12:57:22 -05:00
Nizar
1e872d4e10 Adds support for enabling custom tinymce plugins in Studio's HTML editor (#25695) 2021-01-11 11:28:20 -05:00
Nizar
b49ebb93f8 Adds clean-js jake command to JakePackage and updates building instructions (#25324)
The clean-js jake command helps remove all minified js files that get generated using the minify bundle jake command

By running clean-js before running the minify command, we ensure that the tinymce files are consistent after being rebuilt/minified.

This is helpful with multiple app servers that are applying the same changes to the TinyMCE editor

This ensures that no matter on which machine the files are rebuilt, the resulting minified plugin files are consistent among all
2021-01-11 11:28:07 -05:00
Matthew Piatetsky
53ccf9bd84 Merge pull request #25988 from edx/AA-488
[AA-488] Remove uses of the active field on the schedule model in the code.
2021-01-11 09:34:00 -05:00
Michael Terry
1c322bbe67 Merge pull request #26008 from edx/mikix/timezone-alerts
Show discount deadline in a timezone-aware way
2021-01-11 08:00:43 -05:00
Ali-D-Akbar
ea227a18a9 PROD-2247 2021-01-11 14:32:50 +05:00
Ali-D-Akbar
1cd5e06294 PROD-2216 2021-01-11 14:32:50 +05:00
azanbinzahid
96836802b0 PROD-2083 2021-01-11 14:32:49 +05:00
azanbinzahid
170872feec PROD-2082 2021-01-11 14:32:49 +05:00
Michael Terry
1482755bbd Show discount deadline in a timezone-aware way
Also, fix it and the access expiration deadline to not hardcode
the date presentation in an American way.
2021-01-08 13:56:18 -05:00
Ali Akbar
0e2d12fc7c Merge pull request #213 from edx/IM/security-fixes-4
Incident Management Security Fixes 4
2021-01-08 21:46:05 +05:00
Usman Khalid
9e38b17202 Convert ErrorModule and NonStaffErrorModule to XBlocks. (#25570) 2021-01-07 10:51:33 -05:00
edX Transifex Bot
3d79b8ab95 geoip2: update maxmind geolite country database 2021-01-06 16:04:06 -05:00
edX cache uploader bot
830ca33564 Updating Bokchoy testing database cache (#25996) 2021-01-07 00:19:47 +05:00
Ahtisham Shahid
b2466c8c2b Error incase of disabled user social login
Updated status code and manage user func

update auth verification

Fixed auth condition

fixed test failuers

fixed style issues

fixed style issues

Created test for auth disabled use

Code refactor

Fixed form ain auth exchange

Fixed oauth apps with disabled user fail

applied quality fixes

Refactored tests

fixed quality issues

removed extra files

Fixed linter issues

Fixed linter issues
2021-01-06 20:37:01 +05:00
Dillon Dumesnil
e17e691d54 AA-501: Use hidden blocks to determine past due status
Blocks that were hidden by access checks would not be used when
calculating past due status for a unit. This adds in a check to
still look at those blocks, but will maintain not rendering them
when being accessed via the MFE
2021-01-06 14:11:03 +00:00
Ali-D-Akbar
a5982c7e09 PROD-2160 2021-01-06 11:36:36 +05:00
Ali-D-Akbar
4a54aa8054 PROD-2157 2021-01-06 11:36:36 +05:00
azanbinzahid
6d7752b5c1 PROD-2212 2021-01-06 11:36:36 +05:00
azanbinzahid
17261b9886 PROD-2143 2021-01-06 11:36:36 +05:00
azanbinzahid
e26f8f223a PROD-2210 2021-01-06 11:36:36 +05:00