Commit Graph

5060 Commits

Author SHA1 Message Date
Chris Deery
dddcadb706 feat: [AA-922] remove deprecated Goals backend (#29705)
* feat: [AA-922] remove deprecated Goals backend

While the new Weekly Learning Goals were being rolled out, the previous goal setting feature still existed behind a waffle flag.
The Weekly Learning Goals now become the one and only learning goal feature.

This change does not remove the old goals feature from the legacy backend, and therefore it does not remove any of the data that was used by the old goals feature.
The goals are now driven by the single pre-existing Waffle flag ENABLE_COURSE_GOALS

 - Removed COURSE_GOALS_NUMBER_OF_DAYS_GOALS waffle flag, replacing it where needed with the existing ENABLE_COURSE_GOALS

 - modified the API to remove the old goal_options, keeping the redundant weekly_learning_goal_enabled flag

 - updated tests

 - refactor tests to fit 50 line limit in lint
2022-01-11 09:02:03 -05:00
AliAkbar
2989341b7c fix: add integer check for lms_user_id 2022-01-11 11:30:35 +05:00
Rebecca Graber
0e9499de7d feat: log an encrypted string of the full cookie header when over threshold (#29735)
* feat: log an encrypted string of the full cookie header when over threshold
2022-01-10 13:02:47 -05:00
Robert Raposa
5d79972260 fix: safe session bug when request has no user (#29731)
* fix: safe session bug when request has no user

Fixes a bug during safe session monitoring when
request has no user.

ARCHBOM-1940

* fixup! add comment and loosen if condition
2022-01-07 19:19:59 -05:00
Waheed Ahmed
fa7ef8661b fix: login by email (#29727) 2022-01-07 13:07:05 +05:00
Waheed Ahmed
ed45aee9dd refactor: separate user lookup queries for login (#29711)
Using a single query to get a user using both username and email fields
generates a massive `key_len` and causes DB overload. Separated these
lookups into two separate queries.
VAN-819
2022-01-07 11:06:07 +05:00
Robert Raposa
8fa1d4d0b6 fix: conditionally set safe session monitoring (#29724)
Fixes a bug where a custom attribute was being set
even for cases where we did not have the appropriate
data, and an exception was being raised.

ARCHBOM-1940
2022-01-06 16:49:58 -05:00
Robert Raposa
973fb3c4c6 fix: enhance safe session setting documentation (#29723)
Adds note to documentation around the requirement
for setting SAFE_SESSIONS_DEBUG_PUBLIC_KEY to log
encrypted headers.

ARCHBOM-1940
2022-01-06 13:44:53 -05:00
Robert Raposa
d0259ff38e fix: enhance safe session monitoring (#29681)
* add custom attribute for list of user ids on mismatch.
* log request header for all mismatched users for all
requests for N seconds after the mismatch is found, if
LOG_REQUEST_USER_CHANGE_HEADERS is enabled. See toggle
docs for more details.

ARCHBOM-1940
2022-01-06 12:15:31 -05:00
Aarif
6c5b1ef551 fix: updated the imports order to fix quality failure (#29722) 2022-01-06 11:39:33 -05:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Kshitij Sobti
b5f045dc5f fix: update discussions MFE path [BD-38] [TNL-9347] (#29691)
* fix: update discussiosn MFE path

* squash!: fix tests
2022-01-06 18:34:53 +05:00
Michael Terry
be2b7ba0be Merge pull request #29707 from edx/mikix/sequence-but-not
fix: give proper status code for invalid sequence metadata requests
2022-01-04 15:02:45 -05:00
Michael Terry
712380713b fix: give proper status code for invalid sequence metadata requests
If the sequence metadata view is asked to give metadata for a block
that is not a sequence (or section), give a proper http code back,
rather than throwing an attribute exception.

This avoids a monitoring error being flagged, and lets the frontend
catch this case specially (which the MFE does do, to notice that it
actually has a unit, not a sequence).
2022-01-04 14:30:48 -05:00
uzairr
5a3e67d8f4 refactor: update hibp range function
Refactor range function to check whether the provided password
is properly encrypted or needed to be encrypted.

VAN-789
2022-01-04 15:37:17 +05:00
Felipe Trzaskowski
c0e19ec165 Add new discussions API endpoints to retrieve comments and threads from an user [BD-38] [TNL-8796] [BB-4969] (#29137)
* feat: add api mapping to get comments by course+user

fix: merge the new user comments API by overloading the thread comments API

fix: handle endorsements and fix broken tests

fix: improve the view documentation

fix: unused imports

fix: restrict flagged filter to privileged users

fix: validate course_id properly

* fix: add docstring to the retrieve_all method
2022-01-04 11:21:47 +05:00
DawoudSheraz
f970ab4566 feat: add admin-only/self accessible verified name field in accounts api 2021-12-29 14:51:10 +05:00
AliAkbar
0141c2b866 fix: fix sec staff-lock email 2021-12-22 16:53:29 +05:00
Attiya Ishaque
51b67ad1df fix: Replace hardcoded 'edx' with platform name. (#29657) 2021-12-22 12:51:56 +05:00
Awais Jibran
371a3ef1c6 fix: add pii sharing allowed flag (#29628) 2021-12-21 15:07:49 +05:00
Waheed Ahmed
c696469734 fix: save for later API ratelimit issue (#29650) 2021-12-21 14:05:55 +05:00
Michael Terry
4418c66171 feat: add masquerading support to learning sequences
Previously, it had some basic manual masquerading by calling the
endpoint with ?user=mytestuser. But this adds standard session
masquerading support to the endpoint as well.

This support is limited by LS's own partition group support. It
only looks at the enrollment track partition currently. Further
FBE and cohort partition support will come later.

But this commit opens up normal session masquerading for:
- Generic student
- Specific student
- Enrollment track

AA-1151
2021-12-20 11:14:07 -05:00
Waheed Ahmed
a85880ce46 chore: change ratelimit key for POST email param (#29638) 2021-12-20 15:09:59 +05:00
Michael Roytman
492b17899b Merge pull request #29626 from edx/mroytman/MST-1254-change-_does_name_change_require_verification-to-use-passing-cert-statuses
Do Not Prevent Learner From Changing Name if Learner Is Not Enrolled in Verified Mode or Learner Has Non-Passable Certificate
2021-12-17 11:04:35 -05:00
michaelroytman
ea3dc9cad6 fix: Do Not Prevent Learner From Changing Name With Non-Verified Enrollment/Non-Passable Certificate
The _does_name_change_require_verification(user_profile, old_name, new_name) method of the accounts user_api determines whether a learner can change their name from old_name to new_name. Originally, it delegated solely to the NameChangeValidator class of the edx-name-affirmation API, which ran a set of checks against the name change. One of said checks was asserting that learners with one or more certificates could not change their name without completing IDV.

This pull request changes this behavior.

Learners may have certificates that are not in a passable status (e.g. "unverified"). We only want to require IDV for name changes for learners that have passing statuses. The existing code prevented learners from changing their name if they had any certificates at all, irrespective of the certificate status. This change only considers certificates in a passable status.

Additionally, learners may have certificates and also not be enrolled in any "verified" seats. For example, despite edX no longer offering "honor" seats, learners may have enrollments in "honor" modes, which grant certificates but are not considered "verified" enrollment modes. IDV requires that a learner be enrolled in a "verified" seat in order to complete IDV. Prior to this change, learners that were navigated to IDV to validate a name change were unable to complete IDV. This change introduce a check that a learner is in a "verified" mode in addition to using the NameChangeValidator. This prevents the account MFE from navigating an IDV-ineligible learner to IDV.

MST-1254: https://openedx.atlassian.net/browse/MST-1254
2021-12-16 14:26:07 -05:00
Syed Muhammad Dawoud Sheraz Ali
74cce08c48 Merge pull request #29445 from regisb/regisb/fix-language-cookie-samesite
fix: language cookie "samesite" attribute
2021-12-16 14:42:04 +05:00
Muhammad Soban Javed
ac7a42d196 Merge pull request #29520 from edx/iamsobanjaved/pytest-warnings-gha
test: save pytest warning reports to GHA artifacts
2021-12-16 14:10:15 +05:00
Régis Behmo
53b8a80668 fix: language cookie "samesite" attribute
The language cookie "samesite" attribute was always set to "None", even in
non-secure environments, such as the devstack. This was causing client-side
warnings in non-https environments, and the language cookie was not properly
set.
2021-12-16 09:04:26 +01:00
Ned Batchelder
e39f9c503a build: suppress Django deprecation warnings (#29528)
Suppress them both in tests (via setup.py and pytest.ini)
and in management command & application runs
(via logsettings.py).

Developers aren't looking at these warnings; they'll be dealt with in a
formal process for upgrading Django.  Suppress them for now so that
important information isn't lost in the noise.
2021-12-15 10:45:12 -05:00
Soban Javed
b4ac8d284a test: save pytest warning reports to GHA artifacts
- add pytest_hooks import back in common/lib/conftest.py. This import was removed during refactoring work
2021-12-15 17:06:40 +05:00
Michael Terry
34138c1516 Merge pull request #29606 from edx/mikix/401-for-anon
fix: have learning sequence give 401 for anon users instead of 404
2021-12-14 12:00:39 -05:00
Michael Terry
a630747695 fix: have learning sequence give 401 for anon users instead of 404
This will avoid leaking whether a course exists or not to anonymous
users and also avoid some false-positive error rates when web
crawlers hit bad URLs.
2021-12-14 11:32:50 -05:00
John Nagro
3873ff7de9 feat: avoid certain strings in the suffix appended to edX usernames (#29524)
ENT-2824
2021-12-13 15:32:51 -05:00
=Awais Jibran
51b2b89bcd fix: add is_configured property 2021-12-13 15:11:31 +05:00
Ali Akbar
7fe43a3cbf Merge pull request #29519 from edx/aakbar/PROD-2590
feat: allow get account info on lms user id
2021-12-10 12:50:13 +05:00
Tim McCormack
9f9e0acc55 feat: Destroy session and send back an error if user identity changes (#28456)
A new feature toggle, default off, causes the session to be deleted when
the user identity on the response does not match the session or request.

There are a small number of requests that cause the user present on the
session at the time of the request to be a different user by the time of
the response. As far as I can tell, these are all cases where a user's
browser somehow ends up with a mix of cookies from multiple legitimate
login sessions on different accounts on the same device.

Because there no longer seems to be any case where this mismatch occurs
and where the response should be allowed through, this commit introduces
a feature toggle `ENFORCE_SAFE_SESSIONS` which will destroy the active
session and overwrite the response.

The plan is to make this behavior available in the next named release and
permanent in the one after.

Also:

- Use less fragile method of checking mocked set_attribute calls in tests
2021-12-09 19:23:22 +00:00
AliAkbar
c07c5bc0dd feat: allow get account info on lms user id 2021-12-09 20:27:18 +05:00
Michael Terry
e2e37154ce fix: add a couple guards for anonymous users
This fixes a couple places (LastSeenCoursewareTimezone and
UserCourseTag) where we were saving an entry for a user, but not
making sure we ignored anonymous users.
2021-12-09 10:26:51 -05:00
AsadAzam
3f06445389 feat: added pii params for program discussions (#29532)
* feat: added pii params for program discussions

* refactor: added conditions
2021-12-09 18:39:34 +05:00
Jawayria
472ccdabe0 Merge pull request #29431 from edx/jawayria/bom-2606-35
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-09 18:20:46 +05:00
Jawayria
584c5daf16 Merge pull request #29432 from edx/jawayria/bom-2606-34
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-09 18:20:23 +05:00
Jawayria
95eb23cc07 Merge pull request #29433 from edx/jawayria/bom-2606-33
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-09 18:19:56 +05:00
Jawayria
29127830ff Merge pull request #29434 from edx/jawayria/bom-2606-32
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-09 18:19:18 +05:00
Kshitij Sobti
00e3affa90 fix: Include all blocks and skip access checks for get_divided_discussions (#29539) 2021-12-09 16:20:31 +05:00
Jawayria
e48031cd86 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:39:45 +05:00
Jawayria
7663592aa6 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:37:27 +05:00
Jawayria
67b44d3b45 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:35:36 +05:00
Jawayria
8ccb8b0608 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:32:06 +05:00
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
uzairr
443034ed55 refactor: add a property to distinguish old and new users
Add a new prop in existing props to differentiate users either
a particular one is newly registered or not.

VAN-665
2021-12-07 17:59:31 +05:00