Releases: openedx/edx-rest-api-client
Drop Python 2.7 Support
Drops Python 2.7 support.
No change
Restore oauth_uri variable
Restores the deleted oauth_uri
variable of OAuthAPIClient
. This is a fix for our ProctorTrack integration, which was relying on the oauth_uri
variable as part of the contract. This may or may not be a long-term solution.
Note: The removal of this variable originally landed after 1.9.2 and was first released with 2.0.0.
Additionally, since OAuthAPIClient
can be used to retrieve tokens against multiple oauth endpoints, we add the oauth_url to the cache key for the token.
Caching for deprecated `EdxRestApiClient` to help transition off of it
Adds caching to deprecated EdxRestApiClient
to help transition off of it.
To enable an iterative transition to OAuthAPIClient
from the deprecated EdxRestApiClient
, use EdxRestApiClient.get_and_cache_jwt_oauth_access_token
to get the same JWT token used and cached by OAuthAPIClient
.
Also:
- Includes a NewRelic custom metric to tag which api client was used.
- Adds cache expiration to match access token expiration.
- Allows LMS oauth endpoint url argument to optionally include a path.
BREAKING CHANGE: This should be a non-issue, but if you had passed EdxRestApiClient.get_oauth_access_token
a url that did not end with/oauth2/access_token/
it would have been left unchanged before this release, but after this release it would now have /oauth2/access_token/
appended. Since in actuality the LMS oauth endpoint ends with /oauth2/access_token/
, this seems unlikely to be an issue.
BOM-897
Add caching to OAuthAPIClient
Adds internal caching of access tokens to OAuthAPIClient using the Django-based TieredCache.
Note: Also drops Python 3.6 testing in favor of Python 3.5 and 3.8.
BREAKING CHANGE:
- The addition of the TieredCache means that Django is required, as well as certain custom middleware. See the README update for details.
- Removed
OAuthAPIClient.oauth_uri
.
Correctly refresh tokens
Instead of using the refresh_token grant type for automatically refreshing tokens, just do a normal client_credentials request.
Fixed refresh_token grant request
The refresh_token request was not passing in the previously acquired access token.
Added OAuthAPIClient
This release adds OAuthAPIClient
, a requests.Session
subclass which automatically authenticates with the preferred edX API authentication method (currently using JWT tokens).
It also marks EdxRestApiClient
as deprecated, because Slumber is no longer supported.
Fix for Travis PyPI deploy - take 2.
This fixes a minor issue in the last attempt to fix the Travis PyPi deployment.
Fix for Travis PyPI deploy.
1.8.1 Fix pypi deploy for tags.