Commit Graph

4831 Commits

Author SHA1 Message Date
Christie Rice
81bcfdf1ec MICROBA-393 Add customized partner report headings (#24502) 2020-07-16 08:58:08 -04:00
adeel khan
46becdc577 Merge pull request #181 from edx/adeel/fixing-xss-issues
Fixes xss issues.
2020-07-16 11:53:24 +05:00
Dillon Dumesnil
2601975fd3 Revert "AA-223 - Add ORA2 dates to the dates page" 2020-07-15 10:13:00 -07:00
Calen Pennington
6edec4f530 Merge pull request #24421 from cpennington/ora2-dates
AA-223 - Add ORA2 dates to the dates page
2020-07-15 10:50:08 -04:00
Binod Pant
167d8f278f ENT-3007 : round 2 API endpoints for samlproviderconfig and samlproviderdata (#24456)
* ENT-3007 auth/saml/v0/saml/providerdata and auth/saml/v0/saml/providerconfig endpoints

Move code to subfolder for samlproviderconfig

extra comma

undo accidental remove of import

GET works for a single config now

Use ModelViewSet to get all CRUD method. Test still fails

Add auth/saml/v0/providerdata endpoints

fixup reverse and test issue, remove leading caret

just triggering run, why is it failing in CI?

pycodelint fixes

Skip auth tests unless feature is on

Tests for post/put for samlproviderdata

move urls to their own folders

api tests for post samlprovierconfig

create 1 providerconfig test case

lint fixes

lint

lint

cleanup code local urls /samlproviderconfig works

note needed right now

Fix import errors

lint

unused import

wip: first attempt at rbac auth and jwt cookie in test

round 2 with enterprise uuid as url param for samlproviderconfig

improve tests, still dont pass

fix test by using system role, wip other test

fix create test

add get/post tests for providerdata

isort fixes

string lint fix

Cleanup based on feedback round1

move utils to tests package

Move util fn to openedx.feature area

lint

ENT-3007 : Round 2 of work on auth/saml/v0/providerconfig and auth/saml/v0/providerdata endpoints

* Fix test issue use string uuid for permission obj

* snake case changes provider_config

* snake case

* provider_data, tests and lint

* patch and delete tests for providerdata

* snake_case

* snake_case

* snake_case

* make patch test stronger

* 404 if invalid uuid for get param

* common util for validate uuid4

* unused import

* lint fixes for pycodestyle

* 400 when uuid is missing

* 400 instead of 404 for missing uuid

* spell fix

* update docstring for api usage

* docstring clarify
2020-07-15 10:34:26 -04:00
Aura Milena Alba
1cba2a0004 [BD-10] [DEPR-65][DEPR-74] Remove pattern library of course_bookmarks.py (#24233) 2020-07-15 10:23:14 -04:00
Awais Qureshi
9e0758ffba Merge pull request #24487 from edx/BOM-1890-fixing-dj-warnings
Django3.0 warnings fix
2020-07-15 19:16:12 +05:00
Calen Pennington
d6bf54b576 Add ORA2 dates to the dates page
ORA2 (openassessment) problems have multiple dates associated with are
not bound to the `due` date that is modified by Personalized Learner
Schedules. We expose the ORA2 dates separately in the dates page
so that learners aren't surprised by the differing deadlines.

[AA-223]
2020-07-15 09:52:22 -04:00
Michael Terry
f9d379203e Merge pull request #24391 from edx/mikix/assignments-complete
AA-225: Only consider scored items for past due assignments
2020-07-14 15:28:52 -04:00
Michael Terry
939f268da8 AA-225: Only consider scored items for past due assignments
When considering if an assignment is past due for the dates tab,
only look at the scored and graded units in the subsection (i.e.
ignore reading and video units).

This still leaves the "complete" field alone -- i.e. those
subsections will still be left incomplete generally. But for
assignment-focused tasks, they will instead be considered complete.
2020-07-14 15:04:19 -04:00
Carla Duarte
30ce747357 Merge pull request #24430 from edx/ciduarte/AA-187
AA-187: Mobile API for course deadline data
2020-07-14 14:29:24 -04:00
Albert (AJ) St. Aubin
77f3d9099b [MICROBA-437] Add api to determine demographics status based on user data 2020-07-14 12:58:07 -04:00
Awais Qureshi
fd6cb9e0d6 BOM-1890
Remove the context parameter from CourseKeyField.from_db_value()
2020-07-14 21:55:50 +05:00
Braden MacDonald
887941f3ce Merge pull request #24277: Fix broken tests due to invalid field name 2020-07-14 09:37:18 -07:00
Carla Duarte
61228f34cf AA-187: Mobile API for course deadline data 2020-07-14 12:29:08 -04:00
Christie Rice
a22957d504 Revert "MICROBA-393 Add customized partner report headings (#24437)" (#24480)
This reverts commit ef536e49de.
2020-07-14 11:30:11 -04:00
Nick
0b95c2d3ea Merge pull request #24451 from edx/AA-160-calendar-sync-initial-email
AA-160 calendar sync initial email
2020-07-14 11:24:36 -04:00
Nicholas D'Alfonso
858c3750b0 AA-160 calendar sync initial email
-use Amazon SES to send calendar sync email when user initially
 subscribes to the calendar sync feature
2020-07-14 10:58:01 -04:00
Christie Rice
ef536e49de MICROBA-393 Add customized partner report headings (#24437) 2020-07-14 10:37:36 -04:00
Robert Raposa
e89e1a4038 update oauth_dispatch ADRs to accepted (#24474)
The following oauth_dispatch ADRs are being
marked as accepted, because they were implemented
and are in use in Open edX.
- 0006-enforce-scopes-in-LMS-APIs.rst
- 0007-include-organizations-in-tokens.rst

Given that, scopes have still not been widely
adopted in Open edX, which would require additional
decisions and investment.
2020-07-14 09:57:30 -04:00
Ned Batchelder
3eb7b4e18d Merge pull request #24395 from fghaas/fix_profile_images_on_s3
Fix profile image URLs for image storage on non-public S3 buckets
2020-07-14 07:25:26 -04:00
Sid Verma
04bc696661 Fix wrong field name in ManyRelation 2020-07-14 06:03:44 +05:30
Sid Verma
c609451d2e [BD-14] Limit number of blocks allowed in content libraries (#24276)
* Enforce limit on number of blocks allowed in library (blockstore)

* Enforce limit on number of blocks allowed in library (modulestore)

* Changes from review feedback
2020-07-13 15:49:47 -04:00
David Ormsbee
6759ccc8cd Merge pull request #24396 from open-craft/patrick/BB-2672-tnl-7260-course-outline-api-hide-after-due
[BD-29] TNL-7260 LearningSequences Course Outline makes sequences with hide_after_due inaccessible after due date
2020-07-13 12:46:41 -04:00
Dillon Dumesnil
b479d511b7 Merge pull request #24424 from edx/ddumesnil/aa-226
AA-226: Adding Authentication classes to endpoints for mobile use
2020-07-13 08:19:52 -07:00
Dillon Dumesnil
b6967e96cf Merge pull request #24443 from edx/ddumesnil/hide-dates-tab-unenrolled-aa-219
AA-219: Dates Tab behavior improvements
2020-07-13 07:31:29 -07:00
Aura Milena Alba
ee3f612382 Remove pattern library of course_search.py (#24173)
[BD-10] [DEPR-72] Remove pattern library of course_search.py
2020-07-13 09:11:03 -04:00
Patrick Cockwell
58789e0f99 TNL-7260 Learning Sequences Course Outline makes sequences with hide_after_due inaccessible after due date 2020-07-13 13:55:50 +07:00
Feanil Patel
5470ce5805 Revert "ENT-3007 : Add auth/saml/v0/providerconfig|data CRUD endpoints for use in admin portal (#24298)"
This reverts commit 96ddcdc288.
2020-07-10 13:38:30 -04:00
Binod Pant
96ddcdc288 ENT-3007 : Add auth/saml/v0/providerconfig|data CRUD endpoints for use in admin portal (#24298)
* Add auth/samlproviderconfig CRUD endpoints for use in admin portal

Fixes: ENT-3007

* Move code to subfolder for samlproviderconfig

* extra comma

* undo accidental remove of import

* GET works for a single config now

* Use ModelViewSet to get all CRUD method. Test still fails

* Add auth/saml/v0/providerdata endpoints

* fixup reverse and test issue, remove leading caret

* just triggering run, why is it failing in CI?

* pycodelint fixes

* Skip auth tests unless feature is on

* Tests for post/put for samlproviderdata

* move urls to their own folders

* api tests for post samlprovierconfig

* create 1 providerconfig test case

* lint fixes

* lint

* lint

* cleanup code local urls /samlproviderconfig works

* note needed right now

* Fix import errors

* lint

* unused import

* wip: first attempt at rbac auth and jwt cookie in test

* round 2 with enterprise uuid as url param for samlproviderconfig

* improve tests, still dont pass

* fix test by using system role, wip other test

* fix create test

* add get/post tests for providerdata

* isort fixes

* string lint fix

* Cleanup based on feedback round1

* move utils to tests package

* Move util fn to openedx.feature area

* lint

* lint fix

* remove unused import
2020-07-10 11:23:13 -04:00
Dillon Dumesnil
be346499da AA-219: Dates Tab behavior improvements
This switches the Dates Tab to be an enrolled tab allowing only
enrolled learners to view. Additionally, it will now redirect
logged out learners to the login page if they hit the Dates Tab directly.
2020-07-10 07:08:07 -07:00
adeelehsan
a26b9317db Merge pull request #24418 from edx/aehsan/prod-674/get_useremail_from_request_session
Get user email from request
2020-07-10 18:06:03 +05:00
adeelehsan
b26f26e993 Get user email from request
PROD-674
2020-07-10 16:50:05 +05:00
Robert Raposa
77e490f057 ARCHBOM-1305: remove deprecated flag_undefined_default (#24426)
This is the final step in removing the deprecated
flag_undefined_default as explained by the following ADR:
https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/waffle_utils/docs/decisions/0001-refactor-waffle-flag-default.rst

Notes:

* All uses of flag_undefined_default=False were always
  supposed to have been no-ops.
* All uses of flag_undefined_default=True that are removed
  in this PR have been replaced by migrations in past PRs.
* The temporary metric temp_flag_default_used id no longer
  reporting any data.

ARCHBOM-1305
2020-07-09 09:31:31 -04:00
Feanil Patel
be23278034 Merge pull request #24422 from edx/feanil/archbom-1298-login-page-error-on-invalid-email
ARCHBOM-1298 Validate before accessing email parts.
2020-07-08 14:16:16 -04:00
Feanil Patel
f2ac18049b Validate before accessing email parts.
For somereason earlier validation is not ensuring that we have a valid e-email.
In this case, break out of the flow since we don't have a domain that's in our
list and log the user's id so that we can learn more about when this happens.

By a reading of the code flow, it doesn't seem like it should be possible except
with a handful of users that have invalid e-mail addresses in the database but it
seems to be happening pretty regularly.
2020-07-08 13:35:55 -04:00
Dillon Dumesnil
f0b4c75289 AA-226: Adding Authentication classes to endpoints for mobile use
The class BearerAuthenticationAllowInactiveUser is needed for the
mobile app to authenticate. The other Auth classes are to support
the standard work flows.
2020-07-08 10:06:58 -07:00
Robert Raposa
371f89838b use flag's everyone setting when no request (#24416)
This is Phase 2 if a rollout started here:
https://github.com/edx/edx-platform/pull/24392

When a flag is being used without a request, we will
return True if the flag's everyone status is set to
True.

The current implementation is to use flag_undefined_default,
which is deprecated and we are trying to remove it.

ARCHBOM-1331
2020-07-08 11:12:56 -04:00
Waheed Ahmed
4f80fd6540 Improve password reset rate limit.
Used django-ratelimit instead of django-ratelimit-backend
to configure two different rate limit configurations for same
endpoint.

PROD-1708
2020-07-08 16:19:07 +05:00
Waheed Ahmed
a6a69224d1 Ratelimit login_user endpoint.
Ratelimited `login_user` endpoint using `django-ratelimit`, also
decreased default value of logistration rate limit to 100 requests
per five minutes per IP.

PROD-1877
2020-07-08 15:36:11 +05:00
Robert Raposa
081a751d2c fix temp_flag_no_request_default_match (#24409)
Fix bug in metric temp_flag_no_request_default_match.
Metric renamed to temp_flag_no_request_default_match_2
to ensure we are looking at the right data.

This extends Phase 1 of the rollout, as documented in:
https://github.com/edx/edx-platform/pull/24392

ARCHBOM-1331
2020-07-07 16:32:11 -04:00
Robert Raposa
10ab63995a remove temporary USE_DEFAULT_TRUE_NAMESPACE (#24404)
Once USE_DEFAULT_TRUE_NAMESPACE is fully rolled out
and proves to return True where we wish, we can
remove this temporary roll-out flag introduced in:
https://github.com/edx/edx-platform/pull/24322

ARCHBOM-1316
2020-07-07 15:07:59 -04:00
Christie Rice
b81888323e Revert "MICROBA-393 Add customized partner report headings" (#24406) 2020-07-07 14:12:52 -04:00
Christie Rice
011259bb3a MICROBA-393 Add customized partner report headings (#24321)
* MICROBA-393 Add customized partner report headings

* Add sorting
2020-07-07 13:03:59 -04:00
Robert Raposa
9b9259c160 phase 1: update waffle no request default (#24392)
This is Phase 1 of a 2 part rollout.

Here, we want to ensure that checking if the waffle flag
is set to active for everyone would provide the same value
as the current implementation for calls that have no request.
The current implementation is to use flag_undefined_default,
which is deprecated and we are trying to remove.

We are adding a custom metric to see if they match in
Production. If all goes well, in Phase 2 we will switch to
this new approach.

ARCHBOM-1331
2020-07-07 12:01:08 -04:00
Aura Milena Alba
6026a98e11 Remove pattern library in course_home.py (#24157)
[BD-10] [DEPR-83][DEPR-81] Remove pattern library in course_home.py
2020-07-07 11:23:22 -04:00
Christie Rice
31a525580d Add sorting 2020-07-07 10:59:58 -04:00
Christie Rice
8f64860b85 MICROBA-393 Add customized partner report headings 2020-07-07 10:59:58 -04:00
Florian Haas
26281cbe36 Fix profile image URLs for image storage on non-public S3 buckets
In image_helpers.py, the _get_profile_image_urls() method would append
"?v=<version>" to the query string for serving profile images.

This might break serving profile images if

* EDXAPP_PROFILE_IMAGE_BACKEND was configured with its class option
  set to django.storages.s3boto3.S3Boto3Storage (or its deprecated
  predecedessor, django.storages.s3boto.S3BotoStorage), and
* that backend used signed URLs with query-string authentication (i.e.
  was *not* configured with an S3 custom domain).

When both the above conditions are met, then the URL returned by the
storage backend's url() method already contains "?", and
_get_profile_image_urls() would add another. This results in a query
string that doesn't exactly violate RFC 3986, but is discouraged by
it.[1]

Amazon S3 itself may be able to parse these query strings correctly,
but other S3 API implementations (such as Ceph radosgw[2]) may not,
and the problem is easily avoided by just looking for "?" in the
rendered URL, and using "&v=<version>" instead if we find a match.

The proper way of appending the v=<version> query parameter would
probably be to pull the URL and the query string apart and then back
together[3], but that's most likely overdoing it.

[1] https://tools.ietf.org/html/rfc3986#section-3.4 says:
"However, as query components are often used to carry identifying
information in the form of "key=value" pairs and one frequently used
value is a reference to another URI, it is sometimes better for
usability to avoid percent- encoding those characters." ("Those
characters" being "/" and "?".)

[2] https://docs.ceph.com/docs/master/radosgw/s3/

[3] https://docs.python.org/3/library/urllib.parse.html
2020-07-06 11:09:16 +02:00
Robert Raposa
7f22041fc1 ARCHBOM-1316: always enable some course_experience flags (#24322)
In order to remove the deprecated flag_undefined_default=True
argument, this commit updates the following flags to always be
enabled using a new temporary class:

- course_experience.course_outline_page
- course_experience.unified_course_tab

Adds a temporary setting `USE_DEFAULT_TRUE_NAMESPACE`,
to enable a monitored rollout of this change.

TNL-7061 is the ticket where these flags will actually be
removed. This requires more careful work including removing
all dead code, and potentially refactoring tests that were
testing shared functionality, but only when the flag was
False.

ARCHBOM-1316
2020-07-02 12:00:23 -04:00