Commit Graph

31 Commits

Author SHA1 Message Date
Kshitij Sobti
9e787a09bc chore: remove dependency on rest_condition (#28663)
rest-condition has not been updated for a while, and with DRF 3.9 it is no longer needed since the ability to combine Permission classes using boolean operators is now provided by DRF directly.
2021-10-04 15:38:17 -04:00
Jawayria
9909b933a7 Applied pylint-amnesty to openedx/core/{djangolib, lib, tests, *.py 2021-02-02 21:13:24 +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
Tim McCormack
f29e418264 Revert "Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)" (#25055)
This reverts commit 986a448d9e.
2020-09-28 13:53:57 +00:00
Ahtisham Shahid
986a448d9e Revert "ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)" (#25025)
This reverts commit ba9ee4e151.

Fixed Style lint issue
2020-09-21 13:48:00 +05:00
Tim McCormack
ba9ee4e151 ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)
This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
2020-09-18 13:33:50 +00:00
Robert Raposa
372d2e927c BOM-1264: add third-party-auth scope and usage (#23135)
* WIP: add third-party-auth scope and usage

BOM-1264


* Fix tests now that we do permissions in a more standard way.

Rather than manually setting the permission class we previously
explicitly raised a PermissionDenied exception.  The way DRF
permissoning logic works, if we use the WWW-Authenticate header in the
highest priority auth class, it will return a 401 instead of a 403.


* Added test to make sure having permissions gives access to user mapping api

* Test new filters logic.

Ensure that the filters we add to the application access model make it
into the JWT correctly.

* quality fix

* quality fix

* disable pylint warning

* quality fix

* fix indent prob

Co-authored-by: Feanil Patel <feanil@edx.org>
Co-authored-by: Manjinder Singh <49171515+jinder1s@users.noreply.github.com>
2020-02-21 11:25:28 -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
Andrés González
26b3a40133 INCR-108 (#20058)
* INCR-108: Run python-modernize on openedx/core/lib

* Fixed urlencode import

* Fixed diff quality warnings and six.string_types error

* Fixed pickle import

* Fixed iteritems import

* Fixed ungrouped imports

* Fixed six.moves import issues
2019-04-02 10:26:00 -04:00
Nimisha Asthagiri
ce4cb53672 Update Permissions to use latest edx-drf-extensions and rest_condition 2018-06-28 18:37:53 -04:00
Kabir Khan
c0f353467e V1 Grades API with added support for bulk read of all user grades in a course.
URL patterns changed to follow edx API conventions
2018-05-03 10:23:33 -07:00
Waheed Ahmed
20e7a15ac6 Fix enabling debug allows api access without authentication.
LEARNER-1220
2018-04-04 12:54:52 +05:00
Harry Rein
bc76ffe5dc Add message for setting course goal.
LEARNER-2307
2017-09-22 09:56:27 -04:00
Brandon DeRosier
a31855c935 Upstream the Bulk Enroll API endpoint 2017-07-14 14:01:16 -04:00
Andy Armstrong
93235d118d Reorder imports using isort (except lms and cms) 2017-05-30 16:04:54 -04:00
Douglas Hall
b44864b353 Check API View kwargs for username when checking for staff or owner permission 2017-01-11 07:09:48 +00:00
Edward Fagin
dc4150ca51 Add logging when header permissions in use. 2016-10-18 10:21:43 -04:00
Giovanni Di Milia
7683eadcaf Modified permission classes for CCX REST APIs
Modified how the per object permissions are enforced in the CCX REST APIs
2016-02-24 08:40:07 -05:00
Giovanni Di Milia
e63194c1cd Added CCX REST APIs
CCX REST APIs
OAUTH2 authorization for CCX APIs
- oauth2 authorization required for ccx list.
- Course-instructor permission for ccx api endpoint
- Protection for detail view too.

Tests for CCX REST APIs and OAUTH2 authorization
2016-01-27 11:04:28 -05:00
Clinton Blackburn
dfadb28343 Fixed Permissions Bug
The permissions class now supports non-GET requests.

ECOM-2893
2015-12-11 13:02:05 -05:00
Clinton Blackburn
c90880719f Corrected permission class and test
- The permission now checks the correct request attribute (GET instead of data).
- The Credit API view test has been updated to check for the positive access instead of just denial.

 ECOM-3096
2015-12-04 10:18:53 -05:00
Clinton Blackburn
92153752c0 Rewrote Credit API
- API built atop Django REST Framework
- Added support for OAuth 2.0 and session authentication
- Added permissions around eligibility data

ECOM-2609
2015-11-24 22:06:54 -05:00
Matt Drayer
1eab25f292 mattdrayer/increment-edx-lint: Bump to v0.2.9 and address pylint/pep8 violations
* Fix paver violations to stablize edx-lint update
* Parens, Line2Long
* Fix missing docstrings
* Fix PEP8 issues
* Address PR feedback (thanks @nedbat!)
2015-10-19 10:11:59 -04:00
Clinton Blackburn
2da42d5efa Removed IsAuthenticatedOrDebug
IsAuthenticatedOrDebug hides potential issues with API client code that is run in local environments and later deployed to production where authentication fails.

XCOM-193
2015-06-10 18:55:27 -04:00
Ben McMorran
9d336c33eb TNL-1897 Implement Course Team API 2015-06-03 18:04:17 +00:00
Nimisha Asthagiri
a7fabd5927 Move generic mobile API view decorators. 2015-05-27 14:35:27 -04:00
jsa
46b63164a0 Implement profile_image upload and remove endpoints
TNL-1537

Co-Authored-By: Andy Armstrong <andya@edx.org>
Co-Authored-By: cahrens <christina@edx.org>
2015-04-17 17:23:12 -04:00
Andy Armstrong
6976a33a85 Add the preferences endpoint to the User API
TNL-1493

See https://openedx.atlassian.net/wiki/display/TNL/User+API for details
2015-03-16 23:34:35 -04:00
Diana Huang
1e4f1b5889 Allow the enrollment API to be accessed via API keys.
XCOM-107
2015-03-02 16:07:27 -05:00
cahrens
023e6ec8cd GET method for user account API. 2015-02-20 14:52:46 -05:00
Clinton Blackburn
2854bb9524 Added Course Structure API 2015-02-17 13:23:34 -05:00