Commit Graph

34 Commits

Author SHA1 Message Date
M. Zulqarnain
6286de8bd1 refactor: pyupgrade on ace_common, api_admin, auth_exchange (#26782) 2021-03-12 14:15:03 +05:00
Robert Raposa
40611bb915 ARCHBOM-1667: fix: remove authentication from auth exchange (#26618)
* Remove authentication, including SessionAuthentication, to fix CSRF
  exemption by dropping CSRF check of SessionAuthentication.
* Several changes to make it more clear that only POST is supported and
  clean up GET method testing.
* Removed the temporary 403 error logging that wasn't working.
* Removed test_single_access_token which was written for DOP, but
  doesn't work with DOT. See
  [MA-2122](https://openedx.atlassian.net/browse/MA-2122) for a ticket
  about implementing this for DOT, although it doesn't seem to be a
  priority. NOTE: A comment was added to the ticket explaining that this
  test was removed.
* GET now returns default error for methods not allowed.

ARCHBOM-1667
2021-02-23 10:57:11 -05:00
Aarif
277d52982c reaplced unittest assertions pytest assertions (#26241) 2021-02-04 09:55:55 +05:00
Awais Qureshi
42e7cac6dc BOM-2315
Apply pylint-amnesty.
2021-02-03 12:15:41 +05:00
Ahtisham Shahid
3dfb25cb5d Updated/refactored logs in auth exchange (#26077) 2021-01-27 12:12:28 +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
Ahtisham Shahid
32985420c0 Added named logs (#26036)
Added named logs
2021-01-12 13:28:47 +05:00
Ahtisham Shahid
33fb1e6b4a added logs in oauth exchange (#26005) 2021-01-11 19:05:28 +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
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
edX requirements bot
5724432741 Python Requirements Update (#23984)
* Updating Python Requirements

* Constrain django-cookies-samesite until dep bug fixed

* Fix PEP 8 problems revealed by pycodestyle upgrade

Co-authored-by: Tim McCormack <tmccormack@edx.org>
Co-authored-by: Jeremy Bowman <jbowman@edx.org>
2020-05-13 20:24:30 +00:00
Manjinder Singh
4399d13955 removing all of provider (#23269)
* Revert "Ran make migration on third_party_auth (#23253)"

This reverts commit 49be65cc58.

* Removing provider.util import

* Removing further provider things

* Adding hash tests
2020-03-03 10:42:18 -05:00
jinder1s
295da79fe5 Remove DOP dispatching from oauth_dispatch.
https://openedx.atlassian.net/browse/BOM-1330
2020-02-27 10:47:06 -05:00
Manjinder Singh
e9e584b28b Removing DOP from auth_exchange (#23187)
-  This PR removes all imports from provider by either bringing them into edx-platform or finding dot replacement. Removing tests that tested dop parts of code. 

-  Skipping some tests and removing dop

The tests are difficult to fix due to its entanglement with dop use in third_party_auth.
These tests should be restarted once dop has been removed from third_party_auth and its tests.

-  set ENABLE_DOP_ADAPTER = False for devstack
2020-02-26 10:21:26 -05:00
Manjinder Singh
d7bd80a100 Renamed OAuth2Authentication to BearerAuthentication (#23128)
* Renamed OAuth2Authentication to BearerAuthentication
* Added back OAuth2Authentication name
-there are libraries such as edx-enterprise that still import OAuth2Authentication.  The OAuth2Authentication class should be fully removed when everything is importing BearerAuthentication correctly
2020-02-18 13:29:29 -05:00
Manjinder Singh
cce8cdd661 Replacing OAuth2Auth (#23067)
- Removing deprecated auth classes
- Replacing OAuth2AuthenticationAllowInactiveUserDeprecated with OAuth2AuthenticationAllowInactiveUser
- the old class was a child class of a deprecated class that we are removing and replacing.
2020-02-11 10:38:13 -05:00
Manjinder Singh
cea795b02e Added new auth class (#23018)
* Added new auth class

- Created new class called OAuth2AuthenticationAllowInactiveUser, which replaces old class with same name
- Renames previous  OAuth2AuthenticationAllowInactiveUser to  OAuth2AuthenticationAllowInactiveUserDeprecated
- Replaced all imports of  OAuth2AuthenticationAllowInactiveUser to call deprecated class instead
- testing new class in discussion(added flag based on django setting)
2020-02-06 10:37:27 -05:00
Feanil Patel
6e3fe00fff Fix all E303 pep8 errors. 2019-12-30 12:25:38 -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
83eb9e7f1a Fix auth_exchange tests BOM-648 2019-09-18 16:37:52 -04:00
David Ormsbee
9a1385585f Convert response bytes to str before JSON parsing. (#21375)
Convert response bytes to str before JSON parsing.
2019-08-19 11:01:55 -04:00
Anthony Wee
54de24596e INCR-114: Run python-modernize on openedx/core/djangoapps/auth_exchange (#20442)
* INCR-114: Run python-modernize on openedx/core/djangoapps/auth_exchange

* isort
2019-05-07 11:14:23 -04:00
Matthew Piatetsky
f294b1a374 fix unicode strings in openedx/ part 1 2019-02-13 10:47:35 -05:00
Ned Batchelder
3353e7425e Remove unused imports 2018-11-03 16:07:05 -04:00
Nimisha Asthagiri
45dadca18b Add email and profile scopes in JWT Cookies 2018-10-18 08:11:04 -04:00
Nimisha Asthagiri
02ba5fb0e8 Login service support for JWT Cookies 2018-10-01 13:08:40 -04:00
Jeremy Bowman
d90afa4cde TE-2689 Remove useless pylint suppressions part 5 2018-08-21 11:07:52 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Ahsan Ulhaq
e272175756 update LoginWithAccessTokenView to only support DIT type accesstoken
LEARNER-3552
2018-03-13 14:23:00 +05:00
Ned Batchelder
e23e3a0486 Fix a number of unused-import pylint violations 2017-11-21 19:57:06 -05:00
bmedx
763fa4de99 Remove empty models.py files 2017-10-17 16:21:21 -04:00
Uman Shahzad
8b65ca17c5 Migrate to latest, split python-social-auth.
PSA was monolothic, now split, with new features, like
a DB-backed partial pipeline. FB OAuth2 version also upped.

Partial pipelines don't get cleared except when necessary.
They persist for special cases like change of browser while
still mid-pipeline (i.e. email validation step).

Refactor, cleanup, and update of a lot of small things as well.

PLEASE NOTE the new `social_auth_partial` table.
2017-06-20 22:05:36 +05:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Nimisha Asthagiri
4c0f85b4d9 Move auth_exchange from common to openedx/core.
Move oauth_dispatch from lms to openedx/core.
2016-10-06 12:54:39 -04:00