Skip to content

Commit

Permalink
feat: DEPR USE-JWT-COOKIE header
Browse files Browse the repository at this point in the history
This repo is no longer using USE-JWT-COOKIE header,
since it has the required edx-drf-extensions>10.2.0,
where it was fully removed.

This is final clean-up for this repo.

See "[DEPR]: USE-JWT-COOKIE header" for more details:
- openedx/edx-drf-extensions#371
  • Loading branch information
robrap committed Aug 28, 2024
1 parent eb81cba commit 2a0b4d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ To get a JWT role defined inside your cookie, do the following:
"enterprise_learner:{another-enterprise-uuid}",
"enterprise_openedx_operator:*"
]
#. Soon, you'll make a request to e.g. http://localhost:18160/api/v1/enterprise-catalogs/?format=json. Before you do this,
it's important that you can make the request with an additional header: ``use_jwt_cookie: true`` This tells
our auth middleware to "reconstitute" the JWT cookie header and signature into a single JWT from which auth, roles, etc.
can be fetched. You can do this in your browser using a tool like ModHeader, or with something like Postman.
#. Make the request. For the example endpoint above, you should get a response payload that looks like::
#. Make a request to e.g. http://localhost:18160/api/v1/enterprise-catalogs/?format=json. For this example endpoint, you should get a response payload that looks like::

{
"count": 2,
Expand Down
4 changes: 1 addition & 3 deletions enterprise_catalog/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@

# Enable CORS
CORS_ALLOW_CREDENTIALS = True
CORS_ALLOW_HEADERS = corsheaders_default_headers + (
'use-jwt-cookie',
)
CORS_ALLOW_HEADERS = corsheaders_default_headers
CORS_ORIGIN_WHITELIST = []

ROOT_URLCONF = 'enterprise_catalog.urls'
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ edx-auth-backends
edx-celeryutils
edx-django-release-util
edx-django-utils
edx-drf-extensions
edx-drf-extensions>=10.2.0 # removes use-jwt-cookie header
edx_rbac
edx-rest-api-client
edx-toggles
Expand Down

0 comments on commit 2a0b4d0

Please sign in to comment.