Commit Graph

5049 Commits

Author SHA1 Message Date
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
Zainab Amir
acf5add774 feat: add marketing email option on registration (#29397) 2021-12-07 17:16:28 +05:00
Kshitij Sobti
9f4bc9900b feat: add discussions context to course blocks API (#29300)
Add a new course blocks transformer that adds discussion context for units.
2021-12-07 11:10:48 +05:00
Dillon Dumesnil
f1cc288189 Merge pull request #29510 from edx/ddumesnil/override-freq-cap-aa-1127
feat: AA-1127: Overrides Braze Frequency Cap for dynamic pacing emails
2021-12-06 07:44:55 -08:00
Dillon Dumesnil
709290544d feat: AA-1127: Overrides Braze Frequency Cap for dynamic pacing emails
edx-ace version 1.4.1 introduces the ability to override braze
email frequency caps.
2021-12-06 07:56:28 -07:00
Jawayria
a1c4b82cd5 Merge pull request #29435 from edx/jawayria/bom-2606-31
chore: Applied lint-amnesty on openedx/core/djangoapps
2021-12-06 15:23:46 +05:00
Jawayria
86d7cce373 Merge pull request #29436 from edx/jawayria/bom-2606-30
chore: Applied lint-amnesty on openedx/core/djangoapps/content
2021-12-06 15:23:25 +05:00
Jawayria
61f3ef0724 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-06 14:06:57 +05:00
Jawayria
959b6cef6c chore: Applied lint-amnesty on openedx/core/djangoapps/content 2021-12-06 14:06:13 +05:00
Jawayria
3adfe1de97 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-06 14:05:13 +05:00
Shafqat Farhan
84cba23c0b feat: VAN-666 - Reject new password that is detected as vulnerable on password reset 2021-12-03 19:19:21 +05:00
Régis Behmo
13342835b0 feat: theme-agnostic view to fetch theme assets (#29461)
It is possible to set custom logos in microfrontends, for instance with the
LOGO_URL setting. Ideally, we would like that MFEs share the same logos as the
LMS. But this is made difficult when comprehensive theming is enabled, and the
logo is overridden by a custom theme. In that scenario, the logo url becomes
/static/mytheme/images/logo.png. But the MFEs do no know that the "mytheme"
theme is enabled. To resolve this issue, we introduce here a view, at the
"/theming/asset/<path>" url, that redirects to the corresponding asset in the
theme that is currently enabled. Thus, MFEs only have to set
`LOGO_URL=http://lmshost/theming/asset/images/logo.png` to point to the themed
logo.

Related issue: https://github.com/overhangio/tutor-mfe/issues/25
2021-12-02 16:38:12 -05:00